From e963a3814f3f8fde394da263340bc0888011291c Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Thu, 28 Jul 2011 23:42:57 +0000 Subject: Add the AddLandingPadInfo function. AddLandingPadInfo takes a landingpad instruction and grabs all of the information from it that it needs for EH table generation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136429 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp | 34 +++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp') diff --git a/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp b/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp index d5bf120..1f41f043 100644 --- a/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp +++ b/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp @@ -454,3 +454,37 @@ void llvm::CopyCatchInfo(const BasicBlock *SuccBB, const BasicBlock *LPad, break; } } + +//--------- NEW EH - Begin --------- + +/// AddLandingPadInfo - Extract the exception handling information from the +/// landingpad instruction and add them to the specified machine module info. +void llvm::AddLandingPadInfo(const LandingPadInst &I, MachineModuleInfo &MMI, + MachineBasicBlock *MBB) { + MMI.addPersonality(MBB, I.getPersonalityFn()); + + if (I.isCleanup()) + MMI.addCleanup(MBB); + + for (unsigned i = 0, e = I.getNumClauses(); i != e; ) { + switch (I.getClauseType(i)) { + case LandingPadInst::Catch: + MMI.addCatchTypeInfo(MBB, dyn_cast(I.getClauseValue(i))); + ++i; + break; + case LandingPadInst::Filter: { + // Add filters in a list. + SmallVector FilterList; + do { + FilterList.push_back(cast(I.getClauseValue(i))); + ++i; + } while (i != e && I.getClauseType(i) == LandingPadInst::Filter); + + MMI.addFilterTypeInfo(MBB, FilterList); + break; + } + } + } +} + +//--------- NEW EH - End --------- -- cgit v1.1 From 10c6d12a9fd4dab411091f64db4db69670b88850 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Sat, 30 Jul 2011 05:42:50 +0000 Subject: Revert r136253, r136263, r136269, r136313, r136325, r136326, r136329, r136338, r136339, r136341, r136369, r136387, r136392, r136396, r136429, r136430, r136444, r136445, r136446, r136253 pending review. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136556 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp | 34 ----------------------- 1 file changed, 34 deletions(-) (limited to 'lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp') diff --git a/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp b/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp index 1f41f043..d5bf120 100644 --- a/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp +++ b/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp @@ -454,37 +454,3 @@ void llvm::CopyCatchInfo(const BasicBlock *SuccBB, const BasicBlock *LPad, break; } } - -//--------- NEW EH - Begin --------- - -/// AddLandingPadInfo - Extract the exception handling information from the -/// landingpad instruction and add them to the specified machine module info. -void llvm::AddLandingPadInfo(const LandingPadInst &I, MachineModuleInfo &MMI, - MachineBasicBlock *MBB) { - MMI.addPersonality(MBB, I.getPersonalityFn()); - - if (I.isCleanup()) - MMI.addCleanup(MBB); - - for (unsigned i = 0, e = I.getNumClauses(); i != e; ) { - switch (I.getClauseType(i)) { - case LandingPadInst::Catch: - MMI.addCatchTypeInfo(MBB, dyn_cast(I.getClauseValue(i))); - ++i; - break; - case LandingPadInst::Filter: { - // Add filters in a list. - SmallVector FilterList; - do { - FilterList.push_back(cast(I.getClauseValue(i))); - ++i; - } while (i != e && I.getClauseType(i) == LandingPadInst::Filter); - - MMI.addFilterTypeInfo(MBB, FilterList); - break; - } - } - } -} - -//--------- NEW EH - End --------- -- cgit v1.1 From 2ac0e6be05d53323d305155fcf53d50c87d6a9b2 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Wed, 17 Aug 2011 21:56:44 +0000 Subject: Add the support in code-gen for the landingpad instruction lowering. The landingpad instruction is lowered into the EXCEPTIONADDR and EHSELECTION SDNodes. The information from the landingpad instruction is harvested by the 'AddLandingPadInfo' function. The new EH uses the current EH scheme in the back-end. This will change once we switch over to the new scheme. (Reviewed by Jakob!) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137880 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp | 31 +++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp') diff --git a/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp b/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp index d5bf120..10b251d 100644 --- a/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp +++ b/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp @@ -454,3 +454,34 @@ void llvm::CopyCatchInfo(const BasicBlock *SuccBB, const BasicBlock *LPad, break; } } + +/// AddLandingPadInfo - Extract the exception handling information from the +/// landingpad instruction and add them to the specified machine module info. +void llvm::AddLandingPadInfo(const LandingPadInst &I, MachineModuleInfo &MMI, + MachineBasicBlock *MBB) { + MMI.addPersonality(MBB, + cast(I.getPersonalityFn()->stripPointerCasts())); + + if (I.isCleanup()) + MMI.addCleanup(MBB); + + // FIXME: New EH - Add the clauses in reverse order. This isn't 100% correct, + // but we need to do it this way because of how the DWARF EH emitter + // processes the clauses. + for (unsigned i = I.getNumClauses(); i != 0; --i) { + Value *Val = I.getClause(i - 1); + if (I.isCatch(i - 1)) { + MMI.addCatchTypeInfo(MBB, + dyn_cast(Val->stripPointerCasts())); + } else { + // Add filters in a list. + Constant *CVal = cast(Val); + SmallVector FilterList; + for (User::op_iterator + II = CVal->op_begin(), IE = CVal->op_end(); II != IE; ++II) + FilterList.push_back(cast((*II)->stripPointerCasts())); + + MMI.addFilterTypeInfo(MBB, FilterList); + } + } +} -- cgit v1.1 From 9aee335c23bec4f6d1b2cab3bca76231d7b0d556 Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Thu, 8 Sep 2011 22:59:09 +0000 Subject: Directly point debug info to the stack slot of the arugment, instead of trying to keep track of vreg in which it the arugment is copied. The LiveDebugVariable can keep track of variable's ranges. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139330 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp') diff --git a/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp b/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp index 10b251d..b052740 100644 --- a/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp +++ b/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp @@ -351,20 +351,18 @@ void FunctionLoweringInfo::ComputePHILiveOutRegInfo(const PHINode *PN) { } } -/// setByValArgumentFrameIndex - Record frame index for the byval +/// setArgumentFrameIndex - Record frame index for the byval /// argument. This overrides previous frame index entry for this argument, /// if any. -void FunctionLoweringInfo::setByValArgumentFrameIndex(const Argument *A, +void FunctionLoweringInfo::setArgumentFrameIndex(const Argument *A, int FI) { - assert (A->hasByValAttr() && "Argument does not have byval attribute!"); ByValArgFrameIndexMap[A] = FI; } -/// getByValArgumentFrameIndex - Get frame index for the byval argument. +/// getArgumentFrameIndex - Get frame index for the byval argument. /// If the argument does not have any assigned frame index then 0 is /// returned. -int FunctionLoweringInfo::getByValArgumentFrameIndex(const Argument *A) { - assert (A->hasByValAttr() && "Argument does not have byval attribute!"); +int FunctionLoweringInfo::getArgumentFrameIndex(const Argument *A) { DenseMap::iterator I = ByValArgFrameIndexMap.find(A); if (I != ByValArgFrameIndexMap.end()) -- cgit v1.1