aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/TargetData.cpp
diff options
context:
space:
mode:
authorCameron Zwarich <zwarich@apple.com>2011-04-13 20:36:04 +0000
committerCameron Zwarich <zwarich@apple.com>2011-04-13 20:36:04 +0000
commit1335022e1983d81bd680a082046544af22496054 (patch)
tree65ceeebaa0479357e8040d0e87f013bd8460288d /lib/Target/TargetData.cpp
parentbe7cd7580dc704e3058b874d7573305bd7def9ea (diff)
Fix a regression caused by r102515 where explicit alignment on globals is
ignored. There was a test to catch this, but it was just blindly updated in a large change. This fixes another part of <rdar://problem/9275290>. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129466 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/TargetData.cpp')
-rw-r--r--lib/Target/TargetData.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Target/TargetData.cpp b/lib/Target/TargetData.cpp
index da956d5fed..1990bc7b92 100644
--- a/lib/Target/TargetData.cpp
+++ b/lib/Target/TargetData.cpp
@@ -624,7 +624,7 @@ unsigned TargetData::getPreferredAlignment(const GlobalVariable *GV) const {
Alignment = std::max(GVAlignment, getABITypeAlignment(ElemType));
}
- if (GV->hasInitializer()) {
+ if (GV->hasInitializer() && GVAlignment == 0) {
if (Alignment < 16) {
// If the global is not external, see if it is large. If so, give it a
// larger alignment.