getLastArgIntValue is a useful utility function to get command line argument as an integer.
Currently it is in Frontend so that it can only be used by clang -cc1. Move it to basic so
that it can also be used by clang driver.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/lib/Basic/OptionUtils.cpp | ||
---|---|---|
19 | I'd use anonymous namespace instead of static. | |
23 | Does it have to be base-10? | |
34 | This needs updating. |
clang/include/clang/Basic/OptionUtils.h | ||
---|---|---|
25 | What are the rules on using LLVM headers here? Can we just include llvm/Option/ArgList.h instead? | |
47 | Same question as before -- does it have to be 10? | |
clang/lib/Basic/CMakeLists.txt | ||
1 | I think now that you're using ArgList, you need to depend on LLVM's LLVMOption library. |
clang/include/clang/Basic/OptionUtils.h | ||
---|---|---|
25 | In the API llvm::opt::ArgList is used as reference, therefore it only needs a forward declaration. llvm::opt::OptSpecifier is passed by value, therefore it needs header. OptSpecifier is a small class, therefore it is not efficient to pass by reference. | |
47 | will do. StringRef will do radix autosensing for that. | |
clang/lib/Basic/CMakeLists.txt | ||
1 | will do |
Why move this to Basic instead of to Driver if you want to use it in Driver? (Frontend depends on Driver so it could then still use it.)
What are the rules on using LLVM headers here? Can we just include llvm/Option/ArgList.h instead?