[llvm-commits] [llvm] r107332 - /llvm/trunk/lib/CodeGen/SjLjEHPrepare.cpp

Jim Grosbach grosbach at apple.com
Wed Jun 30 15:20:38 PDT 2010


Author: grosbach
Date: Wed Jun 30 17:20:38 2010
New Revision: 107332

URL: http://llvm.org/viewvc/llvm-project?rev=107332&view=rev
Log:
Handle array and vector typed parameters in sjljehprepare like we do
structs. rdar://8145832

Modified:
    llvm/trunk/lib/CodeGen/SjLjEHPrepare.cpp

Modified: llvm/trunk/lib/CodeGen/SjLjEHPrepare.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SjLjEHPrepare.cpp?rev=107332&r1=107331&r2=107332&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SjLjEHPrepare.cpp (original)
+++ llvm/trunk/lib/CodeGen/SjLjEHPrepare.cpp Wed Jun 30 17:20:38 2010
@@ -205,15 +205,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