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.h29
1 files changed, 28 insertions, 1 deletions
diff --git a/clang/include/clang/AST/ASTImporter.h b/clang/include/clang/AST/ASTImporter.h
index 4a55c120a45..38e9b03aea5 100644
--- a/clang/include/clang/AST/ASTImporter.h
+++ b/clang/include/clang/AST/ASTImporter.h
@@ -34,6 +34,7 @@ namespace clang {
class ASTContext;
class ASTImporterSharedState;
+class ASTUnit;
class Attr;
class CXXBaseSpecifier;
class CXXCtorInitializer;
@@ -229,6 +230,11 @@ class TypeSourceInfo;
/// The file managers we're importing to and from.
FileManager &ToFileManager, &FromFileManager;
+ /// The ASTUnit for the From context, if any.
+ /// This is used to create a mapping of imported ('To') FileID's to the
+ /// original ('From') FileID and ASTUnit.
+ ASTUnit *FromUnit;
+
/// Whether to perform a minimal import.
bool Minimal;
@@ -277,6 +283,11 @@ class TypeSourceInfo;
void AddToLookupTable(Decl *ToD);
+ ASTImporter(ASTContext &ToContext, FileManager &ToFileManager,
+ ASTContext &FromContext, FileManager &FromFileManager,
+ ASTUnit *FromUnit, bool MinimalImport,
+ std::shared_ptr<ASTImporterSharedState> SharedState);
+
protected:
/// Can be overwritten by subclasses to implement their own import logic.
/// The overwritten method should call this method if it didn't import the
@@ -287,7 +298,6 @@ class TypeSourceInfo;
virtual bool returnWithErrorInTest() { return false; };
public:
-
/// \param ToContext The context we'll be importing into.
///
/// \param ToFileManager The file manager we'll be importing into.
@@ -307,6 +317,23 @@ class TypeSourceInfo;
ASTContext &FromContext, FileManager &FromFileManager,
bool MinimalImport,
std::shared_ptr<ASTImporterSharedState> SharedState = nullptr);
+ /// \param ToContext The context we'll be importing into.
+ ///
+ /// \param ToFileManager The file manager we'll be importing into.
+ ///
+ /// \param FromUnit Pointer to an ASTUnit that contains the context and
+ /// file manager to import from.
+ ///
+ /// \param MinimalImport If true, the importer will attempt to import
+ /// as little as it can, e.g., by importing declarations as forward
+ /// declarations that can be completed at a later point.
+ ///
+ /// \param SharedState The importer specific lookup table which may be
+ /// shared amongst several ASTImporter objects.
+ /// If not set then the original C/C++ lookup is used.
+ ASTImporter(ASTContext &ToContext, FileManager &ToFileManager,
+ ASTUnit &FromUnit, bool MinimalImport,
+ std::shared_ptr<ASTImporterSharedState> SharedState = nullptr);
virtual ~ASTImporter();
OpenPOWER on IntegriCloud