summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit9398197ef1c0db9796cf602f5b2ae8dbde3c86c3 (patch)
tree96c0eed6084f6f355ff24a223f4ba3e14b739b61 /llvm/lib/Target/TargetData.cpp
parente72509c10cf67975ddd290034a84ef97ec6f0b8d (diff)
downloadbcm5719-llvm-9398197ef1c0db9796cf602f5b2ae8dbde3c86c3.tar.gz
bcm5719-llvm-9398197ef1c0db9796cf602f5b2ae8dbde3c86c3.zip
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>. llvm-svn: 129466
Diffstat (limited to 'llvm/lib/Target/TargetData.cpp')
-rw-r--r--llvm/lib/Target/TargetData.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Target/TargetData.cpp b/llvm/lib/Target/TargetData.cpp
index da956d5fed9..1990bc7b929 100644
--- a/llvm/lib/Target/TargetData.cpp
+++ b/llvm/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.
OpenPOWER on IntegriCloud