[llvm-commits] [llvm] r107335 - /llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp
Jim Grosbach
grosbach at apple.com
Wed Jun 30 15:22:59 PDT 2010
Author: grosbach
Date: Wed Jun 30 17:22:59 2010
New Revision: 107335
URL: http://llvm.org/viewvc/llvm-project?rev=107335&view=rev
Log:
lowerinvoke needs to handle aggregate function args like sjlj eh does.
Modified:
llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp
Modified: llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp?rev=107335&r1=107334&r2=107335&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/LowerInvoke.cpp Wed Jun 30 17:22:59 2010
@@ -310,15 +310,15 @@
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 {
More information about the llvm-commits
mailing list