diff options
author | Masud Rahman <llvm@masudrahman.com> | 2017-10-21 20:53:49 +0000 |
---|---|---|
committer | Masud Rahman <llvm@masudrahman.com> | 2017-10-21 20:53:49 +0000 |
commit | d02b8c6579d1e6a51f6c5c289943ecba97e1a1f9 (patch) | |
tree | a50f1c6fc11a30e69d5ee77754dac6fc57294215 /tools | |
parent | 59611f54fa88ba639661d2e0e2e8b607bd48d4a7 (diff) |
[libclang, bindings]: add spelling location
o) Add a 'Location' class that represents the four properties of a
physical location
o) Enhance 'SourceLocation' to provide 'expansion' and 'spelling'
locations, maintaining backwards compatibility with existing code by
forwarding the four properties to 'expansion'.
o) Update the implementation to use 'clang_getExpansionLocation'
instead of the deprecated 'clang_getInstantiationLocation', which
has been present since 2011.
o) Update the implementation of 'clang_getSpellingLocation' to actually
obtain spelling location instead of file location.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316278 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/libclang/CXSourceLocation.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/tools/libclang/CXSourceLocation.cpp b/tools/libclang/CXSourceLocation.cpp index 2e0ea4e440..b1637e01ab 100644 --- a/tools/libclang/CXSourceLocation.cpp +++ b/tools/libclang/CXSourceLocation.cpp @@ -318,8 +318,7 @@ void clang_getSpellingLocation(CXSourceLocation location, const SourceManager &SM = *static_cast<const SourceManager*>(location.ptr_data[0]); - // FIXME: This should call SourceManager::getSpellingLoc(). - SourceLocation SpellLoc = SM.getFileLoc(Loc); + SourceLocation SpellLoc = SM.getSpellingLoc(Loc); std::pair<FileID, unsigned> LocInfo = SM.getDecomposedLoc(SpellLoc); FileID FID = LocInfo.first; unsigned FileOffset = LocInfo.second; |