[PATCH] D39217: [libclang, bindings]: add spelling location

Masud Rahman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 23 16:40:35 PDT 2017


frutiger created this revision.

- Add a 'Location' class that represents the four properties of a physical location
- Enhance 'SourceLocation' to provide 'expansion' and 'spelling' locations, maintaining backwards compatibility with existing code by forwarding the four properties to 'expansion'.
- Update the implementation to use 'clang_getExpansionLocation' instead of the deprecated 'clang_getInstantiationLocation', which has been present since 2011.
- Update the implementation of 'clang_getSpellingLocation' to actually obtain spelling location instead of file location.
- Update test cases to account for changes to the result of 'clang_getSpellingLocation'.

Note: this commit is a reapplication of r316278 along with fixes to the
test cases.


https://reviews.llvm.org/D39217

Files:
  bindings/python/clang/cindex.py
  bindings/python/tests/cindex/test_location.py
  test/Index/annotate-tokens.c
  test/Index/blocks.c
  test/Index/c-index-api-loadTU-test.m
  test/Index/c-index-getCursor-test.m
  test/Index/get-cursor.cpp
  test/Index/get-cursor.m
  test/Index/load-exprs.c
  test/Index/preamble-conditionals-crash.cpp
  test/Index/preamble_macro_template.cpp
  tools/libclang/CXSourceLocation.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39217.119970.patch
Type: text/x-patch
Size: 18727 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171023/8ebfdd1b/attachment-0001.bin>


More information about the cfe-commits mailing list