aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Frontend/DiagnosticRenderer.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Frontend/DiagnosticRenderer.cpp b/lib/Frontend/DiagnosticRenderer.cpp
index 88a8706731..d540964b64 100644
--- a/lib/Frontend/DiagnosticRenderer.cpp
+++ b/lib/Frontend/DiagnosticRenderer.cpp
@@ -153,10 +153,8 @@ void DiagnosticRenderer::emitDiagnostic(SourceLocation Loc,
SourceLocation UnexpandedLoc = Loc;
- // Perform the same walk as emitMacroExpansions, to find the ultimate
- // expansion location for the diagnostic.
- while (Loc.isMacroID())
- Loc = SM->getImmediateMacroCallerLoc(Loc);
+ // Find the ultimate expansion location for the diagnostic.
+ Loc = SM->getFileLoc(Loc);
PresumedLoc PLoc = SM->getPresumedLoc(Loc, DiagOpts->ShowPresumedLoc);