[llvm] r350342 - [MCStreamer] Use report_fatal_error in EmitRawTextImpl

Kristina Brooks via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 3 10:42:31 PST 2019


Author: kristina
Date: Thu Jan  3 10:42:31 2019
New Revision: 350342

URL: http://llvm.org/viewvc/llvm-project?rev=350342&view=rev
Log:
[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


Modified:
    llvm/trunk/lib/MC/MCStreamer.cpp

Modified: llvm/trunk/lib/MC/MCStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCStreamer.cpp?rev=350342&r1=350341&r2=350342&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCStreamer.cpp Thu Jan  3 10:42:31 2019
@@ -865,13 +865,11 @@ void MCStreamer::EmitWinCFIEndProlog(SML
   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(MCSymb
 /// 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) {




More information about the llvm-commits mailing list