summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCContext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/MC/MCContext.cpp')
-rw-r--r--llvm/lib/MC/MCContext.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/llvm/lib/MC/MCContext.cpp b/llvm/lib/MC/MCContext.cpp
index 2bfd8e55cad..16c2c99be67 100644
--- a/llvm/lib/MC/MCContext.cpp
+++ b/llvm/lib/MC/MCContext.cpp
@@ -521,15 +521,13 @@ CodeViewContext &MCContext::getCVContext() {
void MCContext::reportError(SMLoc Loc, const Twine &Msg) {
HadError = true;
- // If we have a source manager use it. Otherwise, try using the inline source
- // manager.
- // If that fails, use the generic report_fatal_error().
- if (SrcMgr)
- SrcMgr->PrintMessage(Loc, SourceMgr::DK_Error, Msg);
- else if (InlineSrcMgr)
- InlineSrcMgr->PrintMessage(Loc, SourceMgr::DK_Error, Msg);
- else
+ // If we have a source manager use it. Otherwise just use the generic
+ // report_fatal_error().
+ if (!SrcMgr)
report_fatal_error(Msg, false);
+
+ // Use the source manager to print the message.
+ SrcMgr->PrintMessage(Loc, SourceMgr::DK_Error, Msg);
}
void MCContext::reportFatalError(SMLoc Loc, const Twine &Msg) {
OpenPOWER on IntegriCloud