diff options
author | Reid Kleckner <rnk@google.com> | 2015-11-17 21:10:25 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2015-11-17 21:10:25 +0000 |
commit | c20276d0b2da8bff1e3da2fd80fc4d17f861eddd (patch) | |
tree | b9a45ab78fbb27616e40726209077d3acac213cc /llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp | |
parent | c4e2bed73885b35ba82dd872cc20c9aa46ec774a (diff) | |
download | llvm-c20276d0b2da8bff1e3da2fd80fc4d17f861eddd.zip llvm-c20276d0b2da8bff1e3da2fd80fc4d17f861eddd.tar.gz llvm-c20276d0b2da8bff1e3da2fd80fc4d17f861eddd.tar.bz2 |
[WinEH] Move WinEHFuncInfo from MachineModuleInfo to MachineFunction
Summary:
Now that there is a one-to-one mapping from MachineFunction to
WinEHFuncInfo, we don't need to use a DenseMap to select the right
WinEHFuncInfo for the current funclet.
The main challenge here is that X86WinEHStatePass is an IR pass that
doesn't have access to the MachineFunction. I gave it its own
WinEHFuncInfo object that it uses to calculate state numbers, which it
then throws away. As long as nobody creates or removes EH pads between
this pass and SDAG construction, we will get the same state numbers.
The other thing X86WinEHStatePass does is to mark the EH registration
node. Instead of communicating which alloca was the registration through
WinEHFuncInfo, I added the llvm.x86.seh.ehregnode intrinsic. This
intrinsic generates no code and simply marks the alloca in use.
Reviewers: JCTremoulet
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D14668
llvm-svn: 253378
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp index 52216c2..8d42dce 100644 --- a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp @@ -287,7 +287,7 @@ void FunctionLoweringInfo::set(const Function &fn, MachineFunction &mf, return; // Calculate state numbers if we haven't already. - WinEHFuncInfo &EHInfo = MMI.getWinEHFuncInfo(&fn); + WinEHFuncInfo &EHInfo = *MF->getWinEHFuncInfo(); if (Personality == EHPersonality::MSVC_CXX) calculateWinCXXEHStateNumbers(&fn, EHInfo); else if (isAsynchronousEHPersonality(Personality)) @@ -321,24 +321,6 @@ void FunctionLoweringInfo::set(const Function &fn, MachineFunction &mf, const BasicBlock *BB = CME.Handler.get<const BasicBlock *>(); CME.Handler = MBBMap[BB]; } - - // If there's an explicit EH registration node on the stack, record its - // frame index. - if (EHInfo.EHRegNode && EHInfo.EHRegNode->getParent()->getParent() == Fn) { - assert(StaticAllocaMap.count(EHInfo.EHRegNode)); - EHInfo.EHRegNodeFrameIndex = StaticAllocaMap[EHInfo.EHRegNode]; - } - - // Copy the state numbers to LandingPadInfo for the current function, which - // could be a handler or the parent. This should happen for 32-bit SEH and - // C++ EH. - if (Personality == EHPersonality::MSVC_CXX || - Personality == EHPersonality::MSVC_X86SEH) { - for (const LandingPadInst *LP : LPads) { - MachineBasicBlock *LPadMBB = MBBMap[LP->getParent()]; - MMI.addWinEHState(LPadMBB, EHInfo.EHPadStateMap[LP]); - } - } } /// clear - Clear out all the function-specific state. This returns this |