[PATCH] [clang-tidy] Move -extra-arg handling to CommonOptionsProvider

Alexander Kornienko alexfh at google.com
Mon Nov 3 06:45:21 PST 2014


================
Comment at: lib/Tooling/CommonOptionsParser.cpp:141-142
@@ -93,2 +140,4 @@
   }
+  Compilations = llvm::make_unique<ArgumentsAdjustingCompilations>(
+      std::move(Compilations), ArgsBefore, ArgsAfter);
 }
----------------
klimek wrote:
> alexfh wrote:
> > klimek wrote:
> > > 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?
> > 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.
> 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...
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?

http://reviews.llvm.org/D6073






More information about the cfe-commits mailing list