[PATCH] D52497: [MSan] Add meaningful debug locations to [K]MSan hooks poisoning local variables

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 25 09:12:26 PDT 2018


aprantl added a comment.

Why is the DILocation



================
Comment at: lib/Transforms/Instrumentation/MemorySanitizer.cpp:3308
       Value *Descr = getLocalVarDescription(I);
-      IRB.CreateCall(MS.MsanSetAllocaOrigin4Fn,
-                     {IRB.CreatePointerCast(&I, IRB.getInt8PtrTy()), Len,
-                      IRB.CreatePointerCast(Descr, IRB.getInt8PtrTy()),
-                      IRB.CreatePointerCast(&F, MS.IntptrTy)});
+      DILocation *Loc = getLocalVarDILocation(I);
+      CallInst *Call =
----------------
This is backwards. You can't infer the DILocation for a dbg.value from the SSA value its pointing to. One SSA Value may holds the value of many source variables.


Repository:
  rL LLVM

https://reviews.llvm.org/D52497





More information about the llvm-commits mailing list