[llvm-commits] [dragonegg] r164941 - in /dragonegg/trunk/src: Backend.cpp Convert.cpp
Duncan Sands
baldrick at free.fr
Mon Oct 1 05:32:18 PDT 2012
Author: baldrick
Date: Mon Oct 1 07:32:18 2012
New Revision: 164941
URL: http://llvm.org/viewvc/llvm-project?rev=164941&view=rev
Log:
Sanity check the alignment provided by GCC.
Modified:
dragonegg/trunk/src/Backend.cpp
dragonegg/trunk/src/Convert.cpp
Modified: dragonegg/trunk/src/Backend.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Backend.cpp?rev=164941&r1=164940&r2=164941&view=diff
==============================================================================
--- dragonegg/trunk/src/Backend.cpp (original)
+++ dragonegg/trunk/src/Backend.cpp Mon Oct 1 07:32:18 2012
@@ -1119,6 +1119,7 @@
}
GV->setAlignment(DECL_ALIGN(decl) / 8);
+ assert(GV->getAlignment() != 0 && "Global variable has unknown alignment!");
#ifdef TARGET_ADJUST_CSTRING_ALIGN
if (DECL_INITIAL(decl) != error_mark_node && // uninitialized?
DECL_INITIAL(decl) && isa<STRING_CST>(DECL_INITIAL(decl)))
Modified: dragonegg/trunk/src/Convert.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Convert.cpp?rev=164941&r1=164940&r2=164941&view=diff
==============================================================================
--- dragonegg/trunk/src/Convert.cpp (original)
+++ dragonegg/trunk/src/Convert.cpp Mon Oct 1 07:32:18 2012
@@ -2365,6 +2365,7 @@
}
unsigned Alignment = DECL_ALIGN(decl) / 8; // Alignment in octets.
+ assert(Alignment != 0 && "Local variable with unknown alignment!");
// If this is the alignment we would have given the variable anyway then don't
// use an explicit alignment, making the IR look more portable.
More information about the llvm-commits
mailing list