如何获得clang中描述的所有命令行选项?

时间:2013-12-22 16:56:56

标签: clang llvm

当我查看LLVM和clang代码库时,我看到了各种各样的命令行选项,我似乎无法实现。例如,在AliasAnalysisCounter.cpp内部,我看到:

static cl::opt<bool>
PrintAll("count-aa-print-all-queries", cl::ReallyHidden, cl::init(true));
static cl::opt<bool>
PrintAllFailures("count-aa-print-all-failed-queries", cl::ReallyHidden);

当我尝试从命令行获取它们时:

~ robertzeh$ clang++ -count-aa-print-all-failed-queries foo.c
clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated
clang: warning: argument unused during compilation: '-count-aa-print-all-failed-queries'

clang版报道:

~ robertzeh$ clang++ --version
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin12.5.0

我做错了什么或误解了什么?

2 个答案:

答案 0 :(得分:2)

窥探选项clang(驱动程序)和clang cc1(前端)接受的好地方是:

  • include/clang/Driver/Options.td
  • include/clang/Driver/CC1Options.td

答案 1 :(得分:1)

您无法直接访问各种转换过程中定义的选项。尝试clang++ -mllvm -count-aa-print-all-failed-queries foo.c