diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-11-04 23:56:25 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-11-04 23:56:25 +0000 |
commit | 90b1827c1c1cf075266b96b416eefcf37924333b (patch) | |
tree | a0b0778195785570fa05284bacff688e5dcd4570 /lib/Frontend/HTMLPrint.cpp | |
parent | 593c41fb0bc6dd556401440c63754e28b93d803b (diff) |
Kill PreprocessorFactory, which was both morally repugnant and totally unused.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86076 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/HTMLPrint.cpp')
-rw-r--r-- | lib/Frontend/HTMLPrint.cpp | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/lib/Frontend/HTMLPrint.cpp b/lib/Frontend/HTMLPrint.cpp index 8d93d70e83..75e6184572 100644 --- a/lib/Frontend/HTMLPrint.cpp +++ b/lib/Frontend/HTMLPrint.cpp @@ -13,13 +13,14 @@ #include "clang/Frontend/ASTConsumers.h" #include "clang/AST/ASTConsumer.h" +#include "clang/AST/ASTContext.h" #include "clang/AST/Decl.h" -#include "clang/Rewrite/Rewriter.h" -#include "clang/Rewrite/HTMLRewrite.h" #include "clang/Basic/Diagnostic.h" -#include "clang/Basic/SourceManager.h" #include "clang/Basic/FileManager.h" -#include "clang/AST/ASTContext.h" +#include "clang/Basic/SourceManager.h" +#include "clang/Lex/Preprocessor.h" +#include "clang/Rewrite/HTMLRewrite.h" +#include "clang/Rewrite/Rewriter.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/raw_ostream.h" using namespace clang; @@ -32,13 +33,14 @@ namespace { class HTMLPrinter : public ASTConsumer { Rewriter R; llvm::raw_ostream *Out; - Diagnostic &Diags; - Preprocessor *PP; - PreprocessorFactory *PPF; + Preprocessor &PP; + bool SyntaxHighlight, HighlightMacros; + public: - HTMLPrinter(llvm::raw_ostream *OS, Diagnostic &D, Preprocessor *pp, - PreprocessorFactory* ppf) - : Out(OS), Diags(D), PP(pp), PPF(ppf) {} + HTMLPrinter(llvm::raw_ostream *OS, Preprocessor &pp, + bool _SyntaxHighlight, bool _HighlightMacros) + : Out(OS), PP(pp), SyntaxHighlight(_SyntaxHighlight), + HighlightMacros(_HighlightMacros) {} virtual ~HTMLPrinter(); void Initialize(ASTContext &context); @@ -46,10 +48,10 @@ namespace { } ASTConsumer* clang::CreateHTMLPrinter(llvm::raw_ostream *OS, - Diagnostic &D, Preprocessor *PP, - PreprocessorFactory* PPF) { - - return new HTMLPrinter(OS, D, PP, PPF); + Preprocessor &PP, + bool SyntaxHighlight, + bool HighlightMacros) { + return new HTMLPrinter(OS, PP, SyntaxHighlight, HighlightMacros); } void HTMLPrinter::Initialize(ASTContext &context) { @@ -57,7 +59,7 @@ void HTMLPrinter::Initialize(ASTContext &context) { } HTMLPrinter::~HTMLPrinter() { - if (Diags.hasErrorOccurred()) + if (PP.getDiagnostics().hasErrorOccurred()) return; // Format the file. @@ -79,8 +81,8 @@ HTMLPrinter::~HTMLPrinter() { // We might not have a preprocessor if we come from a deserialized AST file, // for example. - if (PP) html::SyntaxHighlight(R, FID, *PP); - if (PPF) html::HighlightMacros(R, FID, *PP); + if (SyntaxHighlight) html::SyntaxHighlight(R, FID, PP); + if (HighlightMacros) html::HighlightMacros(R, FID, PP); html::EscapeText(R, FID, false, true); // Emit the HTML. |