summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2016-10-19 17:08:23 +0000
committerReid Kleckner <rnk@google.com>2016-10-19 17:08:23 +0000
commitf7ad5341d056a40c1308f1a3a13dd76f42d52894 (patch)
tree9ab27d4dfca0ebaac38e8a9e2a31e3cebfd1c6ec /llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
parent3a3aaf67e07ade866b9500a9466086a68d0dd70c (diff)
downloadbcm5719-llvm-f7ad5341d056a40c1308f1a3a13dd76f42d52894.tar.gz
bcm5719-llvm-f7ad5341d056a40c1308f1a3a13dd76f42d52894.zip
[WinEH] Allow catchpads to reuse the same catch object
This code used a regular when it should have used a multimap. llvm-svn: 284612
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
index 3d27f5df205..5196cc35949 100644
--- a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
@@ -98,7 +98,7 @@ void FunctionLoweringInfo::set(const Function &fn, MachineFunction &mf,
Fn->isVarArg(), Outs, Fn->getContext());
// If this personality uses funclets, we need to do a bit more work.
- DenseMap<const AllocaInst *, int *> CatchObjects;
+ DenseMap<const AllocaInst *, TinyPtrVector<int *>> CatchObjects;
EHPersonality Personality = classifyEHPersonality(
Fn->hasPersonalityFn() ? Fn->getPersonalityFn() : nullptr);
if (isFuncletEHPersonality(Personality)) {
@@ -115,7 +115,8 @@ void FunctionLoweringInfo::set(const Function &fn, MachineFunction &mf,
for (WinEHTryBlockMapEntry &TBME : EHInfo.TryBlockMap) {
for (WinEHHandlerType &H : TBME.HandlerArray) {
if (const AllocaInst *AI = H.CatchObj.Alloca)
- CatchObjects.insert({AI, &H.CatchObj.FrameIndex});
+ CatchObjects.insert({AI, {}}).first->second.push_back(
+ &H.CatchObj.FrameIndex);
else
H.CatchObj.FrameIndex = INT_MAX;
}
@@ -158,8 +159,10 @@ void FunctionLoweringInfo::set(const Function &fn, MachineFunction &mf,
StaticAllocaMap[AI] = FrameIndex;
// Update the catch handler information.
- if (Iter != CatchObjects.end())
- *Iter->second = FrameIndex;
+ if (Iter != CatchObjects.end()) {
+ for (int *CatchObjPtr : Iter->second)
+ *CatchObjPtr = FrameIndex;
+ }
} else {
// FIXME: Overaligned static allocas should be grouped into
// a single dynamic allocation instead of using a separate
OpenPOWER on IntegriCloud