OSDN Git Service

address comments from: https://reviews.llvm.org/D24566
authorEtienne Bergeron <etienneb@google.com>
Thu, 15 Sep 2016 15:19:19 +0000 (15:19 +0000)
committerEtienne Bergeron <etienneb@google.com>
Thu, 15 Sep 2016 15:19:19 +0000 (15:19 +0000)
using startswith instead of find.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281617 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Instrumentation/AddressSanitizer.cpp
test/Instrumentation/AddressSanitizer/do-not-instrument-sanitizers.ll

index df180df..f2c0cc2 100644 (file)
@@ -1883,7 +1883,7 @@ bool AddressSanitizer::runOnFunction(Function &F) {
   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
index fc263aa..b4407a8 100644 (file)
@@ -21,4 +21,4 @@ entry:
   ret i32 0
 }
 
-; CHECK: declare void @__asan_init()
\ No newline at end of file
+; CHECK: declare void @__asan_init()