[llvm-commits] CVS: llvm/lib/Bytecode/Reader/Reader.cpp

Reid Spencer reid at x10sys.com
Sat Dec 4 14:20:04 PST 2004



Changes in directory llvm/lib/Bytecode/Reader:

Reader.cpp updated: 1.145 -> 1.146
---
Log message:

Provide more information in the error message that occurs when there are
unresolved constants remaining.


---
Diffs of the changes:  (+10 -2)

Index: llvm/lib/Bytecode/Reader/Reader.cpp
diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.145 llvm/lib/Bytecode/Reader/Reader.cpp:1.146
--- llvm/lib/Bytecode/Reader/Reader.cpp:1.145	Fri Dec  3 23:28:27 2004
+++ llvm/lib/Bytecode/Reader/Reader.cpp	Sat Dec  4 16:19:53 2004
@@ -1571,8 +1571,16 @@
 
   // 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();






More information about the llvm-commits mailing list