From a01d34676fa45ab341d18cf9ec1e39cc5979898f Mon Sep 17 00:00:00 2001 From: Jim Grosbach Date: Tue, 1 Sep 2009 16:43:35 +0000 Subject: [PATCH] Simply LSDA lable emission to use a direct special-case output instead of EmitLabel() git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80677 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/AsmPrinter/DwarfException.cpp | 7 +++---- lib/CodeGen/AsmPrinter/DwarfPrinter.cpp | 18 ++++++------------ lib/CodeGen/AsmPrinter/DwarfPrinter.h | 8 +++----- 3 files changed, 12 insertions(+), 21 deletions(-) diff --git a/lib/CodeGen/AsmPrinter/DwarfException.cpp b/lib/CodeGen/AsmPrinter/DwarfException.cpp index 2fcee3e2850..a1fa20e07f1 100644 --- a/lib/CodeGen/AsmPrinter/DwarfException.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfException.cpp @@ -459,9 +459,8 @@ ComputeCallSiteTable(SmallVectorImpl &CallSites, FirstActions[P.PadIndex] }; - // Try to merge with the previous call-site. SJLJ doesn't do this - if (PreviousIsInvoke && - MAI->getExceptionHandlingType() == ExceptionHandling::Dwarf) { + // Try to merge with the previous call-site. + if (PreviousIsInvoke) { CallSiteEntry &Prev = CallSites.back(); if (Site.PadLabel == Prev.PadLabel && Site.Action == Prev.Action) { // Extend the range of the previous entry. @@ -606,7 +605,7 @@ void DwarfException::EmitExceptionTable() { std::string LSDAName = Asm->Mang->makeNameProper(std::string("LSDA_") + out.str(), Mangler::Private); - EmitLabel(LSDAName.c_str(), 0, false); + O << LSDAName << ":\n"; } // Emit the header. diff --git a/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp b/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp index 60ff2c57cd0..20b959b914f 100644 --- a/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfPrinter.cpp @@ -43,27 +43,21 @@ void Dwarf::PrintRelDirective(bool Force32Bit, bool isInSection) const { /// PrintLabelName - Print label name in form used by Dwarf writer. /// -void Dwarf::PrintLabelName(const char *Tag, unsigned Number, - bool ForcePrivate) const { - if (ForcePrivate) - O << MAI->getPrivateGlobalPrefix(); - O << Tag; +void Dwarf::PrintLabelName(const char *Tag, unsigned Number) const { + O << MAI->getPrivateGlobalPrefix() << Tag; if (Number) O << Number; } void Dwarf::PrintLabelName(const char *Tag, unsigned Number, - const char *Suffix, bool ForcePrivate) const { - if (ForcePrivate) - O << MAI->getPrivateGlobalPrefix(); - O << Tag; + const char *Suffix) const { + O << MAI->getPrivateGlobalPrefix() << Tag; if (Number) O << Number; O << Suffix; } /// EmitLabel - Emit location label for internal use by Dwarf. /// -void Dwarf::EmitLabel(const char *Tag, unsigned Number, - bool ForcePrivate) const { - PrintLabelName(Tag, Number, ForcePrivate); +void Dwarf::EmitLabel(const char *Tag, unsigned Number) const { + PrintLabelName(Tag, Number); O << ":\n"; } diff --git a/lib/CodeGen/AsmPrinter/DwarfPrinter.h b/lib/CodeGen/AsmPrinter/DwarfPrinter.h index 01aa775ebe5..33ebb3bd0eb 100644 --- a/lib/CodeGen/AsmPrinter/DwarfPrinter.h +++ b/lib/CodeGen/AsmPrinter/DwarfPrinter.h @@ -100,18 +100,16 @@ namespace llvm { void PrintLabelName(const DWLabel &Label) const { PrintLabelName(Label.getTag(), Label.getNumber()); } + void PrintLabelName(const char *Tag, unsigned Number) const; void PrintLabelName(const char *Tag, unsigned Number, - bool ForcePrivate = true) const; - void PrintLabelName(const char *Tag, unsigned Number, - const char *Suffix, bool ForcePrivate = true) const; + const char *Suffix) const; /// EmitLabel - Emit location label for internal use by Dwarf. /// void EmitLabel(const DWLabel &Label) const { EmitLabel(Label.getTag(), Label.getNumber()); } - void EmitLabel(const char *Tag, unsigned Number, - bool ForcePrivate = true) const; + void EmitLabel(const char *Tag, unsigned Number) const; /// EmitReference - Emit a reference to a label. ///