[PATCH] D131631: [MSAN] Separate id ptr from constant string for variable names used in track origins.

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 10 17:18:14 PDT 2022


vitalybuka added inline comments.


================
Comment at: compiler-rt/lib/msan/msan_interface_internal.h:112
+                               uptr pc);
 SANITIZER_INTERFACE_ATTRIBUTE
 u32 __msan_chain_origin(u32 id);
----------------
we should not change interface of existing function and just add:
void __msan_set_alloca_origin_with_name(void *a, uptr size, u32 *id_ptr, char *descr);




================
Comment at: llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp:239
        cl::Hidden, cl::init(0xff));
 
 static cl::opt<bool> ClPoisonUndef("msan-poison-undef",
----------------
```
static cl::opt<bool> ClPrintStacklNames("msan-print-stack-names",
       cl::desc("Print name of local stack variable"),
       cl::Hidden, cl::init(true));
```


================
Comment at: llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp:248
 
 static cl::opt<bool> ClHandleICmpExact("msan-handle-icmp-exact",
        cl::desc("exact handling of relational integer ICmp"),
----------------
```
static cl::opt<bool> ClPrintLocalNames("msan-print-local-names",
       cl::desc("Print name of local stack variable"),
       cl::Hidden, cl::init(true));
```


================
Comment at: llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp:689
 
-#ifdef kda_COMMENTED_OUT
 /// Create a non-const global initialized with the given string.
----------------
commit base is wrong?


================
Comment at: llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp:3904
+      Value *Descr = getLocalVarDescription(I);
       IRB.CreateCall(MS.MsanSetAllocaOriginFn,
                      {IRB.CreatePointerCast(&I, IRB.getInt8PtrTy()), Len,
----------------
```
if (ClPrintLocalVNames) {
  IRB.CreateCall(MS.MsanSetAllocaOriginNameFn, ...
} else {
  IRB.CreateCall(MS.MsanSetAllocaOriginFn, ...
}
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131631



More information about the llvm-commits mailing list