diff options
author | Eric Christopher <echristo@gmail.com> | 2016-12-01 07:50:12 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2016-12-01 07:50:12 +0000 |
commit | e70b7c3dfb0e740dc47540ca8d5b92d6d58551bf (patch) | |
tree | b8adc0dd00ee9b06e5b7a4610ce7a9b02bc76071 /llvm/lib/CodeGen/AsmPrinter/WinException.cpp | |
parent | d64ecf26e7efc471882283fcd7a907ee192c1358 (diff) | |
download | llvm-e70b7c3dfb0e740dc47540ca8d5b92d6d58551bf.zip llvm-e70b7c3dfb0e740dc47540ca8d5b92d6d58551bf.tar.gz llvm-e70b7c3dfb0e740dc47540ca8d5b92d6d58551bf.tar.bz2 |
Temporarily Revert "Move most EH from MachineModuleInfo to MachineFunction"
This apprears to have broken the global isel bot:
http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-globalisel_build/5174/console
This reverts commit r288293.
llvm-svn: 288322
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/WinException.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/WinException.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/WinException.cpp b/llvm/lib/CodeGen/AsmPrinter/WinException.cpp index 75cb43d..f249210 100644 --- a/llvm/lib/CodeGen/AsmPrinter/WinException.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/WinException.cpp @@ -63,8 +63,8 @@ void WinException::beginFunction(const MachineFunction *MF) { shouldEmitMoves = shouldEmitPersonality = shouldEmitLSDA = false; // If any landing pads survive, we need an EH table. - bool hasLandingPads = !MF->getLandingPads().empty(); - bool hasEHFunclets = MF->hasEHFunclets(); + bool hasLandingPads = !MMI->getLandingPads().empty(); + bool hasEHFunclets = MMI->hasEHFunclets(); const Function *F = MF->getFunction(); @@ -126,15 +126,13 @@ void WinException::endFunction(const MachineFunction *MF) { // Get rid of any dead landing pads if we're not using funclets. In funclet // schemes, the landing pad is not actually reachable. It only exists so // that we can emit the right table data. - if (!isFuncletEHPersonality(Per)) { - MachineFunction *NonConstMF = const_cast<MachineFunction*>(MF); - NonConstMF->tidyLandingPads(); - } + if (!isFuncletEHPersonality(Per)) + MMI->TidyLandingPads(); endFunclet(); // endFunclet will emit the necessary .xdata tables for x64 SEH. - if (Per == EHPersonality::MSVC_Win64SEH && MF->hasEHFunclets()) + if (Per == EHPersonality::MSVC_Win64SEH && MMI->hasEHFunclets()) return; if (shouldEmitPersonality || shouldEmitLSDA) { @@ -236,9 +234,8 @@ void WinException::endFunclet() { if (!CurrentFuncletEntry) return; - const MachineFunction *MF = Asm->MF; if (shouldEmitMoves || shouldEmitPersonality) { - const Function *F = MF->getFunction(); + const Function *F = Asm->MF->getFunction(); EHPersonality Per = EHPersonality::Unknown; if (F->hasPersonalityFn()) Per = classifyEHPersonality(F->getPersonalityFn()->stripPointerCasts()); @@ -258,11 +255,11 @@ void WinException::endFunclet() { MCSymbol *FuncInfoXData = Asm->OutContext.getOrCreateSymbol( Twine("$cppxdata$", FuncLinkageName)); Asm->OutStreamer->EmitValue(create32bitRef(FuncInfoXData), 4); - } else if (Per == EHPersonality::MSVC_Win64SEH && MF->hasEHFunclets() && + } else if (Per == EHPersonality::MSVC_Win64SEH && MMI->hasEHFunclets() && !CurrentFuncletEntry->isEHFuncletEntry()) { // If this is the parent function in Win64 SEH, emit the LSDA immediately // following .seh_handlerdata. - emitCSpecificHandlerTable(MF); + emitCSpecificHandlerTable(Asm->MF); } // Switch back to the previous section now that we are done writing to |