aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2012-11-18 05:39:39 +0000
committerNick Lewycky <nicholas@mxc.ca>2012-11-18 05:39:39 +0000
commit294c965146d8fe4dfda4e3e57e7bd34ab64a6231 (patch)
treeb00932c3fe677d9e1b5d491045dc55343d685947 /lib/Transforms
parent5d6d89544de3ce0b919f540c3ca8ff8226b902c3 (diff)
Don't try to calculate the alignment of an unsigned type. Fixes PR14371!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168280 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-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;
}