summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bytecode/Reader
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2004-12-04 22:19:53 +0000
committerReid Spencer <rspencer@reidspencer.com>2004-12-04 22:19:53 +0000
commitef510c0279bf1ace0dec660ceee455ac0292bb9d (patch)
tree4e269cbe4afec3ab007f4349c7e3ac8c76023ba5 /llvm/lib/Bytecode/Reader
parent5ae9a04e40f5c9ec3c8ca97043aecd8ddd0db212 (diff)
downloadbcm5719-llvm-ef510c0279bf1ace0dec660ceee455ac0292bb9d.tar.gz
bcm5719-llvm-ef510c0279bf1ace0dec660ceee455ac0292bb9d.zip
Provide more information in the error message that occurs when there are
unresolved constants remaining. llvm-svn: 18502
Diffstat (limited to 'llvm/lib/Bytecode/Reader')
-rw-r--r--llvm/lib/Bytecode/Reader/Reader.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/llvm/lib/Bytecode/Reader/Reader.cpp b/llvm/lib/Bytecode/Reader/Reader.cpp
index a18019aca0a..8f0a7f8a8dc 100644
--- a/llvm/lib/Bytecode/Reader/Reader.cpp
+++ b/llvm/lib/Bytecode/Reader/Reader.cpp
@@ -1571,8 +1571,16 @@ void BytecodeReader::ParseConstantPool(ValueTable &Tab,
// After we have finished parsing the constant pool, we had better not have
// any dangling references left.
- if (!ConstantFwdRefs.empty())
- error("Unresolved constant references exist!");
+ if (!ConstantFwdRefs.empty()) {
+ typedef std::map<std::pair<const Type*,unsigned>, Constant*> ConstantRefsType;
+ ConstantRefsType::const_iterator I = ConstantFwdRefs.begin();
+ const Type* missingType = I->first.first;
+ Constant* missingConst = I->second;
+ error(utostr(ConstantFwdRefs.size()) +
+ " unresolved constant reference exist. First one is '" +
+ missingConst->getName() + "' of type '" +
+ missingType->getDescription() + "'.");
+ }
checkPastBlockEnd("Constant Pool");
if (Handler) Handler->handleGlobalConstantsEnd();
OpenPOWER on IntegriCloud