[cfe-commits] r49868 - in /cfe/trunk: include/clang/Lex/Preprocessor.h lib/Lex/Preprocessor.cpp

Ted Kremenek kremenek at apple.com
Thu Apr 17 14:23:09 PDT 2008


Author: kremenek
Date: Thu Apr 17 16:23:07 2008
New Revision: 49868

URL: http://llvm.org/viewvc/llvm-project?rev=49868&view=rev
Log:
Added "PreprocessorFactory", an interface for lazily creating Preprocessor objects on-demand.

Modified:
    cfe/trunk/include/clang/Lex/Preprocessor.h
    cfe/trunk/lib/Lex/Preprocessor.cpp

Modified: cfe/trunk/include/clang/Lex/Preprocessor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/Preprocessor.h?rev=49868&r1=49867&r2=49868&view=diff

==============================================================================
--- cfe/trunk/include/clang/Lex/Preprocessor.h (original)
+++ cfe/trunk/include/clang/Lex/Preprocessor.h Thu Apr 17 16:23:07 2008
@@ -524,6 +524,14 @@
   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

Modified: cfe/trunk/lib/Lex/Preprocessor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/Preprocessor.cpp?rev=49868&r1=49867&r2=49868&view=diff

==============================================================================
--- cfe/trunk/lib/Lex/Preprocessor.cpp (original)
+++ cfe/trunk/lib/Lex/Preprocessor.cpp Thu Apr 17 16:23:07 2008
@@ -40,6 +40,8 @@
 
 //===----------------------------------------------------------------------===//
 
+PreprocessorFactory::~PreprocessorFactory() {}
+
 Preprocessor::Preprocessor(Diagnostic &diags, const LangOptions &opts,
                            TargetInfo &target, SourceManager &SM, 
                            HeaderSearch &Headers) 





More information about the cfe-commits mailing list