When creating FixedCompilationDatabase from command line, compiler
command is often provided. This commit tries to infer driver mode and
target from that so that clang tools does not need to specify them
explicitly.
Details
Details
- Reviewers
klimek
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
- Build Status
Buildable 42999 Build 43638: arc lint + arc unit
Event Timeline
Comment Actions
I realized an obvious problem: if the first argument is "-cc" or something compiler option ends with a possible driver mode suffix it would be treated as compiler binary name.
Comment Actions
Check if argv[0] is an option before inferring - anything starting with dash or slash (but without a second slash) will be treated as compiler option.
Comment Actions
It is impossible to handle the case that positional argument starts with a source file with a driver mode suffix in file name stem, such as "somecpp.cpp".