summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2011-03-18 21:23:40 +0000
committerDaniel Dunbar <daniel@zuster.org>2011-03-18 21:23:40 +0000
commit8c3d7351182b1e1731d8861263fe953d8b541efa (patch)
treed78e85946e7b71ac22a33947ff43f4036a4d6c1a /clang/lib
parent1057f86d0e538bcd619a028171e4a1634227f60d (diff)
downloadbcm5719-llvm-8c3d7351182b1e1731d8861263fe953d8b541efa.tar.gz
bcm5719-llvm-8c3d7351182b1e1731d8861263fe953d8b541efa.zip
Driver: Forward -traditional and -traditional-cpp in preprocessing modes.
- We don't really support the majority of the horrible -traditional-cpp behavior, but it is unlikely that we ever will either. This allows us to start trying to use clang as a /usr/bin/cpp replacement and see what pieces of -traditional-cpp mode people actually care about. llvm-svn: 127911
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Driver/Tools.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp
index ee4976ee72b..1c3112aeca2 100644
--- a/clang/lib/Driver/Tools.cpp
+++ b/clang/lib/Driver/Tools.cpp
@@ -1773,9 +1773,14 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
}
#endif
+ // Only allow -traditional or -traditional-cpp outside in preprocessing modes.
if (Arg *A = Args.getLastArg(options::OPT_traditional,
- options::OPT_traditional_cpp))
- D.Diag(clang::diag::err_drv_clang_unsupported) << A->getAsString(Args);
+ options::OPT_traditional_cpp)) {
+ if (isa<PreprocessJobAction>(JA))
+ CmdArgs.push_back("-traditional-cpp");
+ else
+ D.Diag(clang::diag::err_drv_clang_unsupported) << A->getAsString(Args);
+ }
Args.AddLastArg(CmdArgs, options::OPT_dM);
Args.AddLastArg(CmdArgs, options::OPT_dD);
OpenPOWER on IntegriCloud