summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/DiagnosticRenderer.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2012-12-19 01:16:49 +0000
committerTed Kremenek <kremenek@apple.com>2012-12-19 01:16:49 +0000
commit372735f3423bbaacccda99e61805d6d8644487cc (patch)
tree8d4451ae7ecc698bd1d44bf59f65d48df22f309f /clang/lib/Frontend/DiagnosticRenderer.cpp
parent5b841c4a64e338d0d0710422ed6ec5821f6cd43a (diff)
downloadbcm5719-llvm-372735f3423bbaacccda99e61805d6d8644487cc.tar.gz
bcm5719-llvm-372735f3423bbaacccda99e61805d6d8644487cc.zip
Simplify logic to use SourceManager::getFileLoc(), per Argyrios's feedback.
llvm-svn: 170487
Diffstat (limited to 'clang/lib/Frontend/DiagnosticRenderer.cpp')
-rw-r--r--clang/lib/Frontend/DiagnosticRenderer.cpp6
1 files changed, 2 insertions, 4 deletions
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);
OpenPOWER on IntegriCloud