diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/AsmPrinter.cpp | 9 | ||||
-rw-r--r-- | lib/CodeGen/DwarfWriter.cpp | 21 |
2 files changed, 20 insertions, 10 deletions
diff --git a/lib/CodeGen/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter.cpp index 3d8dd75a16..e0a5928da8 100644 --- a/lib/CodeGen/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter.cpp @@ -160,6 +160,15 @@ bool AsmPrinter::doFinalization(Module &M) { return false; } +const std::string & +AsmPrinter::getCurrentFunctionEHName(const MachineFunction *MF) { + assert(MF && "No machine function?"); + if (CurrentFnEHName != "") return CurrentFnEHName; + return CurrentFnEHName = + Mang->makeNameProper(MF->getFunction()->getName() + ".eh", + TAI->getGlobalPrefix()); +} + void AsmPrinter::SetupMachineFunction(MachineFunction &MF) { // What's my mangled name? CurrentFnName = Mang->getValueName(MF.getFunction()); diff --git a/lib/CodeGen/DwarfWriter.cpp b/lib/CodeGen/DwarfWriter.cpp index 10f7c99184..121ef1d9e8 100644 --- a/lib/CodeGen/DwarfWriter.cpp +++ b/lib/CodeGen/DwarfWriter.cpp @@ -2833,13 +2833,13 @@ private: // Externally visible entry into the functions eh frame info. if (const char *GlobalDirective = TAI->getGlobalDirective()) - O << GlobalDirective << EHFrameInfo.FnName << ".eh\n"; + O << GlobalDirective << EHFrameInfo.FnName << "\n"; // If there are no calls then you can't unwind. if (!EHFrameInfo.hasCalls) { - O << EHFrameInfo.FnName << ".eh = 0\n"; + O << EHFrameInfo.FnName << " = 0\n"; } else { - O << EHFrameInfo.FnName << ".eh:\n"; + O << EHFrameInfo.FnName << ":\n"; // EH frame header. EmitDifference("eh_frame_end", EHFrameInfo.Number, @@ -2887,7 +2887,7 @@ private: } if (const char *UsedDirective = TAI->getUsedDirective()) - O << UsedDirective << EHFrameInfo.FnName << ".eh\n\n"; + O << UsedDirective << EHFrameInfo.FnName << "\n\n"; } /// EmitExceptionTable - Emit landing pads and actions. @@ -3321,12 +3321,13 @@ public: EmitExceptionTable(); // Save EH frame information - EHFrames.push_back(FunctionEHFrameInfo(getAsm()->CurrentFnName, - SubprogramCount, - MMI->getPersonalityIndex(), - MF->getFrameInfo()->hasCalls(), - !MMI->getLandingPads().empty(), - MMI->getFrameMoves())); + EHFrames. + push_back(FunctionEHFrameInfo(getAsm()->getCurrentFunctionEHName(MF), + SubprogramCount, + MMI->getPersonalityIndex(), + MF->getFrameInfo()->hasCalls(), + !MMI->getLandingPads().empty(), + MMI->getFrameMoves())); } }; |