From: Kristina Brooks Date: Thu, 3 Jan 2019 18:42:31 +0000 (+0000) Subject: [MCStreamer] Use report_fatal_error in EmitRawTextImpl X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0818ca06ff69016b125459bba7f6827857f44e9a;p=llvm [MCStreamer] Use report_fatal_error in EmitRawTextImpl Use report_fatal_error in MCStreamer::EmitRawTextImpl instead of using errs() and explain the rationale behind it not being llvm_unreachable() to save confusion for any future maintainers. Differential Revision: https://reviews.llvm.org/D56245 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350342 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/MC/MCStreamer.cpp b/lib/MC/MCStreamer.cpp index 2b2ec40fe60..6a8471bc61b 100644 --- a/lib/MC/MCStreamer.cpp +++ b/lib/MC/MCStreamer.cpp @@ -865,13 +865,11 @@ void MCStreamer::EmitWinCFIEndProlog(SMLoc Loc) { CurFrame->PrologEnd = Label; } -void MCStreamer::EmitCOFFSafeSEH(MCSymbol const *Symbol) { -} +void MCStreamer::EmitCOFFSafeSEH(MCSymbol const *Symbol) {} void MCStreamer::EmitCOFFSymbolIndex(MCSymbol const *Symbol) {} -void MCStreamer::EmitCOFFSectionIndex(MCSymbol const *Symbol) { -} +void MCStreamer::EmitCOFFSectionIndex(MCSymbol const *Symbol) {} void MCStreamer::EmitCOFFSecRel32(MCSymbol const *Symbol, uint64_t Offset) {} @@ -881,9 +879,12 @@ void MCStreamer::EmitCOFFImgRel32(MCSymbol const *Symbol, int64_t Offset) {} /// the specified string in the output .s file. This capability is /// indicated by the hasRawTextSupport() predicate. void MCStreamer::EmitRawTextImpl(StringRef String) { - errs() << "EmitRawText called on an MCStreamer that doesn't support it, " - " something must not be fully mc'ized\n"; - abort(); + // This is not llvm_unreachable for the sake of out of tree backend + // developers who may not have assembly streamers and should serve as a + // reminder to not accidentally call EmitRawText in the absence of such. + report_fatal_error("EmitRawText called on an MCStreamer that doesn't support " + "it (target backend is likely missing an AsmStreamer " + "implementation)"); } void MCStreamer::EmitRawText(const Twine &T) {