From ec6c574478a22008847d7ebc2498ef3336752096 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Thu, 17 Apr 2008 21:23:07 +0000 Subject: [PATCH] Added "PreprocessorFactory", an interface for lazily creating Preprocessor objects on-demand. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49868 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Lex/Preprocessor.h | 8 ++++++++ lib/Lex/Preprocessor.cpp | 2 ++ 2 files changed, 10 insertions(+) diff --git a/include/clang/Lex/Preprocessor.h b/include/clang/Lex/Preprocessor.h index 98edf5af7a..5fc4642dd8 100644 --- a/include/clang/Lex/Preprocessor.h +++ b/include/clang/Lex/Preprocessor.h @@ -524,6 +524,14 @@ public: void HandlePragmaDependency(Token &DependencyTok); }; +/// PreprocessorFactory - A generic factory interface for lazily creating +/// Preprocessor objects on-demand when they are needed. +class PreprocessorFactory { +public: + virtual ~PreprocessorFactory(); + virtual Preprocessor* CreatePreprocessor() = 0; +}; + } // end namespace clang #endif diff --git a/lib/Lex/Preprocessor.cpp b/lib/Lex/Preprocessor.cpp index ebd3072866..6d08a36fde 100644 --- a/lib/Lex/Preprocessor.cpp +++ b/lib/Lex/Preprocessor.cpp @@ -40,6 +40,8 @@ using namespace clang; //===----------------------------------------------------------------------===// +PreprocessorFactory::~PreprocessorFactory() {} + Preprocessor::Preprocessor(Diagnostic &diags, const LangOptions &opts, TargetInfo &target, SourceManager &SM, HeaderSearch &Headers) -- 2.40.0