aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/FrontendActions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Frontend/FrontendActions.cpp')
-rw-r--r--lib/Frontend/FrontendActions.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Frontend/FrontendActions.cpp b/lib/Frontend/FrontendActions.cpp
index 7b06c7e49a..342a4c2465 100644
--- a/lib/Frontend/FrontendActions.cpp
+++ b/lib/Frontend/FrontendActions.cpp
@@ -82,9 +82,10 @@ ASTConsumer *GeneratePCHAction::CreateASTConsumer(CompilerInstance &CI,
if (ComputeASTConsumerArguments(CI, InFile, Sysroot, OutputFile, OS, Chaining))
return 0;
- const char *isysroot = CI.getFrontendOpts().RelocatablePCH ?
- Sysroot.c_str() : 0;
- return new PCHGenerator(CI.getPreprocessor(), OutputFile, Chaining, isysroot, OS);
+ if (!CI.getFrontendOpts().RelocatablePCH)
+ Sysroot.clear();
+ return new PCHGenerator(CI.getPreprocessor(), OutputFile, Chaining, Sysroot,
+ OS);
}
bool GeneratePCHAction::ComputeASTConsumerArguments(CompilerInstance &CI,