summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bytecode/Reader/Reader.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-12-11 23:20:20 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-12-11 23:20:20 +0000
commit2d73fe7fadc17c763988953a7a952cc344452509 (patch)
tree32a8305f8a4acd1709b681f1b7aced7cd5a6d451 /llvm/lib/Bytecode/Reader/Reader.cpp
parent840cc9e1a9947223dbf638328652e3c587e865c2 (diff)
downloadbcm5719-llvm-2d73fe7fadc17c763988953a7a952cc344452509.tar.gz
bcm5719-llvm-2d73fe7fadc17c763988953a7a952cc344452509.zip
Create the cast constant expression that was read instead of attempting
to infer the cast from its operand and type. This fixes: test/Regression/Bytecode/2006-12-11-Cast-ConstExpr.ll llvm-svn: 32450
Diffstat (limited to 'llvm/lib/Bytecode/Reader/Reader.cpp')
-rw-r--r--llvm/lib/Bytecode/Reader/Reader.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Bytecode/Reader/Reader.cpp b/llvm/lib/Bytecode/Reader/Reader.cpp
index 2ac92bc9468..e2ab8c10e67 100644
--- a/llvm/lib/Bytecode/Reader/Reader.cpp
+++ b/llvm/lib/Bytecode/Reader/Reader.cpp
@@ -1325,7 +1325,8 @@ Value *BytecodeReader::ParseConstantPoolValue(unsigned TypeID) {
if (!Instruction::isCast(Opcode))
error("Only cast instruction has one argument for ConstantExpr");
- Constant *Result = ConstantExpr::getCast(ArgVec[0], getType(TypeID));
+ Constant *Result = ConstantExpr::getCast(Opcode, ArgVec[0],
+ getType(TypeID));
if (Handler) Handler->handleConstantExpression(Opcode, ArgVec, Result);
return Result;
} else if (Opcode == Instruction::GetElementPtr) { // GetElementPtr
OpenPOWER on IntegriCloud