diff options
author | Bill Wendling <isanbard@gmail.com> | 2010-09-10 20:42:26 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2010-09-10 20:42:26 +0000 |
commit | f9e49e86ee9f06c2808c6e57723c5650615e689d (patch) | |
tree | 8c9ee548392bee09f39d523a6d7f1bd121a93cc9 /lib | |
parent | 4bafda9618f9dfa9edc8da08bb3001ef2d1a9b68 (diff) | |
download | external_llvm-f9e49e86ee9f06c2808c6e57723c5650615e689d.zip external_llvm-f9e49e86ee9f06c2808c6e57723c5650615e689d.tar.gz external_llvm-f9e49e86ee9f06c2808c6e57723c5650615e689d.tar.bz2 |
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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/VMCore/AutoUpgrade.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/VMCore/AutoUpgrade.cpp b/lib/VMCore/AutoUpgrade.cpp index 2eeb354..9330e14 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") { |