summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bytecode/Reader/Reader.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2004-07-18 00:12:03 +0000
committerReid Spencer <rspencer@reidspencer.com>2004-07-18 00:12:03 +0000
commitdb1863d50cbfe80dc1181ed139dc4a16c61df5ec (patch)
treeb7c38e840b81e52bdbe4a69d8de35afcfb8abd57 /llvm/lib/Bytecode/Reader/Reader.cpp
parentedbb40b23c9d509b1e5afe88af0d1a847d6ad7a8 (diff)
downloadbcm5719-llvm-db1863d50cbfe80dc1181ed139dc4a16c61df5ec.tar.gz
bcm5719-llvm-db1863d50cbfe80dc1181ed139dc4a16c61df5ec.zip
bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage - Correct isa<Constant> for GlobalValue subclass llvm-svn: 14939
Diffstat (limited to 'llvm/lib/Bytecode/Reader/Reader.cpp')
-rw-r--r--llvm/lib/Bytecode/Reader/Reader.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/llvm/lib/Bytecode/Reader/Reader.cpp b/llvm/lib/Bytecode/Reader/Reader.cpp
index 389dc573700..4d1ee41242b 100644
--- a/llvm/lib/Bytecode/Reader/Reader.cpp
+++ b/llvm/lib/Bytecode/Reader/Reader.cpp
@@ -425,12 +425,9 @@ Constant* BytecodeReader::getConstantValue(unsigned TypeSlot, unsigned Slot) {
if (Value *V = getValue(TypeSlot, Slot, false))
if (Constant *C = dyn_cast<Constant>(V))
return C; // If we already have the value parsed, just return it
- else if (GlobalValue *GV = dyn_cast<GlobalValue>(V))
- // ConstantPointerRef's are an abomination, but at least they don't have
- // to infest bytecode files.
- return ConstantPointerRef::get(GV);
else
- error("Reference of a value is expected to be a constant!");
+ error("Value for slot " + utostr(Slot) +
+ " is expected to be a constant!");
const Type *Ty = getType(TypeSlot);
std::pair<const Type*, unsigned> Key(Ty, Slot);
@@ -1356,14 +1353,13 @@ Constant *BytecodeReader::ParseConstantValue(unsigned TypeID) {
GlobalValue *GV;
if (Val) {
if (!(GV = dyn_cast<GlobalValue>(Val)))
- error("Value of ConstantPointerRef not in ValueTable!");
+ error("GlobalValue not in ValueTable!");
} else {
error("Forward references are not allowed here.");
}
- Constant* Result = ConstantPointerRef::get(GV);
- if (Handler) Handler->handleConstantPointer(PT, Slot, GV, Result);
- return Result;
+ if (Handler) Handler->handleConstantPointer(PT, Slot, GV );
+ return GV;
}
default:
OpenPOWER on IntegriCloud