diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2006-12-04 05:20:06 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2006-12-04 05:20:06 +0000 |
commit | 763ed5e4ac4e896d66ad73b6df5b6fcf91ea58d3 (patch) | |
tree | 890e530648cc2d4633a2ecde41690d0fb08278b1 /lib | |
parent | 077d0eb1bd54b71143139a5184d291454d638ebc (diff) | |
download | external_llvm-763ed5e4ac4e896d66ad73b6df5b6fcf91ea58d3.zip external_llvm-763ed5e4ac4e896d66ad73b6df5b6fcf91ea58d3.tar.gz external_llvm-763ed5e4ac4e896d66ad73b6df5b6fcf91ea58d3.tar.bz2 |
For PR950: For ICmp and FCmp constant expressions, put the predicate outiside the parentheses to match what llvm-upgrade generates.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32171 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/AsmParser/llvmAsmParser.y | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/AsmParser/llvmAsmParser.y b/lib/AsmParser/llvmAsmParser.y index 27e3597..6ae9ceb 100644 --- a/lib/AsmParser/llvmAsmParser.y +++ b/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) |