]> granicus.if.org Git - clang/commit
[Index] Return SourceLocation to consumers, not FileID/Offset pair.
authorSam McCall <sam.mccall@gmail.com>
Mon, 9 Apr 2018 14:12:51 +0000 (14:12 +0000)
committerSam McCall <sam.mccall@gmail.com>
Mon, 9 Apr 2018 14:12:51 +0000 (14:12 +0000)
commit669d5dd00e589f55ec1d84aa3477e5a106360a2d
treefd0f1d80ddf44186de04d4d4d5b18f0ec737ed24
parente91fcbae7e0168a178135295b28a5f58c345ce40
[Index] Return SourceLocation to consumers, not FileID/Offset pair.

Summary:
The FileID/Offset conversion is lossy. The code takes the fileLoc, which loses
e.g. the spelling location in some macro cases.
Instead, pass the original SourceLocation which preserves all information, and
update consumers to match current behavior.

This allows us to fix two bugs in clangd that need the spelling location.

Reviewers: akyrtzi, arphaman

Subscribers: ilya-biryukov, ioeric, cfe-commits

Differential Revision: https://reviews.llvm.org/D45014

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@329570 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Index/IndexDataConsumer.h
lib/Index/IndexingAction.cpp
lib/Index/IndexingContext.cpp
tools/c-index-test/core_main.cpp
tools/libclang/CXIndexDataConsumer.cpp
tools/libclang/CXIndexDataConsumer.h