[PATCH] D65064: [CrossTU] Add a function to retrieve original source location.
Balázs Kéri via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jul 22 05:47:17 PDT 2019
balazske added inline comments.
================
Comment at: clang/lib/CrossTU/CrossTranslationUnit.cpp:476
+ NewImporter->setFileIDImportHandler(
+ [this, Unit](FileID ToID, FileID FromID, ASTImporter &Importer) {
+ assert(ImportedFileIDs.find(ToID) == ImportedFileIDs.end() &&
----------------
martong wrote:
> The `Importer` is not used, perhaps it is not needed in the lambda?
>
> Or we might have the mapping of ToID->FromID in the ASTImporter, and the FromID->FromUnit mapping in the CTUContext?
Yes the `Importer` is not needed (if needed later it can be added to the lambda as a variable).
Additional mappings of `FileID` seems not needed now, the current solution is sufficient for this use case. If there is a ToID->FromID in the ASTImporter a "callback" lambda would be still needed to make the FromID->FromUnit mapping.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D65064/new/
https://reviews.llvm.org/D65064
More information about the cfe-commits
mailing list