mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-10 02:36:06 +00:00
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
This commit is contained in:
parent
077d0eb1bd
commit
763ed5e4ac
@ -1127,7 +1127,7 @@ CastOps : TRUNC | ZEXT | SEXT | FPTRUNC | FPEXT | BITCAST |
|
|||||||
UITOFP | SITOFP | FPTOUI | FPTOSI | INTTOPTR | PTRTOINT;
|
UITOFP | SITOFP | FPTOUI | FPTOSI | INTTOPTR | PTRTOINT;
|
||||||
ShiftOps : SHL | LSHR | ASHR;
|
ShiftOps : SHL | LSHR | ASHR;
|
||||||
IPredicates
|
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; }
|
| SLT { $$ = ICmpInst::ICMP_SLT; } | SGT { $$ = ICmpInst::ICMP_SGT; }
|
||||||
| SLE { $$ = ICmpInst::ICMP_SLE; } | SGE { $$ = ICmpInst::ICMP_SGE; }
|
| SLE { $$ = ICmpInst::ICMP_SLE; } | SGE { $$ = ICmpInst::ICMP_SGE; }
|
||||||
| ULT { $$ = ICmpInst::ICMP_ULT; } | UGT { $$ = ICmpInst::ICMP_UGT; }
|
| ULT { $$ = ICmpInst::ICMP_ULT; } | UGT { $$ = ICmpInst::ICMP_UGT; }
|
||||||
@ -1706,15 +1706,15 @@ ConstExpr: CastOps '(' ConstVal TO Types ')' {
|
|||||||
$$ = ConstantExpr::get($1, $3, $5);
|
$$ = ConstantExpr::get($1, $3, $5);
|
||||||
CHECK_FOR_ERROR
|
CHECK_FOR_ERROR
|
||||||
}
|
}
|
||||||
| ICMP '(' IPredicates ',' ConstVal ',' ConstVal ')' {
|
| ICMP IPredicates '(' ConstVal ',' ConstVal ')' {
|
||||||
if ($5->getType() != $7->getType())
|
if ($4->getType() != $6->getType())
|
||||||
GEN_ERROR("icmp operand types must match!");
|
GEN_ERROR("icmp operand types must match!");
|
||||||
$$ = ConstantExpr::getICmp($3, $5, $7);
|
$$ = ConstantExpr::getICmp($2, $4, $6);
|
||||||
}
|
}
|
||||||
| FCMP '(' FPredicates ',' ConstVal ',' ConstVal ')' {
|
| FCMP FPredicates '(' ConstVal ',' ConstVal ')' {
|
||||||
if ($5->getType() != $7->getType())
|
if ($4->getType() != $6->getType())
|
||||||
GEN_ERROR("fcmp operand types must match!");
|
GEN_ERROR("fcmp operand types must match!");
|
||||||
$$ = ConstantExpr::getFCmp($3, $5, $7);
|
$$ = ConstantExpr::getFCmp($2, $4, $6);
|
||||||
}
|
}
|
||||||
| ShiftOps '(' ConstVal ',' ConstVal ')' {
|
| ShiftOps '(' ConstVal ',' ConstVal ')' {
|
||||||
if ($5->getType() != Type::UByteTy)
|
if ($5->getType() != Type::UByteTy)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user