[PATCH] D131205: Desist from passing function location to __msan_set_alloca_origin4.

Kevin Athey via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 4 14:41:23 PDT 2022


kda created this revision.
kda added a reviewer: vitalybuka.
Herald added subscribers: Enna1, hiraditya.
Herald added a project: All.
kda requested review of this revision.
Herald added projects: Sanitizers, LLVM.
Herald added subscribers: llvm-commits, Sanitizers.

This is done by calling __msan_set_alloca_origin and providing the location of the variable by using the call stack.
This is prepatory work for dropping variable names when track-origins is enabled.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D131205

Files:
  compiler-rt/lib/msan/msan.cpp
  llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp


Index: llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
===================================================================
--- llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
+++ llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
@@ -3916,9 +3916,6 @@
   void instrumentAlloca(AllocaInst &I, Instruction *InsPoint = nullptr) {
     if (!InsPoint)
       InsPoint = &I;
-#ifdef kda_COMMENTED_OUT
-    llvm::errs() << I << "-" << *InsPoint << "=" << *(InsPoint->getNextNode()) << '\n';
-#endif  /* kda_COMMENTED_OUT */
     IRBuilder<> IRB(InsPoint->getNextNode());
     IRB.SetCurrentDebugLocation(InsPoint->getDebugLoc());
     const DataLayout &DL = F.getParent()->getDataLayout();
Index: compiler-rt/lib/msan/msan.cpp
===================================================================
--- compiler-rt/lib/msan/msan.cpp
+++ compiler-rt/lib/msan/msan.cpp
@@ -31,10 +31,6 @@
 #include "ubsan/ubsan_flags.h"
 #include "ubsan/ubsan_init.h"
 
-#ifdef kda_COMMENTED_OUT
-extern "C" void __sanitizer_symbolize_pc(void *pc, const char *fmt, char *out_buf, uptr out_buf_size);
-#endif  /* kda_COMMENTED_OUT */
-
 // ACHTUNG! No system header includes in this file.
 
 using namespace __sanitizer;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131205.450133.patch
Type: text/x-patch
Size: 1211 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220804/0a6cdec9/attachment.bin>


More information about the llvm-commits mailing list