summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/InlineFunction.cpp
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@apple.com>2015-04-20 16:11:05 +0000
committerAkira Hatanaka <ahatanaka@apple.com>2015-04-20 16:11:05 +0000
commit2cc2b63f533cfbda9753711cdf3414f6c26cbe6a (patch)
treec541a03c10459d9dccc7f9e6b8da6b9912ddc2dc /llvm/lib/Transforms/Utils/InlineFunction.cpp
parenta57cc8bc817f3ff7a48bfd8221562e3cc2a2bc10 (diff)
downloadbcm5719-llvm-2cc2b63f533cfbda9753711cdf3414f6c26cbe6a.tar.gz
bcm5719-llvm-2cc2b63f533cfbda9753711cdf3414f6c26cbe6a.zip
[InlineFunction] Don't add lifetime markers for zero-sized allocas.
This commit fixes the code which adds lifetime markers in InlineFunction to skip zero-sized allocas instead of asserting on them. rdar://problem/20531155 llvm-svn: 235312
Diffstat (limited to 'llvm/lib/Transforms/Utils/InlineFunction.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/InlineFunction.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/InlineFunction.cpp b/llvm/lib/Transforms/Utils/InlineFunction.cpp
index a08ffbeb329..169ebcf5bfc 100644
--- a/llvm/lib/Transforms/Utils/InlineFunction.cpp
+++ b/llvm/lib/Transforms/Utils/InlineFunction.cpp
@@ -1167,7 +1167,11 @@ bool llvm::InlineFunction(CallSite CS, InlineFunctionInfo &IFI,
Type *AllocaType = AI->getAllocatedType();
uint64_t AllocaTypeSize = DL.getTypeAllocSize(AllocaType);
uint64_t AllocaArraySize = AIArraySize->getLimitedValue();
- assert(AllocaArraySize > 0 && "array size of AllocaInst is zero");
+
+ // Don't add markers for zero-sized allocas.
+ if (AllocaArraySize == 0)
+ continue;
+
// Check that array size doesn't saturate uint64_t and doesn't
// overflow when it's multiplied by type size.
if (AllocaArraySize != ~0ULL &&
OpenPOWER on IntegriCloud