[llvm-commits] [llvm] r44218 - /llvm/trunk/lib/AsmParser/LLLexer.cpp

Chris Lattner sabre at nondot.org
Sun Nov 18 10:43:25 PST 2007


Author: lattner
Date: Sun Nov 18 12:43:24 2007
New Revision: 44218

URL: http://llvm.org/viewvc/llvm-project?rev=44218&view=rev
Log:
autoupgrade files that use callfoo as call foo.

Modified:
    llvm/trunk/lib/AsmParser/LLLexer.cpp

Modified: llvm/trunk/lib/AsmParser/LLLexer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLLexer.cpp?rev=44218&r1=44217&r2=44218&view=diff

==============================================================================
--- llvm/trunk/lib/AsmParser/LLLexer.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLLexer.cpp Sun Nov 18 12:43:24 2007
@@ -617,12 +617,20 @@
     }
   }
   
-  // Finally, if this is "cc1234", return this as just "cc".
+  // If this is "cc1234", return this as just "cc".
   if (TokStart[0] == 'c' && TokStart[1] == 'c') {
     CurPtr = TokStart+2;
     return CC_TOK;
   }
   
+  // If this starts with "call", return it as CALL.  This is to support old
+  // broken .ll files.  FIXME: remove this with LLVM 3.0.
+  if (CurPtr-TokStart > 4 && !memcmp(TokStart, "call", 4)) {
+    CurPtr = TokStart+4;
+    llvmAsmlval.OtherOpVal = Instruction::Call;
+    return CALL;
+  }
+  
   // Finally, if this isn't known, return just a single character.
   CurPtr = TokStart+1;
   return TokStart[0];





More information about the llvm-commits mailing list