[PATCH] D54337: [ASan] Make AddressSanitizer a ModulePass

Fedor Sergeev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 3 12:47:18 PST 2018


fedor.sergeev added a comment.

In D54337#1309109 <https://reviews.llvm.org/D54337#1309109>, @tamur wrote:

> I am not an expert or have a good context, please excuse my trespassing, just as a guy reading the code and trying to understand, this is my understanding:
>
> 1. GlobalsMD.init(M); is the only expensive part of the AddressSanitizer initialization.
> 2. All data in GlobalsMD is obtained from a module, in GlobalsMetadata::init(Module& M).
> 3. (Maybe this is not obvious) Function objects have a reference to their module via Function::getParent() method.
> 4. Therefore, every expensive data that the function pass for AddressSanitizer needs, can be stored in Module objects:


Up to this point it kinda makes sense.
However, this suggestion of storing supplementary passes information into the IR itself does not sound like a good design decision.
A typical solution for LLVM to store supporting information is to introduce an Analysis, so it kinda floats around the IR, but
is not being stored directly into it.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D54337





More information about the llvm-commits mailing list