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

@ -108,7 +108,7 @@ AsmPrinter::AsmPrinter(TargetMachine &tm, std::unique_ptr<MCStreamer> Streamer)
MMI = nullptr;
LI = nullptr;
MF = nullptr;
CurrentFnSym = CurrentFnSymForSize = nullptr;
CurExceptionSym = CurrentFnSym = CurrentFnSymForSize = nullptr;
CurrentFnBegin = nullptr;
CurrentFnEnd = nullptr;
GCMetadataPrinters = nullptr;
@ -1129,12 +1129,19 @@ bool AsmPrinter::doFinalization(Module &M) {
return false;
}
MCSymbol *AsmPrinter::getCurExceptionSym() {
if (!CurExceptionSym)
CurExceptionSym = createTempSymbol("exception", getFunctionNumber());
return CurExceptionSym;
}
void AsmPrinter::SetupMachineFunction(MachineFunction &MF) {
this->MF = &MF;
// Get the function symbol.
CurrentFnSym = getSymbol(MF.getFunction());
CurrentFnSymForSize = CurrentFnSym;
CurrentFnBegin = nullptr;
CurExceptionSym = nullptr;
bool NeedsLocalForSize = MAI->needsLocalForSize();
if (!MMI->getLandingPads().empty() || MMI->hasDebugInfo() ||
NeedsLocalForSize) {