Fix complete badness in bugpoint's IsARMArchitecture() function.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Thu, 13 May 2010 17:58:15 +0000 (17:58 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Thu, 13 May 2010 17:58:15 +0000 (17:58 +0000)
The revision history for this function is interesting, with multiple layers of
wrongness being introduced one at a time.

This fixes a weird issue where bugpoint -run-llc would suddenly exit 13 half way
through isolating a miscompilation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103721 91177308-0d34-0410-b5e6-96231b3b80d8

tools/bugpoint/ToolRunner.cpp

index 1ff44c72ecfd2a2014d2c3e09d5e75e36fad78b5..4baafd127b2f199ee1b43595e5a57ec1546644e5 100644 (file)
@@ -620,10 +620,9 @@ CBE *AbstractInterpreter::createCBE(const char *Argv0,
 static bool IsARMArchitecture(std::vector<std::string> Args) {
   for (std::vector<std::string>::const_iterator
          I = Args.begin(), E = Args.end(); I != E; ++I) {
-    StringRef S(*I);
-    if (!S.equals_lower("-arch")) {
+    if (StringRef(*I).equals_lower("-arch")) {
       ++I;
-      if (I != E && !S.substr(0, strlen("arm")).equals_lower("arm"))
+      if (I != E && StringRef(*I).substr(0, strlen("arm")).equals_lower("arm"))
         return true;
     }
   }