[PATCH] D111443: [Driver] Fix ToolChain::getSanitizerArgs

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 8 11:19:07 PDT 2021


tra added a comment.

I'm curious why we need the cache at all. While the construction of sanitizer args is hairy, it's only called few times from the driver and will be lost in the noise compared to everything else.



================
Comment at: clang/include/clang/Driver/ToolChain.h:165
 
-  mutable std::unique_ptr<SanitizerArgs> SanitizerArguments;
+  mutable std::map<const llvm::opt::ArgList *, std::unique_ptr<SanitizerArgs>>
+      SanArgs;
----------------
Using argument list as a proxy for a job is somewhat questionable. ArgList may not necessarily be related to a particular job at all.

Can we use JobAction as the key instead and default to full reconstruction of sanitizer args where it's not available? Or just always construct them without caching?


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

https://reviews.llvm.org/D111443



More information about the cfe-commits mailing list