HomePhabricator

[CrossTU] Add a function to retrieve original source location.

Description

[CrossTU] Add a function to retrieve original source location.

Summary:
A new function will be added to get the original SourceLocation
for a SourceLocation that was imported as result of getCrossTUDefinition.
The returned SourceLocation is in the context of the (original)
SourceManager for the original source file. Additionally the
ASTUnit object for that source file is returned. This is needed
to get a SourceManager to operate on with the returned source location.

The new function works if multiple different source files are loaded
with the same CrossTU context.

This patch can be treated as part of a bigger change that is needed to
improve macro expansion handliong at plist generation.

Reviewers: martong, shafik, a_sidorin, xazax.hun

Reviewed By: martong

Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits

Tags: #clang

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

Details

Committed
balazskeJul 18 2019, 8:23 AM
Reviewer
martong
Differential Revision
D64554: [CrossTU] Add a function to retrieve original source location.
Parents
rL366448: [ASTUnit] Fix a regression in cached completions
Branches
Unknown
Tags
Unknown