[llvm] r281617 - address comments from: https://reviews.llvm.org/D24566

Etienne Bergeron via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 15 08:19:19 PDT 2016


Author: etienneb
Date: Thu Sep 15 10:19:19 2016
New Revision: 281617

URL: http://llvm.org/viewvc/llvm-project?rev=281617&view=rev
Log:
address comments from: https://reviews.llvm.org/D24566
using startswith instead of find.

Modified:
    llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp
    llvm/trunk/test/Instrumentation/AddressSanitizer/do-not-instrument-sanitizers.ll

Modified: llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp?rev=281617&r1=281616&r2=281617&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp Thu Sep 15 10:19:19 2016
@@ -1883,7 +1883,7 @@ bool AddressSanitizer::runOnFunction(Fun
   if (&F == AsanCtorFunction) return false;
   if (F.getLinkage() == GlobalValue::AvailableExternallyLinkage) return false;
   if (!ClDebugFunc.empty() && ClDebugFunc == F.getName()) return false;
-  if (F.getName().find("__asan_") != std::string::npos) return false;
+  if (F.getName().startswith("__asan_") != std::string::npos) return false;
 
   // If needed, insert __asan_init before checking for SanitizeAddress attr.
   // This function needs to be called even if the function body is not

Modified: llvm/trunk/test/Instrumentation/AddressSanitizer/do-not-instrument-sanitizers.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Instrumentation/AddressSanitizer/do-not-instrument-sanitizers.ll?rev=281617&r1=281616&r2=281617&view=diff
==============================================================================
--- llvm/trunk/test/Instrumentation/AddressSanitizer/do-not-instrument-sanitizers.ll (original)
+++ llvm/trunk/test/Instrumentation/AddressSanitizer/do-not-instrument-sanitizers.ll Thu Sep 15 10:19:19 2016
@@ -21,4 +21,4 @@ entry:
   ret i32 0
 }
 
-; CHECK: declare void @__asan_init()
\ No newline at end of file
+; CHECK: declare void @__asan_init()




More information about the llvm-commits mailing list