summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineFunction.cpp
diff options
context:
space:
mode:
authorKrasimir Georgiev <krasimir@google.com>2018-10-16 18:50:09 +0000
committerKrasimir Georgiev <krasimir@google.com>2018-10-16 18:50:09 +0000
commit547d824da661fedaeeda3a4bcb83a3464fa1b7b9 (patch)
tree008630b0dc9e8141304feb83e81695e22d98b5fe /llvm/lib/CodeGen/MachineFunction.cpp
parentae4e75fd6e89cb7706b218f54ea16a0bbdb9a0c2 (diff)
downloadbcm5719-llvm-547d824da661fedaeeda3a4bcb83a3464fa1b7b9.tar.gz
bcm5719-llvm-547d824da661fedaeeda3a4bcb83a3464fa1b7b9.zip
Revert "[WebAssembly] LSDA info generation"
This reverts commit r344575. Newly introduced test eh-lsda.ll.test fails with use-after-free under ASAN build. llvm-svn: 344639
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunction.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineFunction.cpp45
1 files changed, 20 insertions, 25 deletions
diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp
index 9e4963c4bdb..431484f078b 100644
--- a/llvm/lib/CodeGen/MachineFunction.cpp
+++ b/llvm/lib/CodeGen/MachineFunction.cpp
@@ -661,11 +661,8 @@ MCSymbol *MachineFunction::addLandingPad(MachineBasicBlock *LandingPad) {
}
}
- } else if (const auto *CPI = dyn_cast<CatchPadInst>(FirstI)) {
- for (unsigned I = CPI->getNumArgOperands(); I != 0; --I) {
- Value *TypeInfo = CPI->getArgOperand(I - 1)->stripPointerCasts();
- addCatchTypeInfo(LandingPad, dyn_cast<GlobalValue>(TypeInfo));
- }
+ } else if (isa<CatchPadInst>(FirstI)) {
+ // TODO
} else {
assert(isa<CleanupPadInst>(FirstI) && "Invalid landingpad!");
@@ -690,8 +687,7 @@ void MachineFunction::addFilterTypeInfo(MachineBasicBlock *LandingPad,
LP.TypeIds.push_back(getFilterIDFor(IdsInFilter));
}
-void MachineFunction::tidyLandingPads(DenseMap<MCSymbol *, uintptr_t> *LPMap,
- bool TidyIfNoBeginLabels) {
+void MachineFunction::tidyLandingPads(DenseMap<MCSymbol*, uintptr_t> *LPMap) {
for (unsigned i = 0; i != LandingPads.size(); ) {
LandingPadInfo &LandingPad = LandingPads[i];
if (LandingPad.LandingPadLabel &&
@@ -706,25 +702,24 @@ void MachineFunction::tidyLandingPads(DenseMap<MCSymbol *, uintptr_t> *LPMap,
continue;
}
- if (TidyIfNoBeginLabels) {
- for (unsigned j = 0, e = LandingPads[i].BeginLabels.size(); j != e; ++j) {
- MCSymbol *BeginLabel = LandingPad.BeginLabels[j];
- MCSymbol *EndLabel = LandingPad.EndLabels[j];
- if ((BeginLabel->isDefined() || (LPMap && (*LPMap)[BeginLabel] != 0)) &&
- (EndLabel->isDefined() || (LPMap && (*LPMap)[EndLabel] != 0)))
- continue;
-
- LandingPad.BeginLabels.erase(LandingPad.BeginLabels.begin() + j);
- LandingPad.EndLabels.erase(LandingPad.EndLabels.begin() + j);
- --j;
- --e;
- }
+ for (unsigned j = 0, e = LandingPads[i].BeginLabels.size(); j != e; ++j) {
+ MCSymbol *BeginLabel = LandingPad.BeginLabels[j];
+ MCSymbol *EndLabel = LandingPad.EndLabels[j];
+ if ((BeginLabel->isDefined() ||
+ (LPMap && (*LPMap)[BeginLabel] != 0)) &&
+ (EndLabel->isDefined() ||
+ (LPMap && (*LPMap)[EndLabel] != 0))) continue;
+
+ LandingPad.BeginLabels.erase(LandingPad.BeginLabels.begin() + j);
+ LandingPad.EndLabels.erase(LandingPad.EndLabels.begin() + j);
+ --j;
+ --e;
+ }
- // Remove landing pads with no try-ranges.
- if (LandingPads[i].BeginLabels.empty()) {
- LandingPads.erase(LandingPads.begin() + i);
- continue;
- }
+ // Remove landing pads with no try-ranges.
+ if (LandingPads[i].BeginLabels.empty()) {
+ LandingPads.erase(LandingPads.begin() + i);
+ continue;
}
// If there is no landing pad, ensure that the list of typeids is empty.
OpenPOWER on IntegriCloud