summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2010-09-10 19:06:58 +0000
committerBill Wendling <isanbard@gmail.com>2010-09-10 19:06:58 +0000
commitebd3e5f4cc8656191ee56c028930c0092815518f (patch)
tree386b402d2f1f2fd6e7017b65eac6eb5ccfaad4de /lib
parentde49f360ec4780acb382a3ae923d1716fdb0dc03 (diff)
downloadllvm-ebd3e5f4cc8656191ee56c028930c0092815518f.tar.gz
llvm-ebd3e5f4cc8656191ee56c028930c0092815518f.tar.bz2
llvm-ebd3e5f4cc8656191ee56c028930c0092815518f.tar.xz
Early exit with simple checks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113603 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/VMCore/AutoUpgrade.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/VMCore/AutoUpgrade.cpp b/lib/VMCore/AutoUpgrade.cpp
index 3908e8aed6..2eeb35414a 100644
--- a/lib/VMCore/AutoUpgrade.cpp
+++ b/lib/VMCore/AutoUpgrade.cpp
@@ -368,9 +368,12 @@ bool llvm::UpgradeIntrinsicFunction(Function *F, Function *&NewFn) {
bool llvm::UpgradeGlobalVariable(GlobalVariable *GV) {
const std::string &Name = GV->getName();
- // We are only upgrading one symbol here. If we upgrade more, we will want to
- // perform some sort of short-circuiting like in the
- // "UpgradeIntrinsicFunction1" function.
+ // 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;
+
+ // We are only upgrading one symbol here.
if (Name == ".llvm.eh.catch.all.value") {
GV->setName("llvm.eh.catch.all.value");
return true;