[llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.y

Reid Spencer reid at x10sys.com
Sun Dec 3 21:20:21 PST 2006



Changes in directory llvm/lib/AsmParser:

llvmAsmParser.y updated: 1.283 -> 1.284
---
Log message:

For PR950: http://llvm.org/PR950 : For ICmp and FCmp constant expressions, put the predicate outiside the parentheses to match what llvm-upgrade generates.

---
Diffs of the changes:  (+7 -7)

 llvmAsmParser.y |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)


Index: llvm/lib/AsmParser/llvmAsmParser.y
diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.283 llvm/lib/AsmParser/llvmAsmParser.y:1.284
--- llvm/lib/AsmParser/llvmAsmParser.y:1.283	Sun Dec  3 10:19:43 2006
+++ llvm/lib/AsmParser/llvmAsmParser.y	Sun Dec  3 23:20:06 2006
@@ -1127,7 +1127,7 @@
                UITOFP | SITOFP | FPTOUI | FPTOSI | INTTOPTR | PTRTOINT;
 ShiftOps     : SHL | LSHR | ASHR;
 IPredicates  
-  : EQ   { $$ = ICmpInst::ICMP_EQ; } | NE   { $$ = ICmpInst::ICMP_NE; }
+  : EQ   { $$ = ICmpInst::ICMP_EQ; }  | NE   { $$ = ICmpInst::ICMP_NE; }
   | SLT  { $$ = ICmpInst::ICMP_SLT; } | SGT  { $$ = ICmpInst::ICMP_SGT; }
   | SLE  { $$ = ICmpInst::ICMP_SLE; } | SGE  { $$ = ICmpInst::ICMP_SGE; }
   | ULT  { $$ = ICmpInst::ICMP_ULT; } | UGT  { $$ = ICmpInst::ICMP_UGT; }
@@ -1706,15 +1706,15 @@
     $$ = ConstantExpr::get($1, $3, $5);
     CHECK_FOR_ERROR
   }
-  | ICMP '(' IPredicates ',' ConstVal ',' ConstVal ')' {
-    if ($5->getType() != $7->getType())
+  | ICMP IPredicates '(' ConstVal ',' ConstVal ')' {
+    if ($4->getType() != $6->getType())
       GEN_ERROR("icmp operand types must match!");
-    $$ = ConstantExpr::getICmp($3, $5, $7);
+    $$ = ConstantExpr::getICmp($2, $4, $6);
   }
-  | FCMP '(' FPredicates ',' ConstVal ',' ConstVal ')' {
-    if ($5->getType() != $7->getType())
+  | FCMP FPredicates '(' ConstVal ',' ConstVal ')' {
+    if ($4->getType() != $6->getType())
       GEN_ERROR("fcmp operand types must match!");
-    $$ = ConstantExpr::getFCmp($3, $5, $7);
+    $$ = ConstantExpr::getFCmp($2, $4, $6);
   }
   | ShiftOps '(' ConstVal ',' ConstVal ')' {
     if ($5->getType() != Type::UByteTy)






More information about the llvm-commits mailing list