diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2011-02-19 05:33:51 +0000 |
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2011-02-19 05:33:51 +0000 |
| commit | 1094bb101b2e298142432319748b3ea60de164f4 (patch) | |
| tree | 6417f8bb86867e2fecfb629ebceccf72f0d3789b /clang/lib/Driver/ToolChains.cpp | |
| parent | 12f146a3efd4342cc01a94d5bb5d9ec4287bce06 (diff) | |
| download | bcm5719-llvm-1094bb101b2e298142432319748b3ea60de164f4.tar.gz bcm5719-llvm-1094bb101b2e298142432319748b3ea60de164f4.zip | |
Driver/Darwin: Support -Wl, with -Xarch_. This doesn't work naturally because of
the special way we model "linker input" arguments.
llvm-svn: 126023
Diffstat (limited to 'clang/lib/Driver/ToolChains.cpp')
| -rw-r--r-- | clang/lib/Driver/ToolChains.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/lib/Driver/ToolChains.cpp b/clang/lib/Driver/ToolChains.cpp index 236a1549eb8..13b8b4609ec 100644 --- a/clang/lib/Driver/ToolChains.cpp +++ b/clang/lib/Driver/ToolChains.cpp @@ -699,6 +699,7 @@ DerivedArgList *Darwin::TranslateArgs(const DerivedArgList &Args, if (getArchName() != A->getValue(Args, 0)) continue; + Arg *OriginalArg = A; unsigned Index = Args.getBaseArgs().MakeIndex(A->getValue(Args, 1)); unsigned Prev = Index; Arg *XarchArg = Opts.ParseOneArg(Args, Index); @@ -722,6 +723,20 @@ DerivedArgList *Darwin::TranslateArgs(const DerivedArgList &Args, A = XarchArg; DAL->AddSynthesizedArg(A); + + // Linker input arguments require custom handling. The problem is that we + // have already constructed the phase actions, so we can not treat them as + // "input arguments". + if (A->getOption().isLinkerInput()) { + // Convert the argument into individual Zlinker_input_args. + for (unsigned i = 0, e = A->getNumValues(); i != e; ++i) { + DAL->AddSeparateArg(OriginalArg, + Opts.getOption(options::OPT_Zlinker_input), + A->getValue(Args, i)); + + } + continue; + } } // Sob. These is strictly gcc compatible for the time being. Apple |

