diff options
author | Joerg Sonnenberger <joerg@bec.de> | 2012-02-22 19:15:16 +0000 |
---|---|---|
committer | Joerg Sonnenberger <joerg@bec.de> | 2012-02-22 19:15:16 +0000 |
commit | 17d7551e73d9b8c6c713c8afd3a6003592649746 (patch) | |
tree | a8105f291fa6170787176d7e5c7b89f07d22988d /clang/lib/Driver/Driver.cpp | |
parent | 35d14d91c29e1a5d892f55dc514a9b810824f57d (diff) | |
download | bcm5719-llvm-17d7551e73d9b8c6c713c8afd3a6003592649746.tar.gz bcm5719-llvm-17d7551e73d9b8c6c713c8afd3a6003592649746.zip |
Revert part of r148839 and keep DefaultTargetTriple in the form adjusted
by -target and similar options. As discussed in PR 12026, the change
broke support for target-prefixed tools, i.e. calling x86_64--linux-ld
when compiling for x86_64--linux. Improve the test cases added
originally in r149083 to not require execution, just executable files.
Document the hack with appropiate FIXME comments.
llvm-svn: 151185
Diffstat (limited to 'clang/lib/Driver/Driver.cpp')
-rw-r--r-- | clang/lib/Driver/Driver.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index 06953170d72..e71f5a60650 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -310,6 +310,10 @@ Compilation *Driver::BuildCompilation(ArrayRef<const char *> ArgList) { Cur = Split.second; } } + // FIXME: DefaultTargetTriple is used by the target-prefixed calls to as/ld + // and getToolChain is const. + if (const Arg *A = Args->getLastArg(options::OPT_target)) + DefaultTargetTriple = A->getValue(*Args); if (const Arg *A = Args->getLastArg(options::OPT_ccc_install_dir)) Dir = InstalledDir = A->getValue(*Args); for (arg_iterator it = Args->filtered_begin(options::OPT_B), @@ -1513,6 +1517,7 @@ static bool isPathExecutable(llvm::sys::Path &P, bool WantFile) { std::string Driver::GetProgramPath(const char *Name, const ToolChain &TC, bool WantFile) const { + // FIXME: Needs a better variable than DefaultTargetTriple std::string TargetSpecificExecutable(DefaultTargetTriple + "-" + Name); // Respect a limited subset of the '-Bprefix' functionality in GCC by // attempting to use this prefix when lokup up program paths. @@ -1583,6 +1588,7 @@ std::string Driver::GetTemporaryPath(StringRef Prefix, const char *Suffix) static llvm::Triple computeTargetTriple(StringRef DefaultTargetTriple, const ArgList &Args, StringRef DarwinArchName) { + // FIXME: Already done in Compilation *Driver::BuildCompilation if (const Arg *A = Args.getLastArg(options::OPT_target)) DefaultTargetTriple = A->getValue(Args); |