summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-12-04 05:20:06 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-12-04 05:20:06 +0000
commitf349069f1c8357fd4aaf9824ba060b46296a85c0 (patch)
treeec45b1999c568db9f482a077397e9544f78042c3 /llvm/lib
parentee3c991a6e7ec94adeb8efc1a5be3c11b6a2f472 (diff)
downloadbcm5719-llvm-f349069f1c8357fd4aaf9824ba060b46296a85c0.tar.gz
bcm5719-llvm-f349069f1c8357fd4aaf9824ba060b46296a85c0.zip
For PR950: For ICmp and FCmp constant expressions, put the predicate outiside the parentheses to match what llvm-upgrade generates.
llvm-svn: 32171
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/AsmParser/llvmAsmParser.y14
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/AsmParser/llvmAsmParser.y b/llvm/lib/AsmParser/llvmAsmParser.y
index 27e359775d7..6ae9ceb3f90 100644
--- a/llvm/lib/AsmParser/llvmAsmParser.y
+++ b/llvm/lib/AsmParser/llvmAsmParser.y
@@ -1127,7 +1127,7 @@ CastOps : TRUNC | ZEXT | SEXT | FPTRUNC | FPEXT | BITCAST |
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 @@ ConstExpr: CastOps '(' ConstVal TO Types ')' {
$$ = 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)
OpenPOWER on IntegriCloud