aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/SjLjEHPrepare.cpp
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2010-06-30 22:20:38 +0000
committerJim Grosbach <grosbach@apple.com>2010-06-30 22:20:38 +0000
commit6c1547368f10302df81ea55ede12db645284f872 (patch)
tree8774583e81c32f11de5ff6b3a131fcb1f83c1202 /lib/CodeGen/SjLjEHPrepare.cpp
parentcfb60212c3ba818e1b8c8ad7d72fd330d8e904e0 (diff)
downloadexternal_llvm-6c1547368f10302df81ea55ede12db645284f872.zip
external_llvm-6c1547368f10302df81ea55ede12db645284f872.tar.gz
external_llvm-6c1547368f10302df81ea55ede12db645284f872.tar.bz2
Handle array and vector typed parameters in sjljehprepare like we do
structs. rdar://8145832 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107332 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SjLjEHPrepare.cpp')
-rw-r--r--lib/CodeGen/SjLjEHPrepare.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/CodeGen/SjLjEHPrepare.cpp b/lib/CodeGen/SjLjEHPrepare.cpp
index f76eaf1..e90869d 100644
--- a/lib/CodeGen/SjLjEHPrepare.cpp
+++ b/lib/CodeGen/SjLjEHPrepare.cpp
@@ -205,15 +205,15 @@ splitLiveRangesAcrossInvokes(SmallVector<InvokeInst*,16> &Invokes) {
for (Function::arg_iterator AI = F->arg_begin(), E = F->arg_end();
AI != E; ++AI) {
const Type *Ty = AI->getType();
- // StructType can't be cast, but is a legal argument type, so we have
+ // Aggregate types can't be cast, but are legal argument types, so we have
// to handle them differently. We use an extract/insert pair as a
// lightweight method to achieve the same goal.
- if (isa<StructType>(Ty)) {
- Instruction *EI = ExtractValueInst::Create(AI, 0, "", AfterAllocaInsertPt);
+ if (isa<StructType>(Ty) || isa<ArrayType>(Ty) || isa<VectorType>(Ty)) {
+ Instruction *EI = ExtractValueInst::Create(AI, 0, "",AfterAllocaInsertPt);
Instruction *NI = InsertValueInst::Create(AI, EI, 0);
NI->insertAfter(EI);
AI->replaceAllUsesWith(NI);
- // Set the struct operand of the instructions back to the AllocaInst.
+ // Set the operand of the instructions back to the AllocaInst.
EI->setOperand(0, AI);
NI->setOperand(0, AI);
} else {