Use StringRef::startswith instead of find(...) == 0.
It's faster and easier to read.
llvm-svn: 271018
diff --git a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
index a4a52b7..26be336 100644
--- a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
@@ -848,9 +848,9 @@
}
static bool GlobalWasGeneratedByAsan(GlobalVariable *G) {
- return G->getName().find(kAsanGenPrefix) == 0 ||
- G->getName().find(kSanCovGenPrefix) == 0 ||
- G->getName().find(kODRGenPrefix) == 0;
+ return G->getName().startswith(kAsanGenPrefix) ||
+ G->getName().startswith(kSanCovGenPrefix) ||
+ G->getName().startswith(kODRGenPrefix);
}
Value *AddressSanitizer::memToShadow(Value *Shadow, IRBuilder<> &IRB) {