[llvm-commits] [llvm-gcc-4.2] r93116 - /llvm-gcc-4.2/trunk/gcc/llvm-types.cpp

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


Author: baldrick
Date: Sun Jan 10 04:21:48 2010
New Revision: 93116

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

Modified:
    llvm-gcc-4.2/trunk/gcc/llvm-types.cpp

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

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-types.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Sun Jan 10 04:21:48 2010
@@ -77,12 +77,17 @@
   // For x86 long double, llvm records the size of the data (80) while
   // gcc's TYPE_SIZE including alignment padding.  getTypeAllocSizeInBits
   // is used to compensate for this.
-  if (TYPE_SIZE(Tr) && Ty->isSized() && isInt64(TYPE_SIZE(Tr), true) &&
-      getInt64(TYPE_SIZE(Tr), true) !=
-      getTargetData().getTypeAllocSizeInBits(Ty)) {
-    errs() << "LLVM type size doesn't match GCC type size!\n";
-    debug_tree(Tr);
-    abort();
+  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";
+      errs() << "LLVM type size doesn't match GCC type size!";
+      abort();
+    }
   }
 #endif
 





More information about the llvm-commits mailing list