[llvm-commits] [dragonegg] r93115 - /dragonegg/trunk/llvm-types.cpp

Duncan Sands baldrick at free.fr
Sun Jan 10 02:21:27 PST 2010


Author: baldrick
Date: Sun Jan 10 04:21:26 2010
New Revision: 93115

URL: http://llvm.org/viewvc/llvm-project?rev=93115&view=rev
Log:
Dump information about the LLVM type as well as the GCC type
when type sizes fail to match.

Modified:
    dragonegg/trunk/llvm-types.cpp

Modified: dragonegg/trunk/llvm-types.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-types.cpp?rev=93115&r1=93114&r2=93115&view=diff

==============================================================================
--- dragonegg/trunk/llvm-types.cpp (original)
+++ dragonegg/trunk/llvm-types.cpp Sun Jan 10 04:21:26 2010
@@ -74,11 +74,16 @@
   // variable size, that the LLVM type is not bigger than any possible value of
   // the GCC type.
 #ifndef NDEBUG
-  if (TYPE_SIZE(Tr) && Ty->isSized() && isInt64(TYPE_SIZE(Tr), true) &&
-      getInt64(TYPE_SIZE(Tr), true) !=
-      getTargetData().getTypeAllocSizeInBits(Ty)) {
+  if (TYPE_SIZE(Tr) && Ty->isSized() && isInt64(TYPE_SIZE(Tr), true)) {
+    uint64_t LLVMSize = getTargetData().getTypeAllocSizeInBits(Ty);
+    if (getInt64(TYPE_SIZE(Tr), true) != LLVMSize) {
+      errs() << "GCC: ";
       debug_tree(Tr);
+      errs() << "LLVM: ";
+      Ty->print(errs());
+      errs() << " (" << LLVMSize << " bits)\n";
       llvm_unreachable("LLVM type size doesn't match GCC type size!");
+    }
   }
 #endif
 





More information about the llvm-commits mailing list