From 4c5566730c991097ae20d4eacc04eb054943a405 Mon Sep 17 00:00:00 2001 From: Etienne Bergeron Date: Thu, 15 Sep 2016 15:19:19 +0000 Subject: [PATCH] address comments from: https://reviews.llvm.org/D24566 using startswith instead of find. llvm-svn: 281617 --- lib/Transforms/Instrumentation/AddressSanitizer.cpp | 2 +- .../AddressSanitizer/do-not-instrument-sanitizers.ll | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/lib/Transforms/Instrumentation/AddressSanitizer.cpp index df180df7dea..f2c0cc2a998 100644 --- a/lib/Transforms/Instrumentation/AddressSanitizer.cpp +++ b/lib/Transforms/Instrumentation/AddressSanitizer.cpp @@ -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 diff --git a/test/Instrumentation/AddressSanitizer/do-not-instrument-sanitizers.ll b/test/Instrumentation/AddressSanitizer/do-not-instrument-sanitizers.ll index fc263aad784..b4407a8fc6d 100644 --- a/test/Instrumentation/AddressSanitizer/do-not-instrument-sanitizers.ll +++ b/test/Instrumentation/AddressSanitizer/do-not-instrument-sanitizers.ll @@ -21,4 +21,4 @@ entry: ret i32 0 } -; CHECK: declare void @__asan_init() \ No newline at end of file +; CHECK: declare void @__asan_init()