Driver: Forward -Wp, and -Xpreprocessor arguments to clang when using

the preprocessor.
 - PR3602.

 - As is inherent in the blanket forwarding options, this will only
   work if clang-cc happens to accept what the user passed. Users by
   and large should use driver options to interact with the
   preprocessor, if at all possible.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68144 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Dunbar 2009-03-31 20:53:55 +00:00
Родитель 7dc8664a54
Коммит 077ba6a3ac
1 изменённых файлов: 12 добавлений и 0 удалений

Просмотреть файл

@ -39,6 +39,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
const char *LinkingOutput) const {
ArgStringList CmdArgs;
assert(Inputs.size() == 1 && "Unable to handle multiple inputs.");
CmdArgs.push_back("-triple");
const char *TripleStr =
Args.MakeArgString(getToolChain().getTripleString().c_str());
@ -374,6 +376,16 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
Args.AddLastArg(CmdArgs, options::OPT_dM);
// Add -Wp, and -Xassembler if using the preprocessor.
// FIXME: There is a very unfortunate problem here, some troubled
// souls abuse -Wp, to pass preprocessor options in gcc syntax. To
// really support that we would have to parse and then translate
// those options. :(
if (types::getPreprocessedType(Inputs[0].getType()) != types::TY_INVALID)
Args.AddAllArgValues(CmdArgs, options::OPT_Wp_COMMA,
options::OPT_Xpreprocessor);
Args.AddAllArgValues(CmdArgs, options::OPT_Xclang);
if (Output.getType() == types::TY_Dependencies) {