summaryrefslogtreecommitdiff
path: root/lld/Common/ErrorHandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/Common/ErrorHandler.cpp')
-rw-r--r--lld/Common/ErrorHandler.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lld/Common/ErrorHandler.cpp b/lld/Common/ErrorHandler.cpp
index 15b3bd058ee9..e557e533dedc 100644
--- a/lld/Common/ErrorHandler.cpp
+++ b/lld/Common/ErrorHandler.cpp
@@ -107,6 +107,13 @@ void lld::diagnosticHandler(const DiagnosticInfo &di) {
SmallString<128> s;
raw_svector_ostream os(s);
DiagnosticPrinterRawOStream dp(os);
+
+ // For an inline asm diagnostic, prepend the module name to get something like
+ // "$module <inline asm>:1:5: ".
+ if (auto *dism = dyn_cast<DiagnosticInfoSrcMgr>(&di))
+ if (dism->isInlineAsmDiag())
+ os << dism->getModuleName() << ' ';
+
di.print(dp);
switch (di.getSeverity()) {
case DS_Error: