Add support for And, XOR, and Or
authorChris Lattner <sabre@nondot.org>
Sat, 20 Oct 2001 09:32:59 +0000 (09:32 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 20 Oct 2001 09:32:59 +0000 (09:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@924 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AsmParser/Lexer.l
lib/AsmParser/llvmAsmParser.y

index 5bbe672882a1e72a1a5823c5885826dc63102f35..e9996b28295ab8aa0c7559780bd216f4b3b3ef36 100644 (file)
@@ -162,6 +162,9 @@ sub             { RET_TOK(BinaryOpVal, Sub, SUB); }
 mul             { RET_TOK(BinaryOpVal, Mul, MUL); }
 div             { RET_TOK(BinaryOpVal, Div, DIV); }
 rem             { RET_TOK(BinaryOpVal, Rem, REM); }
+and             { RET_TOK(BinaryOpVal, And, AND); }
+or              { RET_TOK(BinaryOpVal, Or , OR ); }
+xor             { RET_TOK(BinaryOpVal, Xor, XOR); }
 setne           { RET_TOK(BinaryOpVal, SetNE, SETNE); }
 seteq           { RET_TOK(BinaryOpVal, SetEQ, SETEQ); }
 setlt           { RET_TOK(BinaryOpVal, SetLT, SETLT); }
index e5fad6c18650817ade38dbee39894c427ca175f0..128d4797758bfb95fd77c4e0593ce171eb736502 100644 (file)
@@ -195,6 +195,7 @@ static const Type *getTypeVal(const ValID &D, bool DoNotImprovise = false) {
     // Check that the number is within bounds...
     if (Num <= CurMeth.Types.size())
       return CurMeth.Types[Num];
+    break;
   }
   case 1: {                // Is it a named definition?
     string Name(D.Name);
@@ -716,7 +717,7 @@ Module *RunVMAsmParser(const string &Filename, FILE *F) {
 
 // Binary Operators 
 %type  <BinaryOpVal> BinaryOps  // all the binary operators
-%token <BinaryOpVal> ADD SUB MUL DIV REM
+%token <BinaryOpVal> ADD SUB MUL DIV REM AND OR XOR
 %token <BinaryOpVal> SETLE SETGE SETLT SETGT SETEQ SETNE  // Binary Comarators
 
 // Memory Instructions
@@ -751,7 +752,7 @@ EINT64VAL : EUINT64VAL {
 // RET, BR, & SWITCH because they end basic blocks and are treated specially.
 //
 UnaryOps  : NOT
-BinaryOps : ADD | SUB | MUL | DIV | REM
+BinaryOps : ADD | SUB | MUL | DIV | REM | AND | OR | XOR
 BinaryOps : SETLE | SETGE | SETLT | SETGT | SETEQ | SETNE
 ShiftOps  : SHL | SHR