diff options
| author | Chris Lattner <sabre@nondot.org> | 2002-08-15 19:37:11 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2002-08-15 19:37:11 +0000 |
| commit | d8ecff793a34fb08f7c7171cc0f0408e374f2724 (patch) | |
| tree | b5d250e3bfc8dd1d031e518fd25196bdc2cdb7ee /llvm/lib | |
| parent | d81cc451694ca9f1e3d99ce4e1c5cd102bd2751f (diff) | |
| download | bcm5719-llvm-d8ecff793a34fb08f7c7171cc0f0408e374f2724.tar.gz bcm5719-llvm-d8ecff793a34fb08f7c7171cc0f0408e374f2724.zip | |
Parse const expr cast instruction the same way the instruction is formed
llvm-svn: 3353
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/AsmParser/llvmAsmParser.y | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/AsmParser/llvmAsmParser.y b/llvm/lib/AsmParser/llvmAsmParser.y index 5eed0ebc57e..47685355f60 100644 --- a/llvm/lib/AsmParser/llvmAsmParser.y +++ b/llvm/lib/AsmParser/llvmAsmParser.y @@ -993,9 +993,12 @@ ConstVal : SIntType EINT64VAL { // integral constants }; -ConstExpr: Types CAST ConstVal { - $$ = ConstantExpr::getCast($3, $1->get()); +ConstExpr: Types CAST ConstVal TO Types { + $$ = ConstantExpr::getCast($3, $5->get()); + if ($1->get() != $5->get()) + ThrowException("Mismatching ConstExpr cast type"); delete $1; + delete $5; } | Types GETELEMENTPTR '(' ConstVal IndexList ')' { if (!isa<PointerType>($4->getType())) |

