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

Balázs Kéri via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 11 03:47:30 PDT 2019


balazske created this revision.
Herald added subscribers: cfe-commits, gamesh411, Szelethus, dkrupp.
Herald added a reviewer: martong.
Herald added a reviewer: shafik.
Herald added a project: clang.

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.


Repository:
  rC Clang

https://reviews.llvm.org/D64554

Files:
  include/clang/AST/ASTImporter.h
  include/clang/AST/ASTImporterSharedState.h
  include/clang/CrossTU/CrossTranslationUnit.h
  lib/AST/ASTImporter.cpp
  lib/CrossTU/CrossTranslationUnit.cpp
  unittests/CrossTU/CrossTranslationUnitTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64554.209160.patch
Type: text/x-patch
Size: 12887 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190711/e1455248/attachment-0001.bin>


More information about the cfe-commits mailing list