Use getPreferredAlignmentLog or getPreferredAlignment
to get the alignment of global variables, rather than
using hand-made versions.
llvm-svn: 46495
diff --git a/llvm/lib/ExecutionEngine/JIT/JIT.cpp b/llvm/lib/ExecutionEngine/JIT/JIT.cpp
index 8b7b972..70ee114 100644
--- a/llvm/lib/ExecutionEngine/JIT/JIT.cpp
+++ b/llvm/lib/ExecutionEngine/JIT/JIT.cpp
@@ -355,7 +355,7 @@
// compilation.
const Type *GlobalType = GV->getType()->getElementType();
size_t S = getTargetData()->getABITypeSize(GlobalType);
- size_t A = getTargetData()->getPrefTypeAlignment(GlobalType);
+ size_t A = getTargetData()->getPreferredAlignment(GV);
if (A <= 8) {
Ptr = malloc(S);
} else {