diff options
Diffstat (limited to 'lib/CodeGen/AsmPrinter')
-rw-r--r-- | lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 7 | ||||
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfException.cpp | 12 |
2 files changed, 15 insertions, 4 deletions
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index b7cc5b3a21..31151f304a 100644 --- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -1553,7 +1553,12 @@ void AsmPrinter::printKill(const MachineInstr *MI) const { /// printLabel - This method prints a local label used by debug and /// exception handling tables. void AsmPrinter::printLabelInst(const MachineInstr *MI) const { - MCSymbol *Sym = + MCSymbol *Sym; + + if (MI->getOperand(0).isMCSymbol()) + Sym = MI->getOperand(0).getMCSymbol(); + else + Sym = OutContext.GetOrCreateTemporarySymbol(Twine(MAI->getPrivateGlobalPrefix()) + "label" + Twine(MI->getOperand(0).getImm())); OutStreamer.EmitLabel(Sym); diff --git a/lib/CodeGen/AsmPrinter/DwarfException.cpp b/lib/CodeGen/AsmPrinter/DwarfException.cpp index ff0aa80b1d..b5f7270ba5 100644 --- a/lib/CodeGen/AsmPrinter/DwarfException.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfException.cpp @@ -475,9 +475,15 @@ ComputeCallSiteTable(SmallVectorImpl<CallSiteEntry> &CallSites, continue; } - unsigned BeginLabelNo = MI->getOperand(0).getImm(); - assert(BeginLabelNo && "Invalid label!"); - MCSymbol *BeginLabel = getDWLabel("label", BeginLabelNo); + MCSymbol *BeginLabel; + if (MI->getOperand(0).isImm()) { + unsigned BeginLabelNo = MI->getOperand(0).getImm(); + assert(BeginLabelNo && "Invalid label!"); + BeginLabel = getDWLabel("label", BeginLabelNo); + } else { + BeginLabel = MI->getOperand(0).getMCSymbol(); + } + // End of the previous try-range? if (BeginLabel == LastLabel) |