summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPawel Wodnicki <pawel@32bitmicro.com>2012-11-22 00:43:18 +0000
committerPawel Wodnicki <pawel@32bitmicro.com>2012-11-22 00:43:18 +0000
commitddf07067bc7ec9897a17352c2db23fb4d1a55db4 (patch)
treea00e958e9c798c2539641bc3e5fe61624f194086 /lib
parent3e2cbf9d08ffd6f26302c19fdc7997e441c741e9 (diff)
downloadllvm-ddf07067bc7ec9897a17352c2db23fb4d1a55db4.tar.gz
llvm-ddf07067bc7ec9897a17352c2db23fb4d1a55db4.tar.bz2
llvm-ddf07067bc7ec9897a17352c2db23fb4d1a55db4.tar.xz
Merging r168280: into 3.2 release branch.
Don't try to calculate the alignment of an unsigned type. Fixes PR14371! git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_32@168480 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp b/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
index 4ab5b6e4a0..4d106fc188 100644
--- a/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
+++ b/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
@@ -164,7 +164,8 @@ static unsigned getPointeeAlignment(Value *V, const DataLayout &TD) {
return TD.getPreferredAlignment(GV);
if (PointerType *PT = dyn_cast<PointerType>(V->getType()))
- return TD.getABITypeAlignment(PT->getElementType());
+ if (PT->getElementType()->isSized())
+ return TD.getABITypeAlignment(PT->getElementType());
return 0;
}