diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2010-04-15 06:09:03 +0000 |
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2010-04-15 06:09:03 +0000 |
| commit | 76fa840d0990314d1d1c160803ba9d014a6c01a9 (patch) | |
| tree | 34cf44df2a6c9f0a635fc57f3d89fed8933fddaa /clang/lib/Driver | |
| parent | 6ebd8674eb049b254c769ecfe24dd8401eb4142b (diff) | |
| download | bcm5719-llvm-76fa840d0990314d1d1c160803ba9d014a6c01a9.tar.gz bcm5719-llvm-76fa840d0990314d1d1c160803ba9d014a6c01a9.zip | |
Driver/Frontend: Add support for -mllvm, which forwards options to the LLVM option parser.
- Note that this is a behavior change, previously -mllvm at the driver level forwarded to clang -cc1. The driver does a little magic to make sure that '-mllvm -disable-llvm-optzns' works correctly, but other users will need to be updated to use -Xclang.
llvm-svn: 101354
Diffstat (limited to 'clang/lib/Driver')
| -rw-r--r-- | clang/lib/Driver/Tools.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index 77456faa1e2..afcf26fee12 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -1325,8 +1325,18 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, Args.AddLastArg(CmdArgs, options::OPT_dM); Args.AddLastArg(CmdArgs, options::OPT_dD); + // Forward -Xclang arguments to -cc1, and -mllvm arguments to the LLVM option + // parser. Args.AddAllArgValues(CmdArgs, options::OPT_Xclang); - Args.AddAllArgValues(CmdArgs, options::OPT_mllvm); + for (arg_iterator it = Args.filtered_begin(options::OPT_mllvm), + ie = Args.filtered_end(); it != ie; ++it) { + // We translate this by hand to the -cc1 argument, since nightly test uses + // it and developers have been trained to spell it with -mllvm. + if (llvm::StringRef(it->getValue(Args, 0)) == "-disable-llvm-optzns") + CmdArgs.push_back("-disable-llvm-optzns"); + else + it->render(Args, CmdArgs); + } if (Output.getType() == types::TY_Dependencies) { // Handled with other dependency code. |

