summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2010-09-10 20:42:26 +0000
committerBill Wendling <isanbard@gmail.com>2010-09-10 20:42:26 +0000
commitf9e49e86ee9f06c2808c6e57723c5650615e689d (patch)
tree8c9ee548392bee09f39d523a6d7f1bd121a93cc9
parent4bafda9618f9dfa9edc8da08bb3001ef2d1a9b68 (diff)
downloadllvm-f9e49e86ee9f06c2808c6e57723c5650615e689d.tar.gz
llvm-f9e49e86ee9f06c2808c6e57723c5650615e689d.tar.bz2
llvm-f9e49e86ee9f06c2808c6e57723c5650615e689d.tar.xz
Use StringRef which performs the "early exit" when compared against a constant
string. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113615 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/VMCore/AutoUpgrade.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/VMCore/AutoUpgrade.cpp b/lib/VMCore/AutoUpgrade.cpp
index 2eeb35414a..9330e141c3 100644
--- a/lib/VMCore/AutoUpgrade.cpp
+++ b/lib/VMCore/AutoUpgrade.cpp
@@ -366,12 +366,7 @@ bool llvm::UpgradeIntrinsicFunction(Function *F, Function *&NewFn) {
}
bool llvm::UpgradeGlobalVariable(GlobalVariable *GV) {
- const std::string &Name = GV->getName();
-
- // Early exit with simple tests.
- if (Name.length() != 24 || Name[0] != '.' || Name[1] != 'l' ||
- Name[3] != 'l' || Name[4] != 'v' || Name[5] != 'm' || Name[6] != '.')
- return false;
+ StringRef Name(GV->getName());
// We are only upgrading one symbol here.
if (Name == ".llvm.eh.catch.all.value") {