diff options
author | Ted Kremenek <kremenek@apple.com> | 2012-12-19 01:16:49 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2012-12-19 01:16:49 +0000 |
commit | 372735f3423bbaacccda99e61805d6d8644487cc (patch) | |
tree | 8d4451ae7ecc698bd1d44bf59f65d48df22f309f /clang/tools/libclang/CXSourceLocation.cpp | |
parent | 5b841c4a64e338d0d0710422ed6ec5821f6cd43a (diff) | |
download | bcm5719-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/tools/libclang/CXSourceLocation.cpp')
-rw-r--r-- | clang/tools/libclang/CXSourceLocation.cpp | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/clang/tools/libclang/CXSourceLocation.cpp b/clang/tools/libclang/CXSourceLocation.cpp index c715eecdecf..5d49f42a4a5 100644 --- a/clang/tools/libclang/CXSourceLocation.cpp +++ b/clang/tools/libclang/CXSourceLocation.cpp @@ -294,14 +294,7 @@ void clang_getSpellingLocation(CXSourceLocation location, const SourceManager &SM = *static_cast<const SourceManager*>(location.ptr_data[0]); - SourceLocation SpellLoc = Loc; - - // Unravel the macro instantiation stack. This logic mirrors that - // in DiagnosticRenderer. - while (SpellLoc.isMacroID()) { - SpellLoc = SM.getImmediateMacroCallerLoc(SpellLoc); - } - + SourceLocation SpellLoc = SM.getFileLoc(Loc); std::pair<FileID, unsigned> LocInfo = SM.getDecomposedLoc(SpellLoc); FileID FID = LocInfo.first; unsigned FileOffset = LocInfo.second; |