[llvm-commits] [llvm] r113603 - /llvm/trunk/lib/VMCore/AutoUpgrade.cpp

Bill Wendling isanbard at gmail.com
Fri Sep 10 12:06:58 PDT 2010


Author: void
Date: Fri Sep 10 14:06:58 2010
New Revision: 113603

URL: http://llvm.org/viewvc/llvm-project?rev=113603&view=rev
Log:
Early exit with simple checks.

Modified:
    llvm/trunk/lib/VMCore/AutoUpgrade.cpp

Modified: llvm/trunk/lib/VMCore/AutoUpgrade.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/AutoUpgrade.cpp?rev=113603&r1=113602&r2=113603&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/AutoUpgrade.cpp (original)
+++ llvm/trunk/lib/VMCore/AutoUpgrade.cpp Fri Sep 10 14:06:58 2010
@@ -368,9 +368,12 @@
 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;





More information about the llvm-commits mailing list