[llvm-branch-commits] [llvm-branch] r104479 - in /llvm/branches/wendling/eh: include/llvm/ include/llvm/Support/ lib/AsmParser/ lib/Bitcode/Reader/ lib/CodeGen/ lib/Transforms/IPO/ lib/Transforms/InstCombine/ lib/Transforms/Utils/ lib/VMCore/

Bill Wendling isanbard at gmail.com
Sun May 23 19:31:26 PDT 2010


Author: void
Date: Sun May 23 21:31:26 2010
New Revision: 104479

URL: http://llvm.org/viewvc/llvm-project?rev=104479&view=rev
Log:
Add the personality function, catch-all type, and catch-all destination to the
invoke instruction.

Modified:
    llvm/branches/wendling/eh/include/llvm/Instructions.h
    llvm/branches/wendling/eh/include/llvm/Support/IRBuilder.h
    llvm/branches/wendling/eh/lib/AsmParser/LLParser.cpp
    llvm/branches/wendling/eh/lib/Bitcode/Reader/BitcodeReader.cpp
    llvm/branches/wendling/eh/lib/CodeGen/ShadowStackGC.cpp
    llvm/branches/wendling/eh/lib/Transforms/IPO/ArgumentPromotion.cpp
    llvm/branches/wendling/eh/lib/Transforms/IPO/DeadArgumentElimination.cpp
    llvm/branches/wendling/eh/lib/Transforms/IPO/LowerSetJmp.cpp
    llvm/branches/wendling/eh/lib/Transforms/IPO/PartialSpecialization.cpp
    llvm/branches/wendling/eh/lib/Transforms/IPO/StructRetPromotion.cpp
    llvm/branches/wendling/eh/lib/Transforms/InstCombine/InstCombineCalls.cpp
    llvm/branches/wendling/eh/lib/Transforms/Utils/InlineFunction.cpp
    llvm/branches/wendling/eh/lib/VMCore/Core.cpp
    llvm/branches/wendling/eh/lib/VMCore/Instructions.cpp

Modified: llvm/branches/wendling/eh/include/llvm/Instructions.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/wendling/eh/include/llvm/Instructions.h?rev=104479&r1=104478&r2=104479&view=diff
==============================================================================
--- llvm/branches/wendling/eh/include/llvm/Instructions.h (original)
+++ llvm/branches/wendling/eh/include/llvm/Instructions.h Sun May 23 21:31:26 2010
@@ -2364,10 +2364,12 @@
   AttrListPtr AttributeList;
   InvokeInst(const InvokeInst &BI);
   void init(Value *Fn, BasicBlock *IfNormal, BasicBlock *IfException,
+            Value *PersFn, Value *CatchAllTy, BasicBlock *CatchAll,
             Value* const *Args, unsigned NumArgs);
 
   template<typename InputIterator>
   void init(Value *Func, BasicBlock *IfNormal, BasicBlock *IfException,
+            Value *PersFn, Value *CatchAllTy, BasicBlock *CatchAll,
             InputIterator ArgBegin, InputIterator ArgEnd,
             const Twine &NameStr,
             // This argument ensures that we have an iterator we can
@@ -2376,7 +2378,8 @@
     unsigned NumArgs = (unsigned)std::distance(ArgBegin, ArgEnd);
 
     // This requires that the iterator points to contiguous memory.
-    init(Func, IfNormal, IfException, NumArgs ? &*ArgBegin : 0, NumArgs);
+    init(Func, IfNormal, IfException, PersFn, CatchAllTy, CatchAll,
+         NumArgs ? &*ArgBegin : 0, NumArgs);
     setName(NameStr);
   }
 
@@ -2389,6 +2392,7 @@
   /// @brief Construct an InvokeInst from a range of arguments
   template<typename InputIterator>
   inline InvokeInst(Value *Func, BasicBlock *IfNormal, BasicBlock *IfException,
+                    Value *PersFn, Value *CatchAllTy, BasicBlock *CatchAll,
                     InputIterator ArgBegin, InputIterator ArgEnd,
                     unsigned Values,
                     const Twine &NameStr, Instruction *InsertBefore);
