mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-26 18:20:39 +00:00
Parse const expr cast instruction the same way the instruction is formed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3353 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -993,9 +993,12 @@ ConstVal : SIntType EINT64VAL { // integral constants
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
ConstExpr: Types CAST ConstVal {
|
ConstExpr: Types CAST ConstVal TO Types {
|
||||||
$$ = ConstantExpr::getCast($3, $1->get());
|
$$ = ConstantExpr::getCast($3, $5->get());
|
||||||
|
if ($1->get() != $5->get())
|
||||||
|
ThrowException("Mismatching ConstExpr cast type");
|
||||||
delete $1;
|
delete $1;
|
||||||
|
delete $5;
|
||||||
}
|
}
|
||||||
| Types GETELEMENTPTR '(' ConstVal IndexList ')' {
|
| Types GETELEMENTPTR '(' ConstVal IndexList ')' {
|
||||||
if (!isa<PointerType>($4->getType()))
|
if (!isa<PointerType>($4->getType()))
|
||||||
|
|||||||
Reference in New Issue
Block a user