Handle -extra-arg and -extra-arg-before options in the
CommonOptionsProvider so they can be used in all clang tools. Adjust arguments
in a CompilationDatabase wrapper instead of adding ArgumentsAdjuster to the
tool.
Details
Diff Detail
Event Timeline
lib/Tooling/CommonOptionsParser.cpp | ||
---|---|---|
138–139 | It seems to me like we'd want either this to take an ArgumentAdjuster instead of hard-coding to the args-before / args-after case? |
lib/Tooling/CommonOptionsParser.cpp | ||
---|---|---|
138–139 | This would make sense, if we make this compilation database wrapper public. But for this specific case the total amount of code is not larger than what would be needed for the ArgumentsAdjuster-based variant. |
lib/Tooling/CommonOptionsParser.cpp | ||
---|---|---|
138–139 | Well, if the code is not much larger, I'd go with the variant that fits the names better... Or do you have a specific reason for not handing in an argument adjuster? To me it was just unexpected when reading the code... |
lib/Tooling/CommonOptionsParser.cpp | ||
---|---|---|
138–139 | I'd like to see ArgumentsAdjuster replaced with an appropriate std::function eventually. As for the name of the compilation database wrapper, I'd better change it to something closer to the implementation, than vice versa. How about ExtraArgumentsInserterCompilations? Or CompilationsWithExtraArguments? |
lib/Tooling/CommonOptionsParser.cpp | ||
---|---|---|
138–139 | I'm not convinced that renaming is better - can you provide an argument on why you prefer the current implementation (you said the more composable implementation would be ~ the same length). |
The previous version looks marginally better to me due to slightly less
code, but this one turned out to be better than I expected. Which one do
you prefer?
LG. I prefer the current version.
lib/Tooling/CommonOptionsParser.cpp | ||
---|---|---|
82 | Do we also have to adjust here? |
lib/Tooling/CommonOptionsParser.cpp | ||
---|---|---|
82 | I think, it's used only in tests, but I see no reason not to adjust the commands here. |
Do we also have to adjust here?