[PATCH] D56470: [NewPM] Second attempt at porting ASan

Philip Pfaffe via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 25 00:49:36 PST 2019


philip.pfaffe added inline comments.


================
Comment at: llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp:1148
+  GlobalsMetadata &GlobalsMD =
+      AM.getResult<GlobalsMetadataAnalysis>(F).getGlobalsMD();
+  const TargetLibraryInfo *TLI = &AM.getResult<TargetLibraryAnalysis>(F);
----------------
leonardchan wrote:
> philip.pfaffe wrote:
> > When GlobalsMD stops being a function analysis, this won't work anymore. It might then happen that the result is not available, so you need to handle that case. IMHO that should be a hard error, but alternatively asan can either not run or compute the MD itself. In any case it should not be silent!
> One question before continuing: so how can this function pass use the results of this module analysis if it's not a function pass? When turning on the debug pass manager with opt, the analysis does not actually get run. Wrapping it in a require wrapper with "-passed='require<asan-globals-md>'" allows it to run on the module pass manager, but still crashes when the function pass manager runs.
> 
> The crash is that `"This analysis pass was not registered prior to being queried"` (the GlobalsMetadataAnalysis).
You need to get it through the ModuleAnalysisManager proxy.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D56470





More information about the llvm-commits mailing list