[PATCH] D104036: [clang][deps] Prevent unintended modifications of the original TU command-line

Duncan P. N. Exon Smith via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jun 13 13:02:45 PDT 2021


dexonsmith accepted this revision.
dexonsmith added a comment.
This revision is now accepted and ready to land.

LGTM, with one suggestion inline.



================
Comment at: clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h:194
                      CompilerInstance &I, DependencyConsumer &C,
-                     std::map<std::string, std::string, std::less<>>
-                         OriginalPrebuiltModuleFiles);
+                     CompilerInvocation OriginalInvocation);
 
----------------
I wonder if it'd be better to take `CompilerInvocation&&` here. Then the caller is required to either pass `std::move` or make a deep copy at the call site, and it's perhaps more clear that there's a deep copy being made.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104036/new/

https://reviews.llvm.org/D104036



More information about the cfe-commits mailing list