summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2015-09-16 20:16:27 +0000
committerReid Kleckner <rnk@google.com>2015-09-16 20:16:27 +0000
commitb005d281c36c09eda1b85db59e2c183ed5defca5 (patch)
tree8263838e6c8079eceaccb60c61aa8c393205aa95 /llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
parent10aa77032de43681231e81ee3f2e7d232b16dc9c (diff)
downloadbcm5719-llvm-b005d281c36c09eda1b85db59e2c183ed5defca5.tar.gz
bcm5719-llvm-b005d281c36c09eda1b85db59e2c183ed5defca5.zip
[WinEH] Pull Adjectives and CatchObj out of the catchpad arg list
Clang now passes the adjectives as an argument to catchpad. Getting the CatchObj working is simply a matter of threading another static alloca through codegen, first as an alloca, then as a frame index, and finally as a frame offset. llvm-svn: 247844
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
index fe359777a36..baf9ee990ea 100644
--- a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
@@ -294,11 +294,18 @@ void FunctionLoweringInfo::set(const Function &fn, MachineFunction &mf,
calculateSEHStateNumbers(WinEHParentFn, EHInfo);
// Map all BB references in the WinEH data to MBBs.
- for (WinEHTryBlockMapEntry &TBME : EHInfo.TryBlockMap)
- for (WinEHHandlerType &H : TBME.HandlerArray)
- if (const auto *BB =
- dyn_cast<BasicBlock>(H.Handler.get<const Value *>()))
+ for (WinEHTryBlockMapEntry &TBME : EHInfo.TryBlockMap) {
+ for (WinEHHandlerType &H : TBME.HandlerArray) {
+ if (H.CatchObjRecoverIdx == -2 && H.CatchObj.Alloca) {
+ assert(StaticAllocaMap.count(H.CatchObj.Alloca));
+ H.CatchObj.FrameIndex = StaticAllocaMap[H.CatchObj.Alloca];
+ } else {
+ H.CatchObj.FrameIndex = INT_MAX;
+ }
+ if (const auto *BB = dyn_cast<BasicBlock>(H.Handler.get<const Value *>()))
H.Handler = MBBMap[BB];
+ }
+ }
for (WinEHUnwindMapEntry &UME : EHInfo.UnwindMap)
if (UME.Cleanup)
if (const auto *BB = dyn_cast<BasicBlock>(UME.Cleanup.get<const Value *>()))
OpenPOWER on IntegriCloud