summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/Rewrite/FrontendActions.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2018-09-15 01:21:18 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2018-09-15 01:21:18 +0000
commit8b464f299fe0358ed4b82ea269a63155081c73ff (patch)
tree6bd07fdcf89be40c52b3acaea16529a3a28ec5b3 /clang/lib/Frontend/Rewrite/FrontendActions.cpp
parentcd35eff395b4c21b6f0f3e05a7e09665b6caab79 (diff)
downloadbcm5719-llvm-8b464f299fe0358ed4b82ea269a63155081c73ff.tar.gz
bcm5719-llvm-8b464f299fe0358ed4b82ea269a63155081c73ff.zip
[modules] Support use of -E on modules built from the command line.
llvm-svn: 342306
Diffstat (limited to 'clang/lib/Frontend/Rewrite/FrontendActions.cpp')
-rw-r--r--clang/lib/Frontend/Rewrite/FrontendActions.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Frontend/Rewrite/FrontendActions.cpp b/clang/lib/Frontend/Rewrite/FrontendActions.cpp
index fa17b3e7cb3..bcf6d215c99 100644
--- a/clang/lib/Frontend/Rewrite/FrontendActions.cpp
+++ b/clang/lib/Frontend/Rewrite/FrontendActions.cpp
@@ -181,7 +181,7 @@ RewriteObjCAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
void RewriteMacrosAction::ExecuteAction() {
CompilerInstance &CI = getCompilerInstance();
std::unique_ptr<raw_ostream> OS =
- CI.createDefaultOutputFile(true, getCurrentFile());
+ CI.createDefaultOutputFile(true, getCurrentFileOrBufferName());
if (!OS) return;
RewriteMacrosInInput(CI.getPreprocessor(), OS.get());
@@ -190,7 +190,7 @@ void RewriteMacrosAction::ExecuteAction() {
void RewriteTestAction::ExecuteAction() {
CompilerInstance &CI = getCompilerInstance();
std::unique_ptr<raw_ostream> OS =
- CI.createDefaultOutputFile(false, getCurrentFile());
+ CI.createDefaultOutputFile(false, getCurrentFileOrBufferName());
if (!OS) return;
DoRewriteTest(CI.getPreprocessor(), OS.get());
@@ -265,7 +265,8 @@ public:
bool RewriteIncludesAction::BeginSourceFileAction(CompilerInstance &CI) {
if (!OutputStream) {
- OutputStream = CI.createDefaultOutputFile(true, getCurrentFile());
+ OutputStream =
+ CI.createDefaultOutputFile(true, getCurrentFileOrBufferName());
if (!OutputStream)
return false;
}
OpenPOWER on IntegriCloud