Forward -C and -CC to clang.

- <rdar://problem/6945384> Driver should pass down -C and -CC

llvm-svn: 73087
This commit is contained in:
Daniel Dunbar 2009-06-08 21:48:20 +00:00
parent f9f689b3ab
commit 367dbb9760
2 changed files with 25 additions and 1 deletions

View File

@ -43,8 +43,17 @@ void Clang::AddPreprocessingOptions(const Driver &D,
ArgStringList &CmdArgs,
const InputInfo &Output,
const InputInfoList &Inputs) const {
// Handle dependency file generation.
Arg *A;
if ((A = Args.getLastArg(options::OPT_C)) ||
(A = Args.getLastArg(options::OPT_CC))) {
if (!Args.hasArg(options::OPT_E))
D.Diag(clang::diag::err_drv_argument_only_allowed_with)
<< A->getAsString(Args) << "-E";
A->render(Args, CmdArgs);
}
// Handle dependency file generation.
if ((A = Args.getLastArg(options::OPT_M)) ||
(A = Args.getLastArg(options::OPT_MM)) ||
(A = Args.getLastArg(options::OPT_MD)) ||

View File

@ -0,0 +1,15 @@
// RUN: clang -E -o %t -C %s &&
// RUN: grep '^int x; // comment' %t &&
// RUN: grep '^x x' %t &&
// RUN: clang -E -o %t -CC %s &&
// RUN: grep '^int x; // comment' %t &&
// RUN: grep '^x /\* comment \*/ x /\* comment \*/' %t &&
// RUN: true
int x; // comment
#define A(foo, bar) foo bar
#define B x // comment
A(B, B)