[CrossTU] Add a function to retrieve original source location.
authorBalazs Keri <1.int32@gmail.com>
Wed, 24 Jul 2019 10:16:37 +0000 (10:16 +0000)
committerBalazs Keri <1.int32@gmail.com>
Wed, 24 Jul 2019 10:16:37 +0000 (10:16 +0000)
commitd22f877356addf54b0b7a09e20b7f61a91ef49d9
tree101fe1c55ed72be68d5497e872c577dd4848b367
parent5a43ba8a6245372a55871e69fdec31017aae8eab
[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.

Reviewers: martong, shafik

Reviewed By: martong

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

Tags: #clang

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

llvm-svn: 366884
clang/include/clang/AST/ASTImporter.h
clang/include/clang/CrossTU/CrossTranslationUnit.h
clang/lib/AST/ASTImporter.cpp
clang/lib/CrossTU/CrossTranslationUnit.cpp
clang/unittests/CrossTU/CrossTranslationUnitTest.cpp