[PATCH] D71953: [Tooling] Infer driver mode and target for FixedCompilationDatabase

2019-12-29 Thread Hanjiang Yu via Phabricator via cfe-commits
de1acr0ix abandoned this revision. de1acr0ix added a comment. 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". Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://rev

[PATCH] D71953: [Tooling] Infer driver mode and target for FixedCompilationDatabase

2019-12-28 Thread Hanjiang Yu via Phabricator via cfe-commits
de1acr0ix updated this revision to Diff 235496. de1acr0ix added a comment. 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. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION ht

[PATCH] D71953: [Tooling] Infer driver mode and target for FixedCompilationDatabase

2019-12-27 Thread Hanjiang Yu via Phabricator via cfe-commits
de1acr0ix planned changes to this revision. de1acr0ix added a comment. 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. Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D71953: [Tooling] Infer driver mode and target for FixedCompilationDatabase

2019-12-27 Thread Hanjiang Yu via Phabricator via cfe-commits
de1acr0ix created this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. 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 spe