summaryrefslogtreecommitdiffstats
path: root/clang/lib/Rewrite/FrontendActions.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2012-06-06 18:52:13 +0000
committerDavid Blaikie <dblaikie@gmail.com>2012-06-06 18:52:13 +0000
commitd5321247c4e2315d7aae3dd4c74da5babe3101a0 (patch)
tree9f504d415dbad0f7c7b417a9b54d1e57a8e3ce78 /clang/lib/Rewrite/FrontendActions.cpp
parentef42a6fb1dfd3f8386d65e784cec60e2dfce7319 (diff)
downloadbcm5719-llvm-d5321247c4e2315d7aae3dd4c74da5babe3101a0.tar.gz
bcm5719-llvm-d5321247c4e2315d7aae3dd4c74da5babe3101a0.zip
Add a -rewrite-includes option, which is similar to -rewrite-macros, but only expands #include directives.
Patch contributed by Lubos Lunak (l.lunax@suse.cz). Review by Matt Beaumont-Gay (matthewbg@google.com). llvm-svn: 158093
Diffstat (limited to 'clang/lib/Rewrite/FrontendActions.cpp')
-rw-r--r--clang/lib/Rewrite/FrontendActions.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/Rewrite/FrontendActions.cpp b/clang/lib/Rewrite/FrontendActions.cpp
index 1753325a26c..fa58575258e 100644
--- a/clang/lib/Rewrite/FrontendActions.cpp
+++ b/clang/lib/Rewrite/FrontendActions.cpp
@@ -181,3 +181,12 @@ void RewriteTestAction::ExecuteAction() {
DoRewriteTest(CI.getPreprocessor(), OS);
}
+
+void RewriteIncludesAction::ExecuteAction() {
+ CompilerInstance &CI = getCompilerInstance();
+ raw_ostream *OS = CI.createDefaultOutputFile(true, getCurrentFile());
+ if (!OS) return;
+
+ RewriteIncludesInInput(CI.getPreprocessor(), OS,
+ CI.getPreprocessorOutputOpts());
+}
OpenPOWER on IntegriCloud