From 372735f3423bbaacccda99e61805d6d8644487cc Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Wed, 19 Dec 2012 01:16:49 +0000 Subject: Simplify logic to use SourceManager::getFileLoc(), per Argyrios's feedback. llvm-svn: 170487 --- clang/lib/Frontend/DiagnosticRenderer.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'clang/lib/Frontend/DiagnosticRenderer.cpp') diff --git a/clang/lib/Frontend/DiagnosticRenderer.cpp b/clang/lib/Frontend/DiagnosticRenderer.cpp index 88a8706731c..d540964b643 100644 --- a/clang/lib/Frontend/DiagnosticRenderer.cpp +++ b/clang/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); -- cgit v1.2.3