aboutsummaryrefslogtreecommitdiff
path: root/lib/Driver/Driver.cpp
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2012-07-31 01:21:00 +0000
committerAaron Ballman <aaron@aaronballman.com>2012-07-31 01:21:00 +0000
commit761322b3bdea727de087dcdf355fee689f5b8358 (patch)
treecf0b77f4e33b0e926b5ff05218956006b79fb3ed /lib/Driver/Driver.cpp
parentef15831780b705475e7b237ac16418e9b53cb7a6 (diff)
No longer emitting a PCH file when using -fsyntax-only on a header file. Fixes PR13343.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161019 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Driver.cpp')
-rw-r--r--lib/Driver/Driver.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp
index 5be60b8806..671c0acaab 100644
--- a/lib/Driver/Driver.cpp
+++ b/lib/Driver/Driver.cpp
@@ -1210,8 +1210,14 @@ Action *Driver::ConstructPhaseAction(const ArgList &Args, phases::ID Phase,
}
return new PreprocessJobAction(Input, OutputTy);
}
- case phases::Precompile:
- return new PrecompileJobAction(Input, types::TY_PCH);
+ case phases::Precompile: {
+ types::ID OutputTy = types::TY_PCH;
+ if (Args.hasArg(options::OPT_fsyntax_only)) {
+ // Syntax checks should not emit a PCH file
+ OutputTy = types::TY_Nothing;
+ }
+ return new PrecompileJobAction(Input, OutputTy);
+ }
case phases::Compile: {
if (Args.hasArg(options::OPT_fsyntax_only)) {
return new CompileJobAction(Input, types::TY_Nothing);