Use getPreferredAlignmentLog or getPreferredAlignment
to get the alignment of global variables, rather than
using hand-made versions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46495 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/ExecutionEngine/JIT/JIT.cpp b/lib/ExecutionEngine/JIT/JIT.cpp
index 8b7b972..70ee114 100644
--- a/lib/ExecutionEngine/JIT/JIT.cpp
+++ b/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 {