XiaoKL

llvm.107.clang-options-1-Introduction

clang options: 1 Introduction

 

1. Hidden options

--help-hidden

Display help for hidden options

 

2. Frontend options

"clang -cc1 is the frontendclang is the driver." Ref[1]

 

"Some clang command line options are driver-only options, some are frontend-only options.

Frontend-only options are intended to be used only by clang developers.

Users should not run clang -cc1 directly, because -cc1 options are not guaranteed to be stable." Ref[1]

 

"you can run clang -Xclang <option> ... to force the driver pass <option> to clang -cc1." Ref[1]

 

2.1 -###

-###                    Print (but do not run) the commands to run for this compilation

"You can use the -### command-line option to print out the "frontend flags" that have been translated from the driver" Ref[2] 

 

2.2 -E

Ref[3]

Stop before compiling, after preprocessing, produces .i

 

2.3 -S

Ref[3]

Stop before assembling, produces .s

 

2.4 -c

Ref[3]

Stop before linking, produces .o

 

2.5 -v

Print commands executed and run

 

2.6 -o -

Print to stdout rather than write output to file

 

 


Reference

1. I run clang -cc1 ... and get weird errors about missing headers

https://clang.llvm.org/docs/FAQ.html

 

2. LLVM Techniques Tips and Best Practices Clang and Middle-End Libraries

by Min-Yih Hsu

 

3. IMPORTANT COMPILER-GENERIC FLAGS

https://clangbuiltlinux.github.io/llvm-dev-conf-2020/nick/debugging_llvm.html#/3

 

 

posted on 2022-06-25 10:07  XiaoKL  阅读(51)  评论(0编辑  收藏  举报

导航