summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/RewriteTest.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-06-15 17:48:49 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-06-15 17:48:49 +0000
commitc1b1729b667774f88fd78ef8be6b31810863b286 (patch)
treedcc8943e9246e97330d3e1407c19a39f9e720813 /clang/lib/Frontend/RewriteTest.cpp
parenta8b941c21b91612b9a0e5933e44c3d724d37f68f (diff)
downloadbcm5719-llvm-c1b1729b667774f88fd78ef8be6b31810863b286.tar.gz
bcm5719-llvm-c1b1729b667774f88fd78ef8be6b31810863b286.zip
Break Frontend's dependency on Rewrite, Checker and CodeGen in shared library configuration
Currently, all AST consumers are located in the Frontend library, meaning that in a shared library configuration, Frontend has a dependency on Rewrite, Checker and CodeGen. This is suboptimal for clients which only wish to make use of the frontend. CodeGen in particular introduces a large number of unwanted dependencies. This patch breaks the dependency by moving all AST consumers with dependencies on Rewrite, Checker and/or CodeGen to their respective libraries. The patch therefore introduces dependencies in the other direction (i.e. from Rewrite, Checker and CodeGen to Frontend). After applying this patch, Clang builds correctly using CMake and shared libraries ("cmake -DBUILD_SHARED_LIBS=ON"). N.B. This patch includes file renames which are indicated in the patch body. Changes in this revision of the patch: - Fixed some copy-paste mistakes in the header files - Modified certain aspects of the coding to comply with the LLVM Coding Standards llvm-svn: 106010
Diffstat (limited to 'clang/lib/Frontend/RewriteTest.cpp')
-rw-r--r--clang/lib/Frontend/RewriteTest.cpp39
1 files changed, 0 insertions, 39 deletions
diff --git a/clang/lib/Frontend/RewriteTest.cpp b/clang/lib/Frontend/RewriteTest.cpp
deleted file mode 100644
index 0414678fb61..00000000000
--- a/clang/lib/Frontend/RewriteTest.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-//===--- RewriteTest.cpp - Rewriter playground ----------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This is a testbed.
-//
-//===----------------------------------------------------------------------===//
-
-#include "clang/Frontend/Utils.h"
-#include "clang/Lex/Preprocessor.h"
-#include "clang/Rewrite/TokenRewriter.h"
-#include "llvm/Support/raw_ostream.h"
-
-void clang::DoRewriteTest(Preprocessor &PP, llvm::raw_ostream* OS) {
- SourceManager &SM = PP.getSourceManager();
- const LangOptions &LangOpts = PP.getLangOptions();
-
- TokenRewriter Rewriter(SM.getMainFileID(), SM, LangOpts);
-
- // Throw <i> </i> tags around comments.
- for (TokenRewriter::token_iterator I = Rewriter.token_begin(),
- E = Rewriter.token_end(); I != E; ++I) {
- if (I->isNot(tok::comment)) continue;
-
- Rewriter.AddTokenBefore(I, "<i>");
- Rewriter.AddTokenAfter(I, "</i>");
- }
-
-
- // Print out the output.
- for (TokenRewriter::token_iterator I = Rewriter.token_begin(),
- E = Rewriter.token_end(); I != E; ++I)
- *OS << PP.getSpelling(*I);
-}
OpenPOWER on IntegriCloud