diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-09-01 23:39:15 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-09-01 23:39:15 +0000 |
commit | 998b3d3e8528ebd9d2c5d78d3a82edd90a8953a4 (patch) | |
tree | ccd8215b16e0f4c088e7537c5e888af60a659805 /include/clang/Lex/Preprocessor.h | |
parent | db44a6b00768a14e8a4d388d67edef61a1ae2d63 (diff) |
Allow the preprocessor to be constructed without performing target-
and language-specific initialization. Use this to allow ASTUnit to
create a preprocessor object *before* loading the AST file. No actual
functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138983 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Lex/Preprocessor.h')
-rw-r--r-- | include/clang/Lex/Preprocessor.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/include/clang/Lex/Preprocessor.h b/include/clang/Lex/Preprocessor.h index 7044e34cd3..b23a2156b0 100644 --- a/include/clang/Lex/Preprocessor.h +++ b/include/clang/Lex/Preprocessor.h @@ -59,7 +59,7 @@ class ModuleLoader; class Preprocessor : public llvm::RefCountedBase<Preprocessor> { Diagnostic *Diags; LangOptions &Features; - const TargetInfo &Target; + const TargetInfo *Target; FileManager &FileMgr; SourceManager &SourceMgr; ScratchBuffer *ScratchBuf; @@ -295,19 +295,26 @@ private: // Cached tokens state. public: Preprocessor(Diagnostic &diags, LangOptions &opts, - const TargetInfo &target, + const TargetInfo *target, SourceManager &SM, HeaderSearch &Headers, ModuleLoader &TheModuleLoader, IdentifierInfoLookup *IILookup = 0, - bool OwnsHeaderSearch = false); + bool OwnsHeaderSearch = false, + bool DelayInitialization = false); ~Preprocessor(); + /// \brief Initialize the preprocessor, if the constructor did not already + /// perform the initialization. + /// + /// \param Target Information about the target. + void Initialize(const TargetInfo &Target); + Diagnostic &getDiagnostics() const { return *Diags; } void setDiagnostics(Diagnostic &D) { Diags = &D; } const LangOptions &getLangOptions() const { return Features; } - const TargetInfo &getTargetInfo() const { return Target; } + const TargetInfo &getTargetInfo() const { return *Target; } FileManager &getFileManager() const { return FileMgr; } SourceManager &getSourceManager() const { return SourceMgr; } HeaderSearch &getHeaderSearchInfo() const { return HeaderInfo; } |