summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2010-04-01 20:13:28 +0000
committerEvan Cheng <evan.cheng@apple.com>2010-04-01 20:13:28 +0000
commit8563ee4ed429c8a2cd356f4b338e28f566a64756 (patch)
tree8d2ea516779b06fc8d7d8ab093ac9db43f5f7d06
parentd9929f03cfd80f2d0d2fec9b7c41a4f6f15ac755 (diff)
downloadbcm5719-llvm-8563ee4ed429c8a2cd356f4b338e28f566a64756.tar.gz
bcm5719-llvm-8563ee4ed429c8a2cd356f4b338e28f566a64756.zip
Skip checking preferred alignment of GVs defined in other translation units all together.
llvm-svn: 100133
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 4fcfeecb49a..0ba65ab7f96 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -6152,7 +6152,7 @@ unsigned SelectionDAG::InferPtrAlignment(SDValue Ptr) const {
unsigned Align = GV->getAlignment();
if (!Align) {
if (GlobalVariable *GVar = dyn_cast<GlobalVariable>(GV)) {
- if (GV->getType()->getElementType()->isSized()) {
+ if (GVar->hasInitializer()) {
const TargetData *TD = TLI.getTargetData();
Align = TD->getPreferredAlignment(GVar);
}
OpenPOWER on IntegriCloud