summaryrefslogtreecommitdiffstats
path: root/clang/include/clang/AST/ASTImporter.h
diff options
context:
space:
mode:
Diffstat (limited to 'clang/include/clang/AST/ASTImporter.h')
-rw-r--r--clang/include/clang/AST/ASTImporter.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/include/clang/AST/ASTImporter.h b/clang/include/clang/AST/ASTImporter.h
index 4a55c120a45..12bd5623ec0 100644
--- a/clang/include/clang/AST/ASTImporter.h
+++ b/clang/include/clang/AST/ASTImporter.h
@@ -87,6 +87,8 @@ class TypeSourceInfo;
using NonEquivalentDeclSet = llvm::DenseSet<std::pair<Decl *, Decl *>>;
using ImportedCXXBaseSpecifierMap =
llvm::DenseMap<const CXXBaseSpecifier *, CXXBaseSpecifier *>;
+ using FileIDImportHandlerType =
+ std::function<void(FileID /*ToID*/, FileID /*FromID*/)>;
// An ImportPath is the list of the AST nodes which we visit during an
// Import call.
@@ -210,6 +212,8 @@ class TypeSourceInfo;
};
private:
+ FileIDImportHandlerType FileIDImportHandler;
+
std::shared_ptr<ASTImporterSharedState> SharedState = nullptr;
/// The path which we go through during the import of a given AST node.
@@ -310,6 +314,14 @@ class TypeSourceInfo;
virtual ~ASTImporter();
+ /// Set a callback function for FileID import handling.
+ /// The function is invoked when a FileID is imported from the From context.
+ /// The imported FileID in the To context and the original FileID in the
+ /// From context is passed to it.
+ void setFileIDImportHandler(FileIDImportHandlerType H) {
+ FileIDImportHandler = H;
+ }
+
/// Whether the importer will perform a minimal import, creating
/// to-be-completed forward declarations when possible.
bool isMinimalImport() const { return Minimal; }
OpenPOWER on IntegriCloud