@@ -2402,6 +2406,7 @@
   /// @brief Construct an InvokeInst from a range of arguments
   template<typename InputIterator>
   inline InvokeInst(Value *Func, BasicBlock *IfNormal, BasicBlock *IfException,
+                    Value *PersFn, Value *CatchAllTy, BasicBlock *CatchAll,
                     InputIterator ArgBegin, InputIterator ArgEnd,
                     unsigned Values,
                     const Twine &NameStr, BasicBlock *InsertAtEnd);
@@ -2411,23 +2416,29 @@
   template<typename InputIterator>
   static InvokeInst *Create(Value *Func,
                             BasicBlock *IfNormal, BasicBlock *IfException,
-                            Value *PersFn,
+                            Value *PersFn, Value *CatchAllTy,
+                            BasicBlock *CatchAll,
                             InputIterator ArgBegin, InputIterator ArgEnd,
                             const Twine &NameStr = "",
                             Instruction *InsertBefore = 0) {
-    unsigned Values(ArgEnd - ArgBegin + 3);
-    return new(Values) InvokeInst(Func, IfNormal, IfException, ArgBegin, ArgEnd,
+    unsigned Values(ArgEnd - ArgBegin + 6);
+    return new(Values) InvokeInst(Func, IfNormal, IfException, PersFn,
+                                  CatchAllTy, CatchAll,
+                                  ArgBegin, ArgEnd,
                                   Values, NameStr, InsertBefore);
   }
   template<typename InputIterator>
   static InvokeInst *Create(Value *Func,
                             BasicBlock *IfNormal, BasicBlock *IfException,
-                            Value *PersFn,
+                            Value *PersFn, Value *CatchAllTy,
+                            BasicBlock *CatchAll,
                             InputIterator ArgBegin, InputIterator ArgEnd,
                             const Twine &NameStr,
                             BasicBlock *InsertAtEnd) {
-    unsigned Values(ArgEnd - ArgBegin + 3);
-    return new(Values) InvokeInst(Func, IfNormal, IfException, ArgBegin, ArgEnd,
+    unsigned Values(ArgEnd - ArgBegin + 6);
+    return new(Values) InvokeInst(Func, IfNormal, IfException, PersFn,
+                                  CatchAllTy, CatchAll,
+                                  ArgBegin, ArgEnd,
                                   Values, NameStr, InsertAtEnd);
   }
 
@@ -2524,40 +2535,53 @@
   /// indirect function invocation.
   ///
   Function *getCalledFunction() const {
-    return dyn_cast<Function>(Op<-3>());
+    return dyn_cast<Function>(Op<-6>());
   }
 
   /// getCalledValue - Get a pointer to the function that is invoked by this
   /// instruction
-  const Value *getCalledValue() const { return Op<-3>(); }
-        Value *getCalledValue()       { return Op<-3>(); }
+  const Value *getCalledValue() const { return Op<-6>(); }
+        Value *getCalledValue()       { return Op<-6>(); }
 
   /// setCalledFunction - Set the function called.
   void setCalledFunction(Value* Fn) {
-    Op<-3>() = Fn;
+    Op<-6>() = Fn;
   }
 
-  // get*Dest - Return the destination basic blocks...
+  // Getter/Setters for EH information from the invoke statement.
   BasicBlock *getNormalDest() const {
-    return cast<BasicBlock>(Op<-2>());
-  }
-  BasicBlock *getUnwindDest() const {
-    return cast<BasicBlock>(Op<-1>());
+    return cast<BasicBlock>(Op<-5>());
   }
   void setNormalDest(BasicBlock *B) {
-    Op<-2>() = reinterpret_cast<Value*>(B);
+    Op<-5>() = reinterpret_cast<Value*>(B);
+  }
+  BasicBlock *getUnwindDest() const {
+    return cast<BasicBlock>(Op<-4>());
   }
   void setUnwindDest(BasicBlock *B) {
-    Op<-1>() = reinterpret_cast<Value*>(B);
+    Op<-4>() = reinterpret_cast<Value*>(B);
   }
 
   Value *getPersonalityFn() const {
-    return 0; // EH-FIXME: Implement.
+    return Op<-3>();
   }
-  void setPersonalityFn(Value *P) {
-    P = P; // EH-FIXME: Implement.
+  void setPersonalityFn(Value *V) {
+    Op<-3>() = V;
+  }
+  Value *getCatchAllType() const {
+    return Op<-2>();
+  }
+  void setCatchAllType(Value *V) {
+    Op<-2>() = V;
+  }
+  BasicBlock *getCatchAllDest() const {
+    return cast<BasicBlock>(Op<-1>());
+  }
+  void setCatchAllDest(BasicBlock *B) {
+    Op<-1>() = reinterpret_cast<Value*>(B);
   }
 
+  // Successor accessors.
   BasicBlock *getSuccessor(unsigned i) const {
     assert(i < 2 && "Successor # out of range for invoke!");
     return i == 0 ? getNormalDest() : getUnwindDest();
@@ -2565,7 +2589,7 @@
 
   void setSuccessor(unsigned idx, BasicBlock *NewSucc) {
     assert(idx < 2 && "Successor # out of range for invoke!");
-    *(&Op<-2>() + idx) = reinterpret_cast<Value*>(NewSucc);
+    *(&Op<-5>() + idx) = reinterpret_cast<Value*>(NewSucc);
   }
 
   unsigned getNumSuccessors() const { return 2; }
@@ -2598,6 +2622,7 @@
 template<typename InputIterator>
 InvokeInst::InvokeInst(Value *Func,
                        BasicBlock *IfNormal, BasicBlock *IfException,
+                       Value *PersFn, Value *CatchAllTy, BasicBlock *CatchAll,
                        InputIterator ArgBegin, InputIterator ArgEnd,
                        unsigned Values,
                        const Twine &NameStr, Instruction *InsertBefore)
@@ -2606,12 +2631,14 @@
                    Instruction::Invoke,
                    OperandTraits<InvokeInst>::op_end(this) - Values,
                    Values, InsertBefore) {
-  init(Func, IfNormal, IfException, ArgBegin, ArgEnd, NameStr,
+  init(Func, IfNormal, IfException, PersFn, CatchAllTy, CatchAll,
+       ArgBegin, ArgEnd, NameStr,
        typename std::iterator_traits<InputIterator>::iterator_category());
 }
 template<typename InputIterator>
 InvokeInst::InvokeInst(Value *Func,
                        BasicBlock *IfNormal, BasicBlock *IfException,
+                       Value *PersFn, Value *CatchAllTy, BasicBlock *CatchAll,
                        InputIterator ArgBegin, InputIterator ArgEnd,
                        unsigned Values,
                        const Twine &NameStr, BasicBlock *InsertAtEnd)
@@ -2620,7 +2647,8 @@
                    Instruction::Invoke,
                    OperandTraits<InvokeInst>::op_end(this) - Values,
                    Values, InsertAtEnd) {
-  init(Func, IfNormal, IfException, ArgBegin, ArgEnd, NameStr,
+  init(Func, IfNormal, IfException, PersFn, CatchAllTy, CatchAll,
+       ArgBegin, ArgEnd, NameStr,
        typename std::iterator_traits<InputIterator>::iterator_category());
 }
 

Modified: llvm/branches/wendling/eh/include/llvm/Support/IRBuilder.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/wendling/eh/include/llvm/Support/IRBuilder.h?rev=104479&r1=104478&r2=104479&view=diff
==============================================================================
--- llvm/branches/wendling/eh/include/llvm/Support/IRBuilder.h (original)
+++ llvm/branches/wendling/eh/include/llvm/Support/IRBuilder.h Sun May 23 21:31:26 2010
@@ -278,35 +278,42 @@
 
   InvokeInst *CreateInvoke(Value *Callee, BasicBlock *NormalDest,
                            BasicBlock *UnwindDest, Value *PersonalityFn,
+                           Value *CatchAllTy, BasicBlock *CatchAll,
                            const Twine &Name = "") {
     Value *Args[] = { 0 };
     return Insert(InvokeInst::Create(Callee, NormalDest, UnwindDest,
-                                     PersonalityFn, Args, Args), Name);
+                                     PersonalityFn, CatchAllTy, CatchAll,
+                                     Args, Args), Name);
   }
   InvokeInst *CreateInvoke(Value *Callee, BasicBlock *NormalDest,
                            BasicBlock *UnwindDest, Value *PersonalityFn,
-                           Value *Arg1,
-                           const Twine &Name = "") {
+                           Value *CatchAllTy, BasicBlock *CatchAll,
+                           Value *Arg1, const Twine &Name = "") {
     Value *Args[] = { Arg1 };
     return Insert(InvokeInst::Create(Callee, NormalDest, UnwindDest,
-                                     PersonalityFn, Args, Args+1), Name);
+                                     PersonalityFn, CatchAllTy, CatchAll,
+                                     Args, Args+1), Name);
   }
   InvokeInst *CreateInvoke3(Value *Callee, BasicBlock *NormalDest,
                             BasicBlock *UnwindDest, Value *PersonalityFn,
+                            Value *CatchAllTy, BasicBlock *CatchAll,
                             Value *Arg1, Value *Arg2, Value *Arg3,
                             const Twine &Name = "") {
     Value *Args[] = { Arg1, Arg2, Arg3 };
     return Insert(InvokeInst::Create(Callee, NormalDest, UnwindDest,
-                                     PersonalityFn, Args, Args+3), Name);
+                                     PersonalityFn, CatchAllTy, CatchAll,
+                                     Args, Args+3), Name);
   }
   /// CreateInvoke - Create an invoke instruction.
   template<typename InputIterator>
   InvokeInst *CreateInvoke(Value *Callee, BasicBlock *NormalDest,
                            BasicBlock *UnwindDest, Value *PersonalityFn,
+                            Value *CatchAllTy, BasicBlock *CatchAll,
                            InputIterator ArgBegin, InputIterator ArgEnd,
                            const Twine &Name = "") {
     return Insert(InvokeInst::Create(Callee, NormalDest, UnwindDest,
-                                     PersonalityFn, ArgBegin, ArgEnd), Name);
+                                     PersonalityFn, CatchAllTy, CatchAll,
+                                     ArgBegin, ArgEnd), Name);
   }
 
   UnwindInst *CreateUnwind() {

Modified: llvm/branches/wendling/eh/lib/AsmParser/LLParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/wendling/eh/lib/AsmParser/LLParser.cpp?rev=104479&r1=104478&r2=104479&view=diff
==============================================================================
--- llvm/branches/wendling/eh/lib/AsmParser/LLParser.cpp (original)
+++ llvm/branches/wendling/eh/lib/AsmParser/LLParser.cpp Sun May 23 21:31:26 2010
@@ -3487,6 +3487,7 @@
   AttrListPtr PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
 
   InvokeInst *II = InvokeInst::Create(Callee, NormalBB, UnwindBB, PersFn,
+                                      CatchAllVal, CatchAllBB,
                                       Args.begin(), Args.end());
   II->setCallingConv(CC);
   II->setAttributes(PAL);

Modified: llvm/branches/wendling/eh/lib/Bitcode/Reader/BitcodeReader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/wendling/eh/lib/Bitcode/Reader/BitcodeReader.cpp?rev=104479&r1=104478&r2=104479&view=diff
==============================================================================
--- llvm/branches/wendling/eh/lib/Bitcode/Reader/BitcodeReader.cpp (original)
+++ llvm/branches/wendling/eh/lib/Bitcode/Reader/BitcodeReader.cpp Sun May 23 21:31:26 2010
@@ -2114,7 +2114,7 @@
       }
 
       I = InvokeInst::Create(Callee, NormalBB, UnwindBB,
-                             0, // EH-FIXME!
+                             0, 0, 0, // EH-FIXME!
                              Ops.begin(), Ops.end());
       InstructionList.push_back(I);
       cast<InvokeInst>(I)->setCallingConv(

Modified: llvm/branches/wendling/eh/lib/CodeGen/ShadowStackGC.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/wendling/eh/lib/CodeGen/ShadowStackGC.cpp?rev=104479&r1=104478&r2=104479&view=diff
==============================================================================
--- llvm/branches/wendling/eh/lib/CodeGen/ShadowStackGC.cpp (original)
+++ llvm/branches/wendling/eh/lib/CodeGen/ShadowStackGC.cpp Sun May 23 21:31:26 2010
@@ -162,7 +162,7 @@
 
           InvokeInst *II = InvokeInst::Create(CI->getCalledValue(),
                                               NewBB, CleanupBB,
-                                              0, // EH-FIXME!
+                                              0, 0, 0, // EH-FIXME!
                                               Args.begin(), Args.end(),
                                               CI->getName(), CallBB);
           II->setCallingConv(CI->getCallingConv());

Modified: llvm/branches/wendling/eh/lib/Transforms/IPO/ArgumentPromotion.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/wendling/eh/lib/Transforms/IPO/ArgumentPromotion.cpp?rev=104479&r1=104478&r2=104479&view=diff
==============================================================================
--- llvm/branches/wendling/eh/lib/Transforms/IPO/ArgumentPromotion.cpp (original)
+++ llvm/branches/wendling/eh/lib/Transforms/IPO/ArgumentPromotion.cpp Sun May 23 21:31:26 2010
@@ -714,7 +714,8 @@
     Instruction *New;
     if (InvokeInst *II = dyn_cast<InvokeInst>(Call)) {
       New = InvokeInst::Create(NF, II->getNormalDest(), II->getUnwindDest(),
-                               II->getPersonalityFn(),
+                               II->getPersonalityFn(), II->getCatchAllType(),
+                               II->getCatchAllDest(),
                                Args.begin(), Args.end(), "", Call);
       cast<InvokeInst>(New)->setCallingConv(CS.getCallingConv());
       cast<InvokeInst>(New)->setAttributes(AttrListPtr::get(AttributesVec.begin(),

Modified: llvm/branches/wendling/eh/lib/Transforms/IPO/DeadArgumentElimination.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/wendling/eh/lib/Transforms/IPO/DeadArgumentElimination.cpp?rev=104479&r1=104478&r2=104479&view=diff
==============================================================================
--- llvm/branches/wendling/eh/lib/Transforms/IPO/DeadArgumentElimination.cpp (original)
+++ llvm/branches/wendling/eh/lib/Transforms/IPO/DeadArgumentElimination.cpp Sun May 23 21:31:26 2010
@@ -233,7 +233,8 @@
     Instruction *New;
     if (InvokeInst *II = dyn_cast<InvokeInst>(Call)) {
       New = InvokeInst::Create(NF, II->getNormalDest(), II->getUnwindDest(),
-                               II->getPersonalityFn(),
+                               II->getPersonalityFn(), II->getCatchAllType(),
+                               II->getCatchAllDest(),
                                Args.begin(), Args.end(), "", Call);
       cast<InvokeInst>(New)->setCallingConv(CS.getCallingConv());
       cast<InvokeInst>(New)->setAttributes(PAL);
@@ -764,7 +765,8 @@
     Instruction *New;
     if (InvokeInst *II = dyn_cast<InvokeInst>(Call)) {
       New = InvokeInst::Create(NF, II->getNormalDest(), II->getUnwindDest(),
-                               II->getPersonalityFn(),
+                               II->getPersonalityFn(), II->getCatchAllType(),
+                               II->getCatchAllDest(),
                                Args.begin(), Args.end(), "", Call);
       cast<InvokeInst>(New)->setCallingConv(CS.getCallingConv());
       cast<InvokeInst>(New)->setAttributes(NewCallPAL);

Modified: llvm/branches/wendling/eh/lib/Transforms/IPO/LowerSetJmp.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/wendling/eh/lib/Transforms/IPO/LowerSetJmp.cpp?rev=104479&r1=104478&r2=104479&view=diff
==============================================================================
--- llvm/branches/wendling/eh/lib/Transforms/IPO/LowerSetJmp.cpp (original)
+++ llvm/branches/wendling/eh/lib/Transforms/IPO/LowerSetJmp.cpp Sun May 23 21:31:26 2010
@@ -476,7 +476,7 @@
   std::vector<Value*> Params(CI.op_begin() + 1, CI.op_end());
   InvokeInst* II =
     InvokeInst::Create(CI.getCalledValue(), NewBB, PrelimBBMap[Func],
-                       0, // EH-FIXME!
+                       0, 0, 0, // EH-FIXME!
                        Params.begin(), Params.end(), CI.getName(), Term);
   II->setCallingConv(CI.getCallingConv());
   II->setAttributes(CI.getAttributes());

Modified: llvm/branches/wendling/eh/lib/Transforms/IPO/PartialSpecialization.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/wendling/eh/lib/Transforms/IPO/PartialSpecialization.cpp?rev=104479&r1=104478&r2=104479&view=diff
==============================================================================
--- llvm/branches/wendling/eh/lib/Transforms/IPO/PartialSpecialization.cpp (original)
+++ llvm/branches/wendling/eh/lib/Transforms/IPO/PartialSpecialization.cpp Sun May 23 21:31:26 2010
@@ -94,6 +94,8 @@
           NCall = InvokeInst::Create(NF, II->getNormalDest(),
                                      II->getUnwindDest(),
                                      II->getPersonalityFn(),
+                                     II->getCatchAllType(),
+                                     II->getCatchAllDest(),
                                      args.begin(), args.end(), 
                                      II->getName(), II);
           cast<InvokeInst>(NCall)->setCallingConv(II->getCallingConv());

Modified: llvm/branches/wendling/eh/lib/Transforms/IPO/StructRetPromotion.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/wendling/eh/lib/Transforms/IPO/StructRetPromotion.cpp?rev=104479&r1=104478&r2=104479&view=diff
==============================================================================
--- llvm/branches/wendling/eh/lib/Transforms/IPO/StructRetPromotion.cpp (original)
+++ llvm/branches/wendling/eh/lib/Transforms/IPO/StructRetPromotion.cpp Sun May 23 21:31:26 2010
@@ -304,7 +304,8 @@
     Instruction *New;
     if (InvokeInst *II = dyn_cast<InvokeInst>(Call)) {
       New = InvokeInst::Create(NF, II->getNormalDest(), II->getUnwindDest(),
-                               II->getPersonalityFn(),
+                               II->getPersonalityFn(), II->getCatchAllType(),
+                               II->getCatchAllDest(),
                                Args.begin(), Args.end(), "", Call);
       cast<InvokeInst>(New)->setCallingConv(CS.getCallingConv());
       cast<InvokeInst>(New)->setAttributes(NewPAL);

Modified: llvm/branches/wendling/eh/lib/Transforms/InstCombine/InstCombineCalls.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/wendling/eh/lib/Transforms/InstCombine/InstCombineCalls.cpp?rev=104479&r1=104478&r2=104479&view=diff
==============================================================================
--- llvm/branches/wendling/eh/lib/Transforms/InstCombine/InstCombineCalls.cpp (original)
+++ llvm/branches/wendling/eh/lib/Transforms/InstCombine/InstCombineCalls.cpp Sun May 23 21:31:26 2010
@@ -1078,7 +1078,8 @@
   Instruction *NC;
   if (InvokeInst *II = dyn_cast<InvokeInst>(Caller)) {
     NC = InvokeInst::Create(Callee, II->getNormalDest(), II->getUnwindDest(),
-                            II->getPersonalityFn(),
+                            II->getPersonalityFn(), II->getCatchAllType(),
+                            II->getCatchAllDest(),
                             Args.begin(), Args.end(),
                             Caller->getName(), Caller);
     cast<InvokeInst>(NC)->setCallingConv(II->getCallingConv());
@@ -1251,6 +1252,8 @@
         NewCaller = InvokeInst::Create(NewCallee,
                                        II->getNormalDest(), II->getUnwindDest(),
                                        II->getPersonalityFn(),
+                                       II->getCatchAllType(),
+                                       II->getCatchAllDest(),
                                        NewArgs.begin(), NewArgs.end(),
                                        Caller->getName(), Caller);
         cast<InvokeInst>(NewCaller)->setCallingConv(II->getCallingConv());

Modified: llvm/branches/wendling/eh/lib/Transforms/Utils/InlineFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/wendling/eh/lib/Transforms/Utils/InlineFunction.cpp?rev=104479&r1=104478&r2=104479&view=diff
==============================================================================
--- llvm/branches/wendling/eh/lib/Transforms/Utils/InlineFunction.cpp (original)
+++ llvm/branches/wendling/eh/lib/Transforms/Utils/InlineFunction.cpp Sun May 23 21:31:26 2010
@@ -66,7 +66,7 @@
     SmallVector<Value*, 8> InvokeArgs(CI->op_begin()+1, CI->op_end());
     InvokeInst *II =
       InvokeInst::Create(CI->getCalledValue(), Split, InvokeDest,
-                         0, // EH-FIXME!
+                         0, 0, 0, // EH-FIXME!
                          InvokeArgs.begin(), InvokeArgs.end(),
                          CI->getName(), BB->getTerminator());
     II->setCallingConv(CI->getCallingConv());

Modified: llvm/branches/wendling/eh/lib/VMCore/Core.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/wendling/eh/lib/VMCore/Core.cpp?rev=104479&r1=104478&r2=104479&view=diff
==============================================================================
--- llvm/branches/wendling/eh/lib/VMCore/Core.cpp (original)
+++ llvm/branches/wendling/eh/lib/VMCore/Core.cpp Sun May 23 21:31:26 2010
@@ -1725,9 +1725,11 @@
 LLVMValueRef LLVMBuildInvoke(LLVMBuilderRef B, LLVMValueRef Fn,
                              LLVMValueRef *Args, unsigned NumArgs,
                              LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch,
-                             LLVMValueRef PersFn, const char *Name) {
+                             LLVMValueRef PersFn, LLVMValueRef CatchAllTy,
+                             LLVMBasicBlockRef CatchAll, const char *Name) {
   return wrap(unwrap(B)->CreateInvoke(unwrap(Fn), unwrap(Then), unwrap(Catch),
-                                      unwrap(PersFn), unwrap(Args),
+                                      unwrap(PersFn), unwrap(CatchAllTy),
+                                      unwrap(CatchAll), unwrap(Args),
                                       unwrap(Args) + NumArgs, Name));
 }
 

Modified: llvm/branches/wendling/eh/lib/VMCore/Instructions.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/wendling/eh/lib/VMCore/Instructions.cpp?rev=104479&r1=104478&r2=104479&view=diff
==============================================================================
--- llvm/branches/wendling/eh/lib/VMCore/Instructions.cpp (original)
+++ llvm/branches/wendling/eh/lib/VMCore/Instructions.cpp Sun May 23 21:31:26 2010
@@ -34,7 +34,7 @@
   Instruction *II(getInstruction());
   return isCall()
     ? cast<CallInst>(II)->op_begin()
-    : cast<InvokeInst>(II)->op_end() - 3; // Skip BB, BB, Function
+    : cast<InvokeInst>(II)->op_end() - 4; // Skip PersFn, BB, BB, Function
 }
 
 //===----------------------------------------------------------------------===//
@@ -545,11 +545,15 @@
 //===----------------------------------------------------------------------===//
 
 void InvokeInst::init(Value *Fn, BasicBlock *IfNormal, BasicBlock *IfException,
+                      Value *PersFn, Value *CatchAllTy, BasicBlock *CatchAll,
                       Value* const *Args, unsigned NumArgs) {
   assert(NumOperands == 3+NumArgs && "NumOperands not set up?");
-  Op<-3>() = Fn;
-  Op<-2>() = IfNormal;
-  Op<-1>() = IfException;
+  Op<-6>() = Fn;
+  Op<-5>() = IfNormal;
+  Op<-4>() = IfException;
+  Op<-3>() = PersFn;
+  Op<-2>() = CatchAllTy;
+  Op<-1>() = CatchAll;
   const FunctionType *FTy =
     cast<FunctionType>(cast<PointerType>(Fn->getType())->getElementType());
   FTy = FTy;  // silence warning.





More information about the llvm-branch-commits mailing list