diff options
Diffstat (limited to 'include/clang/Frontend')
-rw-r--r-- | include/clang/Frontend/ASTUnit.h | 10 | ||||
-rw-r--r-- | include/clang/Frontend/CompilerInstance.h | 21 |
2 files changed, 15 insertions, 16 deletions
diff --git a/include/clang/Frontend/ASTUnit.h b/include/clang/Frontend/ASTUnit.h index 190ab85713..731ce383fc 100644 --- a/include/clang/Frontend/ASTUnit.h +++ b/include/clang/Frontend/ASTUnit.h @@ -18,6 +18,7 @@ #include "clang/Serialization/ASTBitCodes.h" #include "clang/Sema/Sema.h" #include "clang/Sema/CodeCompleteConsumer.h" +#include "clang/Lex/ModuleLoader.h" #include "clang/Lex/PreprocessingRecord.h" #include "clang/Basic/SourceManager.h" #include "clang/Basic/FileManager.h" @@ -66,7 +67,7 @@ class GlobalCodeCompletionAllocator /// \brief Utility class for loading a ASTContext from an AST file. /// -class ASTUnit { +class ASTUnit : public ModuleLoader { public: typedef std::map<FileID, std::vector<PreprocessedEntity *> > PreprocessedEntitiesByFileMap; @@ -696,6 +697,13 @@ public: /// /// \returns True if an error occurred, false otherwise. bool serialize(raw_ostream &OS); + + virtual ModuleKey loadModule(SourceLocation ImportLoc, + IdentifierInfo &ModuleName, + SourceLocation ModuleNameLoc) { + // ASTUnit doesn't know how to load modules (not that this matters). + return 0; + } }; } // namespace clang diff --git a/include/clang/Frontend/CompilerInstance.h b/include/clang/Frontend/CompilerInstance.h index 3f97f1addb..88f8976b67 100644 --- a/include/clang/Frontend/CompilerInstance.h +++ b/include/clang/Frontend/CompilerInstance.h @@ -11,6 +11,7 @@ #define LLVM_CLANG_FRONTEND_COMPILERINSTANCE_H_ #include "clang/Frontend/CompilerInvocation.h" +#include "clang/Lex/ModuleLoader.h" #include "llvm/ADT/IntrusiveRefCntPtr.h" #include "llvm/ADT/StringRef.h" #include "llvm/ADT/OwningPtr.h" @@ -56,7 +57,7 @@ class TargetInfo; /// in to the compiler instance for everything. When possible, utility functions /// come in two forms; a short form that reuses the CompilerInstance objects, /// and a long form that takes explicit instances of any required objects. -class CompilerInstance { +class CompilerInstance : public ModuleLoader { /// The options used in this compiler instance. llvm::IntrusiveRefCntPtr<CompilerInvocation> Invocation; @@ -498,20 +499,6 @@ public: /// and replace any existing one with it. void createPreprocessor(); - /// Create a Preprocessor object. - /// - /// Note that this also creates a new HeaderSearch object which will be owned - /// by the resulting Preprocessor. - /// - /// \return The new object on success, or null on failure. - static Preprocessor *createPreprocessor(Diagnostic &, const LangOptions &, - const PreprocessorOptions &, - const HeaderSearchOptions &, - const DependencyOutputOptions &, - const TargetInfo &, - const FrontendOptions &, - SourceManager &, FileManager &); - /// Create the AST context. void createASTContext(); @@ -626,6 +613,10 @@ public: const FrontendOptions &Opts); /// } + + virtual ModuleKey loadModule(SourceLocation ImportLoc, + IdentifierInfo &ModuleName, + SourceLocation ModuleNameLoc); }; } // end namespace clang |