Move the EH symbol to the asm printer and use it for the SJLJ case too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232475 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2015-03-17 13:57:48 +00:00
parent f28b151b52
commit a480f88b3c
9 changed files with 18 additions and 37 deletions

View File

@@ -25,22 +25,10 @@
using namespace llvm;
EHStreamer::EHStreamer(AsmPrinter *A)
: CurExceptionSym(nullptr), Asm(A), MMI(Asm->MMI) {}
EHStreamer::EHStreamer(AsmPrinter *A) : Asm(A), MMI(Asm->MMI) {}
EHStreamer::~EHStreamer() {}
MCSymbol *EHStreamer::getCurExceptionSym() {
if (!CurExceptionSym)
CurExceptionSym = Asm->OutContext.createTempSymbol(
"exception" + Twine(Asm->getFunctionNumber()));
return CurExceptionSym;
}
void EHStreamer::beginFunction(const MachineFunction *MF) {
CurExceptionSym = nullptr;
}
/// How many leading type ids two landing pads have in common.
unsigned EHStreamer::sharedTypeIDs(const LandingPadInfo *L,
const LandingPadInfo *R) {
@@ -448,11 +436,7 @@ void EHStreamer::emitExceptionTable() {
Asm->OutContext.GetOrCreateSymbol(Twine("GCC_except_table")+
Twine(Asm->getFunctionNumber()));
Asm->OutStreamer.EmitLabel(GCCETSym);
Asm->OutStreamer.EmitLabel(getCurExceptionSym());
if (IsSJLJ)
Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("_LSDA_",
Asm->getFunctionNumber()));
Asm->OutStreamer.EmitLabel(Asm->getCurExceptionSym());
// Emit the LSDA header.
Asm->EmitEncodingByte(dwarf::DW_EH_PE_omit, "@LPStart");