aboutsummaryrefslogtreecommitdiffstats
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
commit3c39127b72f959ecedd62d3d97982d2fe8692fea (patch)
treecc1cde8d4fe08815dcab8aafea789ea48bd5e6af
parentb8e825b1ad9ac995f23cdca657ba3045d423b061 (diff)
downloadexternal_llvm-3c39127b72f959ecedd62d3d97982d2fe8692fea.zip
external_llvm-3c39127b72f959ecedd62d3d97982d2fe8692fea.tar.gz
external_llvm-3c39127b72f959ecedd62d3d97982d2fe8692fea.tar.bz2
Provide more information in the error message that occurs when there are
unresolved constants remaining. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18502 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Bytecode/Reader/Reader.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/Bytecode/Reader/Reader.cpp b/lib/Bytecode/Reader/Reader.cpp
index a18019a..8f0a7f8 100644
--- a/lib/Bytecode/Reader/Reader.cpp
+++ b/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();