[PATCH] D113060: [ASan] Turned on callback optimization on by default.

Kirill Stoimenov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 2 14:47:14 PDT 2021


kstoimenov created this revision.
Herald added a subscriber: hiraditya.
kstoimenov requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This will only affect projects, which use callbacks for code instrumentation.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D113060

Files:
  llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp


Index: llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
===================================================================
--- llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
+++ llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
@@ -365,7 +365,7 @@
 
 static cl::opt<bool> ClOptimizeCallbacks("asan-optimize-callbacks",
                                          cl::desc("Optimize callbacks"),
-                                         cl::Hidden, cl::init(false));
+                                         cl::Hidden, cl::init(true));
 
 static cl::opt<bool> ClOptSameTemp(
     "asan-opt-same-temp", cl::desc("Instrument the same temp just once"),
@@ -2873,6 +2873,7 @@
 
 bool AddressSanitizer::instrumentFunction(Function &F,
                                           const TargetLibraryInfo *TLI) {
+  printf("ZXCV3(%p): %s, %d\n", &F, F.getName().data(), F.getLinkage());
   if (F.getLinkage() == GlobalValue::AvailableExternallyLinkage) return false;
   if (!ClDebugFunc.empty() && ClDebugFunc == F.getName()) return false;
   if (F.getName().startswith("__asan_")) return false;
@@ -2888,6 +2889,8 @@
   // Leave if the function doesn't need instrumentation.
   if (!F.hasFnAttribute(Attribute::SanitizeAddress)) return FunctionModified;
 
+  printf("ZXCV1(%p): %s, %d\n", &F, F.getName().data(), F.getLinkage());
+
   LLVM_DEBUG(dbgs() << "ASAN instrumenting:\n" << F << "\n");
 
   initializeCallbacks(*F.getParent());


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113060.384244.patch
Type: text/x-patch
Size: 1456 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211102/4f594909/attachment.bin>


More information about the llvm-commits mailing list