[PATCH] D44511: [MSan] Introduce ActualFnStart. NFC

Alexander Potapenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 26 01:49:47 PDT 2018


glider added inline comments.


================
Comment at: lib/Transforms/Instrumentation/MemorySanitizer.cpp:741
       : F(F), MS(MS), VAHelper(CreateVarArgHelper(F, MS, *this)) {
     bool SanitizeFunction = F.hasFnAttribute(Attribute::SanitizeMemory);
     InsertChecks = SanitizeFunction;
----------------
vitalybuka wrote:
> can you initialize ActualFnStart here?
Note that this code will finally look like:

```
     if (MS.CompileKernel)
       ActualFnStart = insertKmsanPrologue(F);
     else
       ActualFnStart = &F.getEntryBlock();
```

, so we'll be basically performing some instrumentation in the constructor instead of runOnFunction().
If you're fine with that, I'll proceed, but the ActualFnStart initialization needs to be performed after setting InsertChecks, PropagateShadow, PoisonStack etc., i.e. at the very end of the constructor.
Also, we'll have to move `MS.initializeCallbacks(*F.getParent());` into the constructor as well.


Repository:
  rL LLVM

https://reviews.llvm.org/D44511





More information about the llvm-commits mailing list