Skip to content

Commit

Permalink
[MCStreamer] Use report_fatal_error in EmitRawTextImpl
Browse files Browse the repository at this point in the history
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

llvm-svn: 350342
  • Loading branch information
Kristina Brooks committed Jan 3, 2019
1 parent 31f0f65 commit e434280
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions llvm/lib/MC/MCStreamer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}

Expand All @@ -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) {
Expand Down

0 comments on commit e434280

Please sign in to comment.