<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Tue, Jul 19, 2016 at 3:24 PM Vedant Kumar <<a href="mailto:vsk@apple.com">vsk@apple.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
> On Jul 19, 2016, at 3:02 PM, Eric Christopher <<a href="mailto:echristo@gmail.com" target="_blank">echristo@gmail.com</a>> wrote:<br>
><br>
> ... this is pretty crazy. I think that you needed to plumb the effective triple through everything means that it really needs to be owned somewhere else and cached.<br>
><br>
> Can you rethink this? In general it doesn't make sense to have everything need this passed down.<br>
<br>
This came up during review.<br></blockquote><div><br></div><div>I couldn't find a thread anywhere - and there's not one in the phab revision.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I did try to find a suitable place to cache the effective triple, but did not<br>
see one. I still don't, and am open to suggestions / willing to revert for more<br>
review if you'd like.<br>
<br>
Initially I thought it would be possible to cache the triple in the Tool or<br>
ToolChain, but that seems like it could break use-cases in which jobs are<br>
constructed from different threads.<br>
<br></blockquote><div><br></div><div>Where do we do that? As far as I know we don't have a case where this applies and I'd consider all of this infrastructure to be internal for any external tools.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Caching the triple in the Compilation seems like it would have have the same<br>
issue. I'm not sure how much of a problem this is in practice. We could try<br>
setting the effective triple in the Compilation with a RAII wrapper, e.g:<br>
<br>
  {<br>
    RegisterEffectiveTriple TripleRAII(C, EffectiveTriple);<br>
    T->ConstructJob(...);<br>
  } // Effective triple cleared from the Compilation.<br>
<br>
Let me know if you have alternate suggestions, and how you'd like to move<br>
forward.<br>
<br></blockquote><div><br></div><div>Adding Justin here a bit since he's looked at it more recently, but my general case would be to cache in the ToolChain. Anything that has problems with that caching will need to be fixed to deal (either anything depending on ToolChain in clang or external code).</div><div><br></div><div>-eric</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
thanks,<br>
vedant<br>
<br>
<br>
><br>
> Thanks!<br>
><br>
> -eric<br>
><br>
> On Mon, Jul 18, 2016 at 1:04 PM Vedant Kumar via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>> wrote:<br>
> Author: vedantk<br>
> Date: Mon Jul 18 14:56:38 2016<br>
> New Revision: 275895<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=275895&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=275895&view=rev</a><br>
> Log:<br>
> [Driver] Compute effective target triples once per job (NFCI)<br>
><br>
> Compute an effective target triple exactly once in ConstructJob(), and<br>
> then simply pass around references to it. This eliminates wasteful<br>
> re-computation of effective triples (e.g in getARMFloatABI()).<br>
><br>
> Differential Revision: <a href="https://reviews.llvm.org/D22290" rel="noreferrer" target="_blank">https://reviews.llvm.org/D22290</a><br>
><br>
> Modified:<br>
>     cfe/trunk/docs/ReleaseNotes.rst<br>
>     cfe/trunk/include/clang/Driver/SanitizerArgs.h<br>
>     cfe/trunk/include/clang/Driver/Tool.h<br>
>     cfe/trunk/include/clang/Driver/ToolChain.h<br>
>     cfe/trunk/lib/Driver/Driver.cpp<br>
>     cfe/trunk/lib/Driver/SanitizerArgs.cpp<br>
>     cfe/trunk/lib/Driver/ToolChain.cpp<br>
>     cfe/trunk/lib/Driver/ToolChains.cpp<br>
>     cfe/trunk/lib/Driver/ToolChains.h<br>
>     cfe/trunk/lib/Driver/Tools.cpp<br>
>     cfe/trunk/lib/Driver/Tools.h<br>
><br>
> Modified: cfe/trunk/docs/ReleaseNotes.rst<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/ReleaseNotes.rst?rev=275895&r1=275894&r2=275895&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/ReleaseNotes.rst?rev=275895&r1=275894&r2=275895&view=diff</a><br>
> ==============================================================================<br>
> --- cfe/trunk/docs/ReleaseNotes.rst (original)<br>
> +++ cfe/trunk/docs/ReleaseNotes.rst Mon Jul 18 14:56:38 2016<br>
> @@ -121,7 +121,8 @@ These are major API changes that have ha<br>
>  Clang. If upgrading an external codebase that uses Clang as a library,<br>
>  this section should help get you past the largest hurdles of upgrading.<br>
><br>
> --  ...<br>
> +- Classes which inherit from ``driver::Tool`` must be updated to use effective<br>
> +  target triples when constructing jobs.<br>
><br>
>  AST Matchers<br>
>  ------------<br>
><br>
> Modified: cfe/trunk/include/clang/Driver/SanitizerArgs.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/SanitizerArgs.h?rev=275895&r1=275894&r2=275895&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/SanitizerArgs.h?rev=275895&r1=275894&r2=275895&view=diff</a><br>
> ==============================================================================<br>
> --- cfe/trunk/include/clang/Driver/SanitizerArgs.h (original)<br>
> +++ cfe/trunk/include/clang/Driver/SanitizerArgs.h Mon Jul 18 14:56:38 2016<br>
> @@ -16,6 +16,10 @@<br>
>  #include <string><br>
>  #include <vector><br>
><br>
> +namespace llvm {<br>
> +class Triple;<br>
> +}<br>
> +<br>
>  namespace clang {<br>
>  namespace driver {<br>
><br>
> @@ -66,7 +70,8 @@ class SanitizerArgs {<br>
>    bool requiresPIE() const;<br>
>    bool needsUnwindTables() const;<br>
>    bool linkCXXRuntimes() const { return LinkCXXRuntimes; }<br>
> -  void addArgs(const ToolChain &TC, const llvm::opt::ArgList &Args,<br>
> +  void addArgs(const ToolChain &TC, const llvm::Triple &EffectiveTriple,<br>
> +               const llvm::opt::ArgList &Args,<br>
>                 llvm::opt::ArgStringList &CmdArgs, types::ID InputType) const;<br>
>  };<br>
><br>
><br>
> Modified: cfe/trunk/include/clang/Driver/Tool.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Tool.h?rev=275895&r1=275894&r2=275895&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Tool.h?rev=275895&r1=275894&r2=275895&view=diff</a><br>
> ==============================================================================<br>
> --- cfe/trunk/include/clang/Driver/Tool.h (original)<br>
> +++ cfe/trunk/include/clang/Driver/Tool.h Mon Jul 18 14:56:38 2016<br>
> @@ -14,6 +14,7 @@<br>
>  #include "llvm/Support/Program.h"<br>
><br>
>  namespace llvm {<br>
> +class Triple;<br>
>  namespace opt {<br>
>    class ArgList;<br>
>  }<br>
> @@ -127,6 +128,7 @@ public:<br>
>    virtual void ConstructJob(Compilation &C, const JobAction &JA,<br>
>                              const InputInfo &Output,<br>
>                              const InputInfoList &Inputs,<br>
> +                            const llvm::Triple &EffectiveTriple,<br>
>                              const llvm::opt::ArgList &TCArgs,<br>
>                              const char *LinkingOutput) const = 0;<br>
>  };<br>
><br>
> Modified: cfe/trunk/include/clang/Driver/ToolChain.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/ToolChain.h?rev=275895&r1=275894&r2=275895&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/ToolChain.h?rev=275895&r1=275894&r2=275895&view=diff</a><br>
> ==============================================================================<br>
> --- cfe/trunk/include/clang/Driver/ToolChain.h (original)<br>
> +++ cfe/trunk/include/clang/Driver/ToolChain.h Mon Jul 18 14:56:38 2016<br>
> @@ -260,11 +260,13 @@ public:<br>
>      return ToolChain::CST_Libstdcxx;<br>
>    }<br>
><br>
> -  virtual std::string getCompilerRT(const llvm::opt::ArgList &Args,<br>
> +  virtual std::string getCompilerRT(const llvm::Triple &EffectiveTriple,<br>
> +                                    const llvm::opt::ArgList &Args,<br>
>                                      StringRef Component,<br>
>                                      bool Shared = false) const;<br>
><br>
> -  const char *getCompilerRTArgString(const llvm::opt::ArgList &Args,<br>
> +  const char *getCompilerRTArgString(const llvm::Triple &EffectiveTriple,<br>
> +                                     const llvm::opt::ArgList &Args,<br>
>                                       StringRef Component,<br>
>                                       bool Shared = false) const;<br>
>    /// needsProfileRT - returns true if instrumentation profile is on.<br>
> @@ -410,7 +412,8 @@ public:<br>
>        const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs) const;<br>
>    /// addProfileRTLibs - When -fprofile-instr-profile is specified, try to pass<br>
>    /// a suitable profile runtime library to the linker.<br>
> -  virtual void addProfileRTLibs(const llvm::opt::ArgList &Args,<br>
> +  virtual void addProfileRTLibs(const llvm::Triple &EffectiveTriple,<br>
> +                                const llvm::opt::ArgList &Args,<br>
>                                  llvm::opt::ArgStringList &CmdArgs) const;<br>
><br>
>    /// \brief Add arguments to use system-specific CUDA includes.<br>
><br>
> Modified: cfe/trunk/lib/Driver/Driver.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=275895&r1=275894&r2=275895&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=275895&r1=275894&r2=275895&view=diff</a><br>
> ==============================================================================<br>
> --- cfe/trunk/lib/Driver/Driver.cpp (original)<br>
> +++ cfe/trunk/lib/Driver/Driver.cpp Mon Jul 18 14:56:38 2016<br>
> @@ -2256,7 +2256,21 @@ InputInfo Driver::BuildJobsForActionNoCa<br>
>                                               TC->getTriple().normalize()),<br>
>                         BaseInput);<br>
><br>
> +  llvm::Triple EffectiveTriple;<br>
> +  const ArgList &Args = C.getArgsForToolChain(TC, BoundArch);<br>
> +  if (InputInfos.size() != 1) {<br>
> +    EffectiveTriple = llvm::Triple(<br>
> +        T->getToolChain().ComputeEffectiveClangTriple(Args));<br>
> +  } else {<br>
> +    // Pass along the input type if it can be unambiguously determined.<br>
> +    EffectiveTriple =<br>
> +        llvm::Triple(T->getToolChain().ComputeEffectiveClangTriple(<br>
> +            Args, InputInfos[0].getType()));<br>
> +  }<br>
> +<br>
>    if (CCCPrintBindings && !CCGenDiagnostics) {<br>
> +    // FIXME: We should be able to use the effective triple here, but doing so<br>
> +    // breaks some multi-arch tests.<br>
>      llvm::errs() << "# \"" << T->getToolChain().getTripleString() << '"'<br>
>                   << " - \"" << T->getName() << "\", inputs: [";<br>
>      for (unsigned i = 0, e = InputInfos.size(); i != e; ++i) {<br>
> @@ -2266,7 +2280,7 @@ InputInfo Driver::BuildJobsForActionNoCa<br>
>      }<br>
>      llvm::errs() << "], output: " << Result.getAsString() << "\n";<br>
>    } else {<br>
> -    T->ConstructJob(C, *JA, Result, InputInfos,<br>
> +    T->ConstructJob(C, *JA, Result, InputInfos, EffectiveTriple,<br>
>                      C.getArgsForToolChain(TC, BoundArch), LinkingOutput);<br>
>    }<br>
>    return Result;<br>
><br>
> Modified: cfe/trunk/lib/Driver/SanitizerArgs.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/SanitizerArgs.cpp?rev=275895&r1=275894&r2=275895&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/SanitizerArgs.cpp?rev=275895&r1=275894&r2=275895&view=diff</a><br>
> ==============================================================================<br>
> --- cfe/trunk/lib/Driver/SanitizerArgs.cpp (original)<br>
> +++ cfe/trunk/lib/Driver/SanitizerArgs.cpp Mon Jul 18 14:56:38 2016<br>
> @@ -602,7 +602,9 @@ static void addIncludeLinkerOption(const<br>
>    CmdArgs.push_back(Args.MakeArgString(LinkerOptionFlag));<br>
>  }<br>
><br>
> -void SanitizerArgs::addArgs(const ToolChain &TC, const llvm::opt::ArgList &Args,<br>
> +void SanitizerArgs::addArgs(const ToolChain &TC,<br>
> +                            const llvm::Triple &EffectiveTriple,<br>
> +                            const llvm::opt::ArgList &Args,<br>
>                              llvm::opt::ArgStringList &CmdArgs,<br>
>                              types::ID InputType) const {<br>
>    // Translate available CoverageFeatures to corresponding clang-cc1 flags.<br>
> @@ -626,21 +628,24 @@ void SanitizerArgs::addArgs(const ToolCh<br>
>      // Instruct the code generator to embed linker directives in the object file<br>
>      // that cause the required runtime libraries to be linked.<br>
>      CmdArgs.push_back(Args.MakeArgString(<br>
> -        "--dependent-lib=" + TC.getCompilerRT(Args, "ubsan_standalone")));<br>
> +        "--dependent-lib=" +<br>
> +        TC.getCompilerRT(EffectiveTriple, Args, "ubsan_standalone")));<br>
>      if (types::isCXX(InputType))<br>
>        CmdArgs.push_back(Args.MakeArgString(<br>
> -          "--dependent-lib=" + TC.getCompilerRT(Args, "ubsan_standalone_cxx")));<br>
> +          "--dependent-lib=" +<br>
> +          TC.getCompilerRT(EffectiveTriple, Args, "ubsan_standalone_cxx")));<br>
>    }<br>
>    if (TC.getTriple().isOSWindows() && needsStatsRt()) {<br>
> -    CmdArgs.push_back(Args.MakeArgString("--dependent-lib=" +<br>
> -                                         TC.getCompilerRT(Args, "stats_client")));<br>
> +    CmdArgs.push_back(Args.MakeArgString(<br>
> +        "--dependent-lib=" +<br>
> +        TC.getCompilerRT(EffectiveTriple, Args, "stats_client")));<br>
><br>
>      // The main executable must export the stats runtime.<br>
>      // FIXME: Only exporting from the main executable (e.g. based on whether the<br>
>      // translation unit defines main()) would save a little space, but having<br>
>      // multiple copies of the runtime shouldn't hurt.<br>
> -    CmdArgs.push_back(Args.MakeArgString("--dependent-lib=" +<br>
> -                                         TC.getCompilerRT(Args, "stats")));<br>
> +    CmdArgs.push_back(Args.MakeArgString(<br>
> +        "--dependent-lib=" + TC.getCompilerRT(EffectiveTriple, Args, "stats")));<br>
>      addIncludeLinkerOption(TC, Args, CmdArgs, "__sanitizer_stats_register");<br>
>    }<br>
><br>
><br>
> Modified: cfe/trunk/lib/Driver/ToolChain.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChain.cpp?rev=275895&r1=275894&r2=275895&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChain.cpp?rev=275895&r1=275894&r2=275895&view=diff</a><br>
> ==============================================================================<br>
> --- cfe/trunk/lib/Driver/ToolChain.cpp (original)<br>
> +++ cfe/trunk/lib/Driver/ToolChain.cpp Mon Jul 18 14:56:38 2016<br>
> @@ -267,46 +267,52 @@ Tool *ToolChain::getTool(Action::ActionC<br>
>    llvm_unreachable("Invalid tool kind.");<br>
>  }<br>
><br>
> -static StringRef getArchNameForCompilerRTLib(const ToolChain &TC,<br>
> -                                             const ArgList &Args) {<br>
> -  const llvm::Triple &Triple = TC.getTriple();<br>
> -  bool IsWindows = Triple.isOSWindows();<br>
> +static StringRef<br>
> +getArchNameForCompilerRTLib(const ToolChain &TC,<br>
> +                            const llvm::Triple &EffectiveTriple,<br>
> +                            const ArgList &Args) {<br>
> +  bool IsWindows = EffectiveTriple.isOSWindows();<br>
><br>
> -  if (Triple.isWindowsMSVCEnvironment() && TC.getArch() == llvm::Triple::x86)<br>
> +  if (EffectiveTriple.isWindowsMSVCEnvironment() &&<br>
> +      TC.getArch() == llvm::Triple::x86)<br>
>      return "i386";<br>
><br>
>    if (TC.getArch() == llvm::Triple::arm || TC.getArch() == llvm::Triple::armeb)<br>
> -    return (arm::getARMFloatABI(TC, Args) == arm::FloatABI::Hard && !IsWindows)<br>
> +    return (arm::getARMFloatABI(TC, EffectiveTriple, Args) ==<br>
> +                arm::FloatABI::Hard &&<br>
> +            !IsWindows)<br>
>                 ? "armhf"<br>
>                 : "arm";<br>
><br>
>    return TC.getArchName();<br>
>  }<br>
><br>
> -std::string ToolChain::getCompilerRT(const ArgList &Args, StringRef Component,<br>
> +std::string ToolChain::getCompilerRT(const llvm::Triple &EffectiveTriple,<br>
> +                                     const ArgList &Args, StringRef Component,<br>
>                                       bool Shared) const {<br>
> -  const llvm::Triple &TT = getTriple();<br>
> -  const char *Env = TT.isAndroid() ? "-android" : "";<br>
> -  bool IsITANMSVCWindows =<br>
> -      TT.isWindowsMSVCEnvironment() || TT.isWindowsItaniumEnvironment();<br>
> +  const char *Env = EffectiveTriple.isAndroid() ? "-android" : "";<br>
> +  bool IsITANMSVCWindows = EffectiveTriple.isWindowsMSVCEnvironment() ||<br>
> +                           EffectiveTriple.isWindowsItaniumEnvironment();<br>
><br>
> -  StringRef Arch = getArchNameForCompilerRTLib(*this, Args);<br>
> +  StringRef Arch = getArchNameForCompilerRTLib(*this, EffectiveTriple, Args);<br>
>    const char *Prefix = IsITANMSVCWindows ? "" : "lib";<br>
> -  const char *Suffix = Shared ? (Triple.isOSWindows() ? ".dll" : ".so")<br>
> +  const char *Suffix = Shared ? (EffectiveTriple.isOSWindows() ? ".dll" : ".so")<br>
>                                : (IsITANMSVCWindows ? ".lib" : ".a");<br>
><br>
>    SmallString<128> Path(getDriver().ResourceDir);<br>
> -  StringRef OSLibName = Triple.isOSFreeBSD() ? "freebsd" : getOS();<br>
> +  StringRef OSLibName = EffectiveTriple.isOSFreeBSD() ? "freebsd" : getOS();<br>
>    llvm::sys::path::append(Path, "lib", OSLibName);<br>
>    llvm::sys::path::append(Path, Prefix + Twine("clang_rt.") + Component + "-" +<br>
>                                      Arch + Env + Suffix);<br>
>    return Path.str();<br>
>  }<br>
><br>
> -const char *ToolChain::getCompilerRTArgString(const llvm::opt::ArgList &Args,<br>
> -                                              StringRef Component,<br>
> -                                              bool Shared) const {<br>
> -  return Args.MakeArgString(getCompilerRT(Args, Component, Shared));<br>
> +const char *<br>
> +ToolChain::getCompilerRTArgString(const llvm::Triple &EffectiveTriple,<br>
> +                                  const llvm::opt::ArgList &Args,<br>
> +                                  StringRef Component, bool Shared) const {<br>
> +  return Args.MakeArgString(<br>
> +      getCompilerRT(EffectiveTriple, Args, Component, Shared));<br>
>  }<br>
><br>
>  bool ToolChain::needsProfileRT(const ArgList &Args) {<br>
> @@ -517,11 +523,13 @@ void ToolChain::addClangTargetOptions(co<br>
><br>
>  void ToolChain::addClangWarningOptions(ArgStringList &CC1Args) const {}<br>
><br>
> -void ToolChain::addProfileRTLibs(const llvm::opt::ArgList &Args,<br>
> +void ToolChain::addProfileRTLibs(const llvm::Triple &EffectiveTriple,<br>
> +                                 const llvm::opt::ArgList &Args,<br>
>                                   llvm::opt::ArgStringList &CmdArgs) const {<br>
> -  if (!needsProfileRT(Args)) return;<br>
> +  if (!needsProfileRT(Args))<br>
> +    return;<br>
><br>
> -  CmdArgs.push_back(getCompilerRTArgString(Args, "profile"));<br>
> +  CmdArgs.push_back(getCompilerRTArgString(EffectiveTriple, Args, "profile"));<br>
>  }<br>
><br>
>  ToolChain::RuntimeLibType ToolChain::GetRuntimeLibType(<br>
><br>
> Modified: cfe/trunk/lib/Driver/ToolChains.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=275895&r1=275894&r2=275895&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=275895&r1=275894&r2=275895&view=diff</a><br>
> ==============================================================================<br>
> --- cfe/trunk/lib/Driver/ToolChains.cpp (original)<br>
> +++ cfe/trunk/lib/Driver/ToolChains.cpp Mon Jul 18 14:56:38 2016<br>
> @@ -380,13 +380,16 @@ StringRef Darwin::getOSLibraryNameSuffix<br>
>    llvm_unreachable("Unsupported platform");<br>
>  }<br>
><br>
> -void Darwin::addProfileRTLibs(const ArgList &Args,<br>
> +void Darwin::addProfileRTLibs(const llvm::Triple &EffectiveTriple,<br>
> +                              const ArgList &Args,<br>
>                                ArgStringList &CmdArgs) const {<br>
> -  if (!needsProfileRT(Args)) return;<br>
> +  if (!needsProfileRT(Args))<br>
> +    return;<br>
><br>
> -  AddLinkRuntimeLib(Args, CmdArgs, (Twine("libclang_rt.profile_") +<br>
> -       getOSLibraryNameSuffix() + ".a").str(),<br>
> -                    /*AlwaysLink*/ true);<br>
> +  AddLinkRuntimeLib(<br>
> +      Args, CmdArgs,<br>
> +      (Twine("libclang_rt.profile_") + getOSLibraryNameSuffix() + ".a").str(),<br>
> +      /*AlwaysLink*/ true);<br>
>  }<br>
><br>
>  void DarwinClang::AddLinkSanitizerLibArgs(const ArgList &Args,<br>
> @@ -400,7 +403,8 @@ void DarwinClang::AddLinkSanitizerLibArg<br>
>        /*AddRPath*/ true);<br>
>  }<br>
><br>
> -void DarwinClang::AddLinkRuntimeLibArgs(const ArgList &Args,<br>
> +void DarwinClang::AddLinkRuntimeLibArgs(const llvm::Triple &EffectiveTriple,<br>
> +                                        const ArgList &Args,<br>
>                                          ArgStringList &CmdArgs) const {<br>
>    // Darwin only supports the compiler-rt based runtime libraries.<br>
>    switch (GetRuntimeLibType(Args)) {<br>
> @@ -1012,16 +1016,17 @@ DerivedArgList *MachO::TranslateArgs(con<br>
>    return DAL;<br>
>  }<br>
><br>
> -void MachO::AddLinkRuntimeLibArgs(const ArgList &Args,<br>
> +void MachO::AddLinkRuntimeLibArgs(const llvm::Triple &EffectiveTriple,<br>
> +                                  const ArgList &Args,<br>
>                                    ArgStringList &CmdArgs) const {<br>
>    // Embedded targets are simple at the moment, not supporting sanitizers and<br>
>    // with different libraries for each member of the product { static, PIC } x<br>
>    // { hard-float, soft-float }<br>
>    llvm::SmallString<32> CompilerRT = StringRef("libclang_rt.");<br>
> -  CompilerRT +=<br>
> -      (tools::arm::getARMFloatABI(*this, Args) == tools::arm::FloatABI::Hard)<br>
> -          ? "hard"<br>
> -          : "soft";<br>
> +  CompilerRT += (tools::arm::getARMFloatABI(*this, EffectiveTriple, Args) ==<br>
> +                 tools::arm::FloatABI::Hard)<br>
> +                    ? "hard"<br>
> +                    : "soft";<br>
>    CompilerRT += Args.hasArg(options::OPT_fPIC) ? "_pic.a" : "_static.a";<br>
><br>
>    AddLinkRuntimeLib(Args, CmdArgs, CompilerRT, false, true);<br>
> @@ -2858,9 +2863,10 @@ void MipsLLVMToolChain::AddCXXStdlibLibA<br>
>    CmdArgs.push_back("-lunwind");<br>
>  }<br>
><br>
> -std::string MipsLLVMToolChain::getCompilerRT(const ArgList &Args,<br>
> -                                             StringRef Component,<br>
> -                                             bool Shared) const {<br>
> +std::string<br>
> +MipsLLVMToolChain::getCompilerRT(const llvm::Triple &EffectiveTriple,<br>
> +                                 const ArgList &Args, StringRef Component,<br>
> +                                 bool Shared) const {<br>
>    SmallString<128> Path(getDriver().ResourceDir);<br>
>    llvm::sys::path::append(Path, SelectedMultilib.osSuffix(), "lib" + LibSuffix,<br>
>                            getOS());<br>
> @@ -4237,9 +4243,9 @@ std::string Linux::getDynamicLinker(cons<br>
>    case llvm::Triple::thumb:<br>
>    case llvm::Triple::armeb:<br>
>    case llvm::Triple::thumbeb: {<br>
> -    const bool HF =<br>
> -        Triple.getEnvironment() == llvm::Triple::GNUEABIHF ||<br>
> -        tools::arm::getARMFloatABI(*this, Args) == tools::arm::FloatABI::Hard;<br>
> +    const bool HF = Triple.getEnvironment() == llvm::Triple::GNUEABIHF ||<br>
> +                    tools::arm::getARMFloatABI(*this, Triple, Args) ==<br>
> +                        tools::arm::FloatABI::Hard;<br>
><br>
>      LibDir = "lib";<br>
>      Loader = HF ? "ld-linux-armhf.so.3" : "ld-linux.so.3";<br>
> @@ -4631,16 +4637,18 @@ SanitizerMask Linux::getSupportedSanitiz<br>
>    return Res;<br>
>  }<br>
><br>
> -void Linux::addProfileRTLibs(const llvm::opt::ArgList &Args,<br>
> +void Linux::addProfileRTLibs(const llvm::Triple &EffectiveTriple,<br>
> +                             const llvm::opt::ArgList &Args,<br>
>                               llvm::opt::ArgStringList &CmdArgs) const {<br>
> -  if (!needsProfileRT(Args)) return;<br>
> +  if (!needsProfileRT(Args))<br>
> +    return;<br>
><br>
>    // Add linker option -u__llvm_runtime_variable to cause runtime<br>
>    // initialization module to be linked in.<br>
>    if (!Args.hasArg(options::OPT_coverage))<br>
>      CmdArgs.push_back(Args.MakeArgString(<br>
>          Twine("-u", llvm::getInstrProfRuntimeHookVarName())));<br>
> -  ToolChain::addProfileRTLibs(Args, CmdArgs);<br>
> +  ToolChain::addProfileRTLibs(EffectiveTriple, Args, CmdArgs);<br>
>  }<br>
><br>
>  /// DragonFly - DragonFly tool chain which can call as(1) and ld(1) directly.<br>
><br>
> Modified: cfe/trunk/lib/Driver/ToolChains.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.h?rev=275895&r1=275894&r2=275895&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.h?rev=275895&r1=275894&r2=275895&view=diff</a><br>
> ==============================================================================<br>
> --- cfe/trunk/lib/Driver/ToolChains.h (original)<br>
> +++ cfe/trunk/lib/Driver/ToolChains.h Mon Jul 18 14:56:38 2016<br>
> @@ -279,7 +279,8 @@ public:<br>
>                                llvm::opt::ArgStringList &CmdArgs) const {}<br>
><br>
>    /// Add the linker arguments to link the compiler runtime library.<br>
> -  virtual void AddLinkRuntimeLibArgs(const llvm::opt::ArgList &Args,<br>
> +  virtual void AddLinkRuntimeLibArgs(const llvm::Triple &EffectiveTriple,<br>
> +                                     const llvm::opt::ArgList &Args,<br>
>                                       llvm::opt::ArgStringList &CmdArgs) const;<br>
><br>
>    virtual void addStartObjectFileArgs(const llvm::opt::ArgList &Args,<br>
> @@ -303,7 +304,8 @@ public:<br>
><br>
>    /// Add any profiling runtime libraries that are needed. This is essentially a<br>
>    /// MachO specific version of addProfileRT in Tools.cpp.<br>
> -  void addProfileRTLibs(const llvm::opt::ArgList &Args,<br>
> +  void addProfileRTLibs(const llvm::Triple &EffectiveTriple,<br>
> +                        const llvm::opt::ArgList &Args,<br>
>                          llvm::opt::ArgStringList &CmdArgs) const override {<br>
>      // There aren't any profiling libs for embedded targets currently.<br>
>    }<br>
> @@ -417,7 +419,8 @@ public:<br>
>              !isTargetWatchOS());<br>
>    }<br>
><br>
> -  void addProfileRTLibs(const llvm::opt::ArgList &Args,<br>
> +  void addProfileRTLibs(const llvm::Triple &EffectiveTriple,<br>
> +                        const llvm::opt::ArgList &Args,<br>
>                          llvm::opt::ArgStringList &CmdArgs) const override;<br>
><br>
>  protected:<br>
> @@ -572,7 +575,8 @@ public:<br>
>    /// @name Apple ToolChain Implementation<br>
>    /// {<br>
><br>
> -  void AddLinkRuntimeLibArgs(const llvm::opt::ArgList &Args,<br>
> +  void AddLinkRuntimeLibArgs(const llvm::Triple &EffectiveTriple,<br>
> +                             const llvm::opt::ArgList &Args,<br>
>                               llvm::opt::ArgStringList &CmdArgs) const override;<br>
><br>
>    void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,<br>
> @@ -838,7 +842,8 @@ public:<br>
>                             llvm::opt::ArgStringList &CC1Args) const override;<br>
>    bool isPIEDefault() const override;<br>
>    SanitizerMask getSupportedSanitizers() const override;<br>
> -  void addProfileRTLibs(const llvm::opt::ArgList &Args,<br>
> +  void addProfileRTLibs(const llvm::Triple &EffectiveTriple,<br>
> +                        const llvm::opt::ArgList &Args,<br>
>                          llvm::opt::ArgStringList &CmdArgs) const override;<br>
>    virtual std::string computeSysRoot() const;<br>
><br>
> @@ -902,7 +907,8 @@ public:<br>
>    void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,<br>
>                             llvm::opt::ArgStringList &CmdArgs) const override;<br>
><br>
> -  std::string getCompilerRT(const llvm::opt::ArgList &Args, StringRef Component,<br>
> +  std::string getCompilerRT(const llvm::Triple &EffectiveTriple,<br>
> +                            const llvm::opt::ArgList &Args, StringRef Component,<br>
>                              bool Shared = false) const override;<br>
><br>
>    std::string computeSysRoot() const override;<br>
><br>
> Modified: cfe/trunk/lib/Driver/Tools.cpp<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=275895&r1=275894&r2=275895&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=275895&r1=275894&r2=275895&view=diff</a><br>
> ==============================================================================<br>
> --- cfe/trunk/lib/Driver/Tools.cpp (original)<br>
> +++ cfe/trunk/lib/Driver/Tools.cpp Mon Jul 18 14:56:38 2016<br>
> @@ -771,10 +771,11 @@ static bool useAAPCSForMachO(const llvm:<br>
><br>
>  // Select the float ABI as determined by -msoft-float, -mhard-float, and<br>
>  // -mfloat-abi=.<br>
> -arm::FloatABI arm::getARMFloatABI(const ToolChain &TC, const ArgList &Args) {<br>
> +arm::FloatABI arm::getARMFloatABI(const ToolChain &TC,<br>
> +                                  const llvm::Triple &EffectiveTriple,<br>
> +                                  const ArgList &Args) {<br>
>    const Driver &D = TC.getDriver();<br>
> -  const llvm::Triple Triple(TC.ComputeEffectiveClangTriple(Args));<br>
> -  auto SubArch = getARMSubArchVersionNumber(Triple);<br>
> +  auto SubArch = getARMSubArchVersionNumber(EffectiveTriple);<br>
>    arm::FloatABI ABI = FloatABI::Invalid;<br>
>    if (Arg *A =<br>
>            Args.getLastArg(options::OPT_msoft_float, options::OPT_mhard_float,<br>
> @@ -797,23 +798,23 @@ arm::FloatABI arm::getARMFloatABI(const<br>
><br>
>      // It is incorrect to select hard float ABI on MachO platforms if the ABI is<br>
>      // "apcs-gnu".<br>
> -    if (Triple.isOSBinFormatMachO() && !useAAPCSForMachO(Triple) &&<br>
> -        ABI == FloatABI::Hard) {<br>
> -      D.Diag(diag::err_drv_unsupported_opt_for_target) << A->getAsString(Args)<br>
> -                                                       << Triple.getArchName();<br>
> +    if (EffectiveTriple.isOSBinFormatMachO() &&<br>
> +        !useAAPCSForMachO(EffectiveTriple) && ABI == FloatABI::Hard) {<br>
> +      D.Diag(diag::err_drv_unsupported_opt_for_target)<br>
> +          << A->getAsString(Args) << EffectiveTriple.getArchName();<br>
>      }<br>
>    }<br>
><br>
>    // If unspecified, choose the default based on the platform.<br>
>    if (ABI == FloatABI::Invalid) {<br>
> -    switch (Triple.getOS()) {<br>
> +    switch (EffectiveTriple.getOS()) {<br>
>      case llvm::Triple::Darwin:<br>
>      case llvm::Triple::MacOSX:<br>
>      case llvm::Triple::IOS:<br>
>      case llvm::Triple::TvOS: {<br>
>        // Darwin defaults to "softfp" for v6 and v7.<br>
>        ABI = (SubArch == 6 || SubArch == 7) ? FloatABI::SoftFP : FloatABI::Soft;<br>
> -      ABI = Triple.isWatchABI() ? FloatABI::Hard : ABI;<br>
> +      ABI = EffectiveTriple.isWatchABI() ? FloatABI::Hard : ABI;<br>
>        break;<br>
>      }<br>
>      case llvm::Triple::WatchOS:<br>
> @@ -826,7 +827,7 @@ arm::FloatABI arm::getARMFloatABI(const<br>
>        break;<br>
><br>
>      case llvm::Triple::FreeBSD:<br>
> -      switch (Triple.getEnvironment()) {<br>
> +      switch (EffectiveTriple.getEnvironment()) {<br>
>        case llvm::Triple::GNUEABIHF:<br>
>          ABI = FloatABI::Hard;<br>
>          break;<br>
> @@ -838,7 +839,7 @@ arm::FloatABI arm::getARMFloatABI(const<br>
>        break;<br>
><br>
>      default:<br>
> -      switch (Triple.getEnvironment()) {<br>
> +      switch (EffectiveTriple.getEnvironment()) {<br>
>        case llvm::Triple::GNUEABIHF:<br>
>        case llvm::Triple::MuslEABIHF:<br>
>        case llvm::Triple::EABIHF:<br>
> @@ -855,14 +856,14 @@ arm::FloatABI arm::getARMFloatABI(const<br>
>          break;<br>
>        default:<br>
>          // Assume "soft", but warn the user we are guessing.<br>
> -        if (Triple.isOSBinFormatMachO() &&<br>
> -            Triple.getSubArch() == llvm::Triple::ARMSubArch_v7em)<br>
> +        if (EffectiveTriple.isOSBinFormatMachO() &&<br>
> +            EffectiveTriple.getSubArch() == llvm::Triple::ARMSubArch_v7em)<br>
>            ABI = FloatABI::Hard;<br>
>          else<br>
>            ABI = FloatABI::Soft;<br>
><br>
> -        if (Triple.getOS() != llvm::Triple::UnknownOS ||<br>
> -            !Triple.isOSBinFormatMachO())<br>
> +        if (EffectiveTriple.getOS() != llvm::Triple::UnknownOS ||<br>
> +            !EffectiveTriple.isOSBinFormatMachO())<br>
>            D.Diag(diag::warn_drv_assuming_mfloat_abi_is) << "soft";<br>
>          break;<br>
>        }<br>
> @@ -882,7 +883,7 @@ static void getARMTargetFeatures(const T<br>
><br>
>    bool KernelOrKext =<br>
>        Args.hasArg(options::OPT_mkernel, options::OPT_fapple_kext);<br>
> -  arm::FloatABI ABI = arm::getARMFloatABI(TC, Args);<br>
> +  arm::FloatABI ABI = arm::getARMFloatABI(TC, Triple, Args);<br>
>    const Arg *WaCPU = nullptr, *WaFPU = nullptr;<br>
>    const Arg *WaHDiv = nullptr, *WaArch = nullptr;<br>
><br>
> @@ -1011,7 +1012,7 @@ static void getARMTargetFeatures(const T<br>
>        Features.push_back("+long-calls");<br>
>    } else if (KernelOrKext && (!Triple.isiOS() || Triple.isOSVersionLT(6)) &&<br>
>               !Triple.isWatchOS()) {<br>
> -      Features.push_back("+long-calls");<br>
> +    Features.push_back("+long-calls");<br>
>    }<br>
><br>
>    // Kernel code has more strict alignment requirements.<br>
> @@ -1025,7 +1026,8 @@ static void getARMTargetFeatures(const T<br>
>          D.Diag(diag::err_target_unsupported_unaligned) << "v6m";<br>
>        // v8M Baseline follows on from v6M, so doesn't support unaligned memory<br>
>        // access either.<br>
> -      else if (Triple.getSubArch() == llvm::Triple::SubArchType::ARMSubArch_v8m_baseline)<br>
> +      else if (Triple.getSubArch() ==<br>
> +               llvm::Triple::SubArchType::ARMSubArch_v8m_baseline)<br>
>          D.Diag(diag::err_target_unsupported_unaligned) << "v8m.base";<br>
>      } else<br>
>        Features.push_back("+strict-align");<br>
> @@ -1111,7 +1113,7 @@ void Clang::AddARMTargetArgs(const llvm:<br>
>    CmdArgs.push_back(ABIName);<br>
><br>
>    // Determine floating point ABI from the options & target defaults.<br>
> -  arm::FloatABI ABI = arm::getARMFloatABI(getToolChain(), Args);<br>
> +  arm::FloatABI ABI = arm::getARMFloatABI(getToolChain(), Triple, Args);<br>
>    if (ABI == arm::FloatABI::Soft) {<br>
>      // Floating point operations and argument passing are soft.<br>
>      // FIXME: This changes CPP defines, we need -target-soft-float.<br>
> @@ -1172,11 +1174,9 @@ static std::string getAArch64TargetCPU(c<br>
>    return "generic";<br>
>  }<br>
><br>
> -void Clang::AddAArch64TargetArgs(const ArgList &Args,<br>
> +void Clang::AddAArch64TargetArgs(const llvm::Triple &EffectiveTriple,<br>
> +                                 const ArgList &Args,<br>
>                                   ArgStringList &CmdArgs) const {<br>
> -  std::string TripleStr = getToolChain().ComputeEffectiveClangTriple(Args);<br>
> -  llvm::Triple Triple(TripleStr);<br>
> -<br>
>    if (!Args.hasFlag(options::OPT_mred_zone, options::OPT_mno_red_zone, true) ||<br>
>        Args.hasArg(options::OPT_mkernel) ||<br>
>        Args.hasArg(options::OPT_fapple_kext))<br>
> @@ -1189,7 +1189,7 @@ void Clang::AddAArch64TargetArgs(const A<br>
>    const char *ABIName = nullptr;<br>
>    if (Arg *A = Args.getLastArg(options::OPT_mabi_EQ))<br>
>      ABIName = A->getValue();<br>
> -  else if (Triple.isOSDarwin())<br>
> +  else if (EffectiveTriple.isOSDarwin())<br>
>      ABIName = "darwinpcs";<br>
>    else<br>
>      ABIName = "aapcs";<br>
> @@ -1204,7 +1204,7 @@ void Clang::AddAArch64TargetArgs(const A<br>
>        CmdArgs.push_back("-aarch64-fix-cortex-a53-835769=1");<br>
>      else<br>
>        CmdArgs.push_back("-aarch64-fix-cortex-a53-835769=0");<br>
> -  } else if (Triple.isAndroid()) {<br>
> +  } else if (EffectiveTriple.isAndroid()) {<br>
>      // Enabled A53 errata (835769) workaround by default on android<br>
>      CmdArgs.push_back("-backend-option");<br>
>      CmdArgs.push_back("-aarch64-fix-cortex-a53-835769=1");<br>
> @@ -2999,9 +2999,10 @@ static void CollectArgsForIntegratedAsse<br>
>  // This adds the static libclang_rt.builtins-arch.a directly to the command line<br>
>  // FIXME: Make sure we can also emit shared objects if they're requested<br>
>  // and available, check for possible errors, etc.<br>
> -static void addClangRT(const ToolChain &TC, const ArgList &Args,<br>
> -                       ArgStringList &CmdArgs) {<br>
> -  CmdArgs.push_back(TC.getCompilerRTArgString(Args, "builtins"));<br>
> +static void addClangRT(const ToolChain &TC, const llvm::Triple &EffectiveTriple,<br>
> +                       const ArgList &Args, ArgStringList &CmdArgs) {<br>
> +  CmdArgs.push_back(<br>
> +      TC.getCompilerRTArgString(EffectiveTriple, Args, "builtins"));<br>
>  }<br>
><br>
>  namespace {<br>
> @@ -3075,22 +3076,27 @@ static void addOpenMPRuntime(ArgStringLi<br>
>    }<br>
>  }<br>
><br>
> -static void addSanitizerRuntime(const ToolChain &TC, const ArgList &Args,<br>
> -                                ArgStringList &CmdArgs, StringRef Sanitizer,<br>
> -                                bool IsShared, bool IsWhole) {<br>
> +static void addSanitizerRuntime(const ToolChain &TC,<br>
> +                                const llvm::Triple &EffectiveTriple,<br>
> +                                const ArgList &Args, ArgStringList &CmdArgs,<br>
> +                                StringRef Sanitizer, bool IsShared,<br>
> +                                bool IsWhole) {<br>
>    // Wrap any static runtimes that must be forced into executable in<br>
>    // whole-archive.<br>
>    if (IsWhole) CmdArgs.push_back("-whole-archive");<br>
> -  CmdArgs.push_back(TC.getCompilerRTArgString(Args, Sanitizer, IsShared));<br>
> -  if (IsWhole) CmdArgs.push_back("-no-whole-archive");<br>
> +  CmdArgs.push_back(<br>
> +      TC.getCompilerRTArgString(EffectiveTriple, Args, Sanitizer, IsShared));<br>
> +  if (IsWhole)<br>
> +    CmdArgs.push_back("-no-whole-archive");<br>
>  }<br>
><br>
>  // Tries to use a file with the list of dynamic symbols that need to be exported<br>
>  // from the runtime library. Returns true if the file was found.<br>
> -static bool addSanitizerDynamicList(const ToolChain &TC, const ArgList &Args,<br>
> -                                    ArgStringList &CmdArgs,<br>
> +static bool addSanitizerDynamicList(const ToolChain &TC,<br>
> +                                    const llvm::Triple &EffectiveTriple,<br>
> +                                    const ArgList &Args, ArgStringList &CmdArgs,<br>
>                                      StringRef Sanitizer) {<br>
> -  SmallString<128> SanRT(TC.getCompilerRT(Args, Sanitizer));<br>
> +  SmallString<128> SanRT(TC.getCompilerRT(EffectiveTriple, Args, Sanitizer));<br>
>    if (llvm::sys::fs::exists(SanRT + ".syms")) {<br>
>      CmdArgs.push_back(Args.MakeArgString("--dynamic-list=" + SanRT + ".syms"));<br>
>      return true;<br>
> @@ -3179,25 +3185,28 @@ collectSanitizerRuntimes(const ToolChain<br>
><br>
>  // Should be called before we add system libraries (C++ ABI, libstdc++/libc++,<br>
>  // C runtime, etc). Returns true if sanitizer system deps need to be linked in.<br>
> -static bool addSanitizerRuntimes(const ToolChain &TC, const ArgList &Args,<br>
> -                                 ArgStringList &CmdArgs) {<br>
> +static bool addSanitizerRuntimes(const ToolChain &TC,<br>
> +                                 const llvm::Triple &EffectiveTriple,<br>
> +                                 const ArgList &Args, ArgStringList &CmdArgs) {<br>
>    SmallVector<StringRef, 4> SharedRuntimes, StaticRuntimes,<br>
>        NonWholeStaticRuntimes, HelperStaticRuntimes, RequiredSymbols;<br>
>    collectSanitizerRuntimes(TC, Args, SharedRuntimes, StaticRuntimes,<br>
>                             NonWholeStaticRuntimes, HelperStaticRuntimes,<br>
>                             RequiredSymbols);<br>
>    for (auto RT : SharedRuntimes)<br>
> -    addSanitizerRuntime(TC, Args, CmdArgs, RT, true, false);<br>
> +    addSanitizerRuntime(TC, EffectiveTriple, Args, CmdArgs, RT, true, false);<br>
>    for (auto RT : HelperStaticRuntimes)<br>
> -    addSanitizerRuntime(TC, Args, CmdArgs, RT, false, true);<br>
> +    addSanitizerRuntime(TC, EffectiveTriple, Args, CmdArgs, RT, false, true);<br>
>    bool AddExportDynamic = false;<br>
>    for (auto RT : StaticRuntimes) {<br>
> -    addSanitizerRuntime(TC, Args, CmdArgs, RT, false, true);<br>
> -    AddExportDynamic |= !addSanitizerDynamicList(TC, Args, CmdArgs, RT);<br>
> +    addSanitizerRuntime(TC, EffectiveTriple, Args, CmdArgs, RT, false, true);<br>
> +    AddExportDynamic |=<br>
> +        !addSanitizerDynamicList(TC, EffectiveTriple, Args, CmdArgs, RT);<br>
>    }<br>
>    for (auto RT : NonWholeStaticRuntimes) {<br>
> -    addSanitizerRuntime(TC, Args, CmdArgs, RT, false, false);<br>
> -    AddExportDynamic |= !addSanitizerDynamicList(TC, Args, CmdArgs, RT);<br>
> +    addSanitizerRuntime(TC, EffectiveTriple, Args, CmdArgs, RT, false, false);<br>
> +    AddExportDynamic |=<br>
> +        !addSanitizerDynamicList(TC, EffectiveTriple, Args, CmdArgs, RT);<br>
>    }<br>
>    for (auto S : RequiredSymbols) {<br>
>      CmdArgs.push_back("-u");<br>
> @@ -3210,12 +3219,14 @@ static bool addSanitizerRuntimes(const T<br>
>    return !StaticRuntimes.empty();<br>
>  }<br>
><br>
> -static bool addXRayRuntime(const ToolChain &TC, const ArgList &Args,<br>
> -                           ArgStringList &CmdArgs) {<br>
> +static bool addXRayRuntime(const ToolChain &TC,<br>
> +                           const llvm::Triple &EffectiveTriple,<br>
> +                           const ArgList &Args, ArgStringList &CmdArgs) {<br>
>    if (Args.hasFlag(options::OPT_fxray_instrument,<br>
>                     options::OPT_fnoxray_instrument, false)) {<br>
>      CmdArgs.push_back("-whole-archive");<br>
> -    CmdArgs.push_back(TC.getCompilerRTArgString(Args, "xray", false));<br>
> +    CmdArgs.push_back(<br>
> +        TC.getCompilerRTArgString(EffectiveTriple, Args, "xray", false));<br>
>      CmdArgs.push_back("-no-whole-archive");<br>
>      return true;<br>
>    }<br>
> @@ -3825,9 +3836,9 @@ static void AddAssemblerKPIC(const ToolC<br>
><br>
>  void Clang::ConstructJob(Compilation &C, const JobAction &JA,<br>
>                           const InputInfo &Output, const InputInfoList &Inputs,<br>
> +                         const llvm::Triple &EffectiveTriple,<br>
>                           const ArgList &Args, const char *LinkingOutput) const {<br>
> -  std::string TripleStr = getToolChain().ComputeEffectiveClangTriple(Args);<br>
> -  const llvm::Triple Triple(TripleStr);<br>
> +  std::string TripleStr = EffectiveTriple.str();<br>
><br>
>    bool KernelOrKext =<br>
>        Args.hasArg(options::OPT_mkernel, options::OPT_fapple_kext);<br>
> @@ -3880,13 +3891,14 @@ void Clang::ConstructJob(Compilation &C,<br>
>      CmdArgs.push_back(Args.MakeArgString(NormalizedTriple));<br>
>    }<br>
><br>
> -  if (Triple.isOSWindows() && (Triple.getArch() == llvm::Triple::arm ||<br>
> -                               Triple.getArch() == llvm::Triple::thumb)) {<br>
> -    unsigned Offset = Triple.getArch() == llvm::Triple::arm ? 4 : 6;<br>
> +  if (EffectiveTriple.isOSWindows() &&<br>
> +      (EffectiveTriple.getArch() == llvm::Triple::arm ||<br>
> +       EffectiveTriple.getArch() == llvm::Triple::thumb)) {<br>
> +    unsigned Offset = EffectiveTriple.getArch() == llvm::Triple::arm ? 4 : 6;<br>
>      unsigned Version;<br>
> -    Triple.getArchName().substr(Offset).getAsInteger(10, Version);<br>
> +    EffectiveTriple.getArchName().substr(Offset).getAsInteger(10, Version);<br>
>      if (Version < 7)<br>
> -      D.Diag(diag::err_target_unsupported_arch) << Triple.getArchName()<br>
> +      D.Diag(diag::err_target_unsupported_arch) << EffectiveTriple.getArchName()<br>
>                                                  << TripleStr;<br>
>    }<br>
><br>
> @@ -4088,7 +4100,7 @@ void Clang::ConstructJob(Compilation &C,<br>
>    unsigned PICLevel;<br>
>    bool IsPIE;<br>
>    std::tie(RelocationModel, PICLevel, IsPIE) =<br>
> -      ParsePICArgs(getToolChain(), Triple, Args);<br>
> +      ParsePICArgs(getToolChain(), EffectiveTriple, Args);<br>
><br>
>    const char *RMName = RelocationModelName(RelocationModel);<br>
>    if (RMName) {<br>
> @@ -4187,8 +4199,7 @@ void Clang::ConstructJob(Compilation &C,<br>
>                     false))<br>
>      CmdArgs.push_back("-fstrict-enums");<br>
>    if (Args.hasFlag(options::OPT_fstrict_vtable_pointers,<br>
> -                   options::OPT_fno_strict_vtable_pointers,<br>
> -                   false))<br>
> +                   options::OPT_fno_strict_vtable_pointers, false))<br>
>      CmdArgs.push_back("-fstrict-vtable-pointers");<br>
>    if (!Args.hasFlag(options::OPT_foptimize_sibling_calls,<br>
>                      options::OPT_fno_optimize_sibling_calls))<br>
> @@ -4403,7 +4414,7 @@ void Clang::ConstructJob(Compilation &C,<br>
>    }<br>
><br>
>    // Add the target cpu<br>
> -  std::string CPU = getCPUName(Args, Triple, /*FromAs*/ false);<br>
> +  std::string CPU = getCPUName(Args, EffectiveTriple, /*FromAs*/ false);<br>
>    if (!CPU.empty()) {<br>
>      CmdArgs.push_back("-target-cpu");<br>
>      CmdArgs.push_back(Args.MakeArgString(CPU));<br>
> @@ -4415,7 +4426,7 @@ void Clang::ConstructJob(Compilation &C,<br>
>    }<br>
><br>
>    // Add the target features<br>
> -  getTargetFeatures(getToolChain(), Triple, Args, CmdArgs, false);<br>
> +  getTargetFeatures(getToolChain(), EffectiveTriple, Args, CmdArgs, false);<br>
><br>
>    // Add target specific flags.<br>
>    switch (getToolChain().getArch()) {<br>
> @@ -4427,12 +4438,12 @@ void Clang::ConstructJob(Compilation &C,<br>
>    case llvm::Triple::thumb:<br>
>    case llvm::Triple::thumbeb:<br>
>      // Use the effective triple, which takes into account the deployment target.<br>
> -    AddARMTargetArgs(Triple, Args, CmdArgs, KernelOrKext);<br>
> +    AddARMTargetArgs(EffectiveTriple, Args, CmdArgs, KernelOrKext);<br>
>      break;<br>
><br>
>    case llvm::Triple::aarch64:<br>
>    case llvm::Triple::aarch64_be:<br>
> -    AddAArch64TargetArgs(Args, CmdArgs);<br>
> +    AddAArch64TargetArgs(EffectiveTriple, Args, CmdArgs);<br>
>      break;<br>
><br>
>    case llvm::Triple::mips:<br>
> @@ -4553,8 +4564,8 @@ void Clang::ConstructJob(Compilation &C,<br>
>    }<br>
><br>
>    // If a debugger tuning argument appeared, remember it.<br>
> -  if (Arg *A = Args.getLastArg(options::OPT_gTune_Group,<br>
> -                               options::OPT_ggdbN_Group)) {<br>
> +  if (Arg *A =<br>
> +          Args.getLastArg(options::OPT_gTune_Group, options::OPT_ggdbN_Group)) {<br>
>      if (A->getOption().matches(options::OPT_glldb))<br>
>        DebuggerTuning = llvm::DebuggerKind::LLDB;<br>
>      else if (A->getOption().matches(options::OPT_gsce))<br>
> @@ -4583,7 +4594,7 @@ void Clang::ConstructJob(Compilation &C,<br>
><br>
>    // PS4 defaults to no column info<br>
>    if (Args.hasFlag(options::OPT_gcolumn_info, options::OPT_gno_column_info,<br>
> -                   /*Default=*/ !IsPS4CPU))<br>
> +                   /*Default=*/!IsPS4CPU))<br>
>      CmdArgs.push_back("-dwarf-column-info");<br>
><br>
>    // FIXME: Move backend command line options to the module.<br>
> @@ -4637,9 +4648,10 @@ void Clang::ConstructJob(Compilation &C,<br>
><br>
>    // CloudABI and WebAssembly use -ffunction-sections and -fdata-sections by<br>
>    // default.<br>
> -  bool UseSeparateSections = Triple.getOS() == llvm::Triple::CloudABI ||<br>
> -                             Triple.getArch() == llvm::Triple::wasm32 ||<br>
> -                             Triple.getArch() == llvm::Triple::wasm64;<br>
> +  bool UseSeparateSections =<br>
> +      EffectiveTriple.getOS() == llvm::Triple::CloudABI ||<br>
> +      EffectiveTriple.getArch() == llvm::Triple::wasm32 ||<br>
> +      EffectiveTriple.getArch() == llvm::Triple::wasm64;<br>
><br>
>    if (Args.hasFlag(options::OPT_ffunction_sections,<br>
>                     options::OPT_fno_function_sections, UseSeparateSections)) {<br>
> @@ -5008,7 +5020,8 @@ void Clang::ConstructJob(Compilation &C,<br>
>    Args.AddLastArg(CmdArgs, options::OPT_fno_operator_names);<br>
>    // Emulated TLS is enabled by default on Android, and can be enabled manually<br>
>    // with -femulated-tls.<br>
> -  bool EmulatedTLSDefault = Triple.isAndroid() || Triple.isWindowsCygwinEnvironment();<br>
> +  bool EmulatedTLSDefault = EffectiveTriple.isAndroid() ||<br>
> +                            EffectiveTriple.isWindowsCygwinEnvironment();<br>
>    if (Args.hasFlag(options::OPT_femulated_tls, options::OPT_fno_emulated_tls,<br>
>                     EmulatedTLSDefault))<br>
>      CmdArgs.push_back("-femulated-tls");<br>
> @@ -5049,7 +5062,7 @@ void Clang::ConstructJob(Compilation &C,<br>
>    }<br>
><br>
>    const SanitizerArgs &Sanitize = getToolChain().getSanitizerArgs();<br>
> -  Sanitize.addArgs(getToolChain(), Args, CmdArgs, InputType);<br>
> +  Sanitize.addArgs(getToolChain(), EffectiveTriple, Args, CmdArgs, InputType);<br>
><br>
>    // Report an error for -faltivec on anything other than PowerPC.<br>
>    if (const Arg *A = Args.getLastArg(options::OPT_faltivec)) {<br>
> @@ -5191,9 +5204,9 @@ void Clang::ConstructJob(Compilation &C,<br>
>        CmdArgs.push_back("-backend-option");<br>
>        CmdArgs.push_back("-arm-no-restrict-it");<br>
>      }<br>
> -  } else if (Triple.isOSWindows() &&<br>
> -             (Triple.getArch() == llvm::Triple::arm ||<br>
> -              Triple.getArch() == llvm::Triple::thumb)) {<br>
> +  } else if (EffectiveTriple.isOSWindows() &&<br>
> +             (EffectiveTriple.getArch() == llvm::Triple::arm ||<br>
> +              EffectiveTriple.getArch() == llvm::Triple::thumb)) {<br>
>      // Windows on ARM expects restricted IT blocks<br>
>      CmdArgs.push_back("-backend-option");<br>
>      CmdArgs.push_back("-arm-restrict-it");<br>
> @@ -5546,7 +5559,7 @@ void Clang::ConstructJob(Compilation &C,<br>
>    if (Args.hasArg(options::OPT_fno_inline))<br>
>      CmdArgs.push_back("-fno-inline");<br>
><br>
> -  if (Arg* InlineArg = Args.getLastArg(options::OPT_finline_functions,<br>
> +  if (Arg *InlineArg = Args.getLastArg(options::OPT_finline_functions,<br>
>                                         options::OPT_finline_hint_functions,<br>
>                                         options::OPT_fno_inline_functions))<br>
>      InlineArg->render(Args, CmdArgs);<br>
> @@ -5608,7 +5621,6 @@ void Clang::ConstructJob(Compilation &C,<br>
>                       options::OPT_fno_objc_arc_exceptions,<br>
>                       /*default*/ types::isCXX(InputType)))<br>
>        CmdArgs.push_back("-fobjc-arc-exceptions");<br>
> -<br>
>    }<br>
><br>
>    // -fobjc-infer-related-result-type is the default, except in the Objective-C<br>
> @@ -5634,8 +5646,8 @@ void Clang::ConstructJob(Compilation &C,<br>
><br>
>    // Pass down -fobjc-weak or -fno-objc-weak if present.<br>
>    if (types::isObjC(InputType)) {<br>
> -    auto WeakArg = Args.getLastArg(options::OPT_fobjc_weak,<br>
> -                                   options::OPT_fno_objc_weak);<br>
> +    auto WeakArg =<br>
> +        Args.getLastArg(options::OPT_fobjc_weak, options::OPT_fno_objc_weak);<br>
>      if (!WeakArg) {<br>
>        // nothing to do<br>
>      } else if (GCArg) {<br>
> @@ -5805,7 +5817,7 @@ void Clang::ConstructJob(Compilation &C,<br>
>        StringRef Value(A->getValue());<br>
>        if (Value != "always" && Value != "never" && Value != "auto")<br>
>          getToolChain().getDriver().Diag(diag::err_drv_clang_unsupported)<br>
> -              << ("-fdiagnostics-color=" + Value).str();<br>
> +            << ("-fdiagnostics-color=" + Value).str();<br>
>      }<br>
>      A->claim();<br>
>    }<br>
> @@ -6476,6 +6488,7 @@ void ClangAs::AddX86TargetArgs(const Arg<br>
><br>
>  void ClangAs::ConstructJob(Compilation &C, const JobAction &JA,<br>
>                             const InputInfo &Output, const InputInfoList &Inputs,<br>
> +                           const llvm::Triple &EffectiveTriple,<br>
>                             const ArgList &Args,<br>
>                             const char *LinkingOutput) const {<br>
>    ArgStringList CmdArgs;<br>
> @@ -6483,9 +6496,7 @@ void ClangAs::ConstructJob(Compilation &<br>
>    assert(Inputs.size() == 1 && "Unexpected number of inputs.");<br>
>    const InputInfo &Input = Inputs[0];<br>
><br>
> -  std::string TripleStr =<br>
> -      getToolChain().ComputeEffectiveClangTriple(Args, Input.getType());<br>
> -  const llvm::Triple Triple(TripleStr);<br>
> +  std::string TripleStr = EffectiveTriple.str();<br>
><br>
>    // Don't warn about "clang -w -c foo.s"<br>
>    Args.ClaimAllArgs(options::OPT_w);<br>
> @@ -6514,14 +6525,14 @@ void ClangAs::ConstructJob(Compilation &<br>
>    CmdArgs.push_back(Clang::getBaseInputName(Args, Input));<br>
><br>
>    // Add the target cpu<br>
> -  std::string CPU = getCPUName(Args, Triple, /*FromAs*/ true);<br>
> +  std::string CPU = getCPUName(Args, EffectiveTriple, /*FromAs*/ true);<br>
>    if (!CPU.empty()) {<br>
>      CmdArgs.push_back("-target-cpu");<br>
>      CmdArgs.push_back(Args.MakeArgString(CPU));<br>
>    }<br>
><br>
>    // Add the target features<br>
> -  getTargetFeatures(getToolChain(), Triple, Args, CmdArgs, true);<br>
> +  getTargetFeatures(getToolChain(), EffectiveTriple, Args, CmdArgs, true);<br>
><br>
>    // Ignore explicit -force_cpusubtype_ALL option.<br>
>    (void)Args.hasArg(options::OPT_force__cpusubtype__ALL);<br>
> @@ -6580,7 +6591,7 @@ void ClangAs::ConstructJob(Compilation &<br>
>    unsigned PICLevel;<br>
>    bool IsPIE;<br>
>    std::tie(RelocationModel, PICLevel, IsPIE) =<br>
> -      ParsePICArgs(getToolChain(), Triple, Args);<br>
> +      ParsePICArgs(getToolChain(), EffectiveTriple, Args);<br>
><br>
>    const char *RMName = RelocationModelName(RelocationModel);<br>
>    if (RMName) {<br>
> @@ -6663,7 +6674,9 @@ void GnuTool::anchor() {}<br>
><br>
>  void gcc::Common::ConstructJob(Compilation &C, const JobAction &JA,<br>
>                                 const InputInfo &Output,<br>
> -                               const InputInfoList &Inputs, const ArgList &Args,<br>
> +                               const InputInfoList &Inputs,<br>
> +                               const llvm::Triple &EffectiveTriple,<br>
> +                               const ArgList &Args,<br>
>                                 const char *LinkingOutput) const {<br>
>    const Driver &D = getToolChain().getDriver();<br>
>    ArgStringList CmdArgs;<br>
> @@ -6830,6 +6843,7 @@ void hexagon::Assembler::RenderExtraTool<br>
>  void hexagon::Assembler::ConstructJob(Compilation &C, const JobAction &JA,<br>
>                                        const InputInfo &Output,<br>
>                                        const InputInfoList &Inputs,<br>
> +                                      const llvm::Triple &EffectiveTriple,<br>
>                                        const ArgList &Args,<br>
>                                        const char *LinkingOutput) const {<br>
>    claimNoWarnArgs(Args);<br>
> @@ -7073,6 +7087,7 @@ constructHexagonLinkArgs(Compilation &C,<br>
>  void hexagon::Linker::ConstructJob(Compilation &C, const JobAction &JA,<br>
>                                     const InputInfo &Output,<br>
>                                     const InputInfoList &Inputs,<br>
> +                                   const llvm::Triple &EffectiveTriple,<br>
>                                     const ArgList &Args,<br>
>                                     const char *LinkingOutput) const {<br>
>    auto &HTC = static_cast<const toolchains::HexagonToolChain&>(getToolChain());<br>
> @@ -7090,6 +7105,7 @@ void hexagon::Linker::ConstructJob(Compi<br>
>  void amdgpu::Linker::ConstructJob(Compilation &C, const JobAction &JA,<br>
>                                    const InputInfo &Output,<br>
>                                    const InputInfoList &Inputs,<br>
> +                                  const llvm::Triple &EffectiveTriple,<br>
>                                    const ArgList &Args,<br>
>                                    const char *LinkingOutput) const {<br>
><br>
> @@ -7118,6 +7134,7 @@ bool wasm::Linker::hasIntegratedCPP() co<br>
>  void wasm::Linker::ConstructJob(Compilation &C, const JobAction &JA,<br>
>                                  const InputInfo &Output,<br>
>                                  const InputInfoList &Inputs,<br>
> +                                const llvm::Triple &EffectiveTriple,<br>
>                                  const ArgList &Args,<br>
>                                  const char *LinkingOutput) const {<br>
><br>
> @@ -7193,7 +7210,8 @@ const std::string arm::getARMArch(String<br>
>      std::string CPU = llvm::sys::getHostCPUName();<br>
>      if (CPU != "generic") {<br>
>        // Translate the native cpu into the architecture suffix for that CPU.<br>
> -      StringRef Suffix = arm::getLLVMArchSuffixForARM(CPU, MArch, Triple);<br>
> +      StringRef Suffix =<br>
> +          arm::getLLVMArchSuffixForARM(CPU, MArch, Triple);<br>
>        // If there is no valid architecture suffix for this CPU we don't know how<br>
>        // to handle it, so return no architecture.<br>
>        if (Suffix.empty())<br>
> @@ -7453,6 +7471,7 @@ const char *Clang::getDependencyFileName<br>
>  void cloudabi::Linker::ConstructJob(Compilation &C, const JobAction &JA,<br>
>                                      const InputInfo &Output,<br>
>                                      const InputInfoList &Inputs,<br>
> +                                    const llvm::Triple &EffectiveTriple,<br>
>                                      const ArgList &Args,<br>
>                                      const char *LinkingOutput) const {<br>
>    const ToolChain &ToolChain = getToolChain();<br>
> @@ -7521,6 +7540,7 @@ void cloudabi::Linker::ConstructJob(Comp<br>
>  void darwin::Assembler::ConstructJob(Compilation &C, const JobAction &JA,<br>
>                                       const InputInfo &Output,<br>
>                                       const InputInfoList &Inputs,<br>
> +                                     const llvm::Triple &EffectiveTriple,<br>
>                                       const ArgList &Args,<br>
>                                       const char *LinkingOutput) const {<br>
>    ArgStringList CmdArgs;<br>
> @@ -7818,6 +7838,7 @@ void darwin::Linker::AddLinkArgs(Compila<br>
>  void darwin::Linker::ConstructJob(Compilation &C, const JobAction &JA,<br>
>                                    const InputInfo &Output,<br>
>                                    const InputInfoList &Inputs,<br>
> +                                  const llvm::Triple &EffectiveTriple,<br>
>                                    const ArgList &Args,<br>
>                                    const char *LinkingOutput) const {<br>
>    assert(Output.getType() == types::TY_Image && "Invalid linker output type.");<br>
> @@ -7919,7 +7940,7 @@ void darwin::Linker::ConstructJob(Compil<br>
>    if (Args.hasArg(options::OPT_fnested_functions))<br>
>      CmdArgs.push_back("-allow_stack_execute");<br>
><br>
> -  getMachOToolChain().addProfileRTLibs(Args, CmdArgs);<br>
> +  getMachOToolChain().addProfileRTLibs(EffectiveTriple, Args, CmdArgs);<br>
><br>
>    if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nodefaultlibs)) {<br>
>      if (getToolChain().getDriver().CCCIsCXX())<br>
> @@ -7928,7 +7949,7 @@ void darwin::Linker::ConstructJob(Compil<br>
>      // link_ssp spec is empty.<br>
><br>
>      // Let the tool chain choose which runtime library to link.<br>
> -    getMachOToolChain().AddLinkRuntimeLibArgs(Args, CmdArgs);<br>
> +    getMachOToolChain().AddLinkRuntimeLibArgs(EffectiveTriple, Args, CmdArgs);<br>
>    }<br>
><br>
>    if (!Args.hasArg(options::OPT_nostdlib, options::OPT_nostartfiles)) {<br>
> @@ -7961,6 +7982,7 @@ void darwin::Linker::ConstructJob(Compil<br>
>  void darwin::Lipo::ConstructJob(Compilation &C, const JobAction &JA,<br>
>                                  const InputInfo &Output,<br>
>                                  const InputInfoList &Inputs,<br>
> +                                const llvm::Triple &EffectiveTriple,<br>
>                                  const ArgList &Args,<br>
>                                  const char *LinkingOutput) const {<br>
>    ArgStringList CmdArgs;<br>
> @@ -7983,6 +8005,7 @@ void darwin::Lipo::ConstructJob(Compilat<br>
>  void darwin::Dsymutil::ConstructJob(Compilation &C, const JobAction &JA,<br>
>                                      const InputInfo &Output,<br>
>                                      const InputInfoList &Inputs,<br>
> +                                    const llvm::Triple &EffectiveTriple,<br>
>                                      const ArgList &Args,<br>
>                                      const char *LinkingOutput) const {<br>
>    ArgStringList CmdArgs;<br>
> @@ -8003,6 +8026,7 @@ void darwin::Dsymutil::ConstructJob(Comp<br>
>  void darwin::VerifyDebug::ConstructJob(Compilation &C, const JobAction &JA,<br>
>                                         const InputInfo &Output,<br>
>                                         const InputInfoList &Inputs,<br>
> +                                       const llvm::Triple &EffectiveTriple,<br>
>                                         const ArgList &Args,<br>
>                                         const char *LinkingOutput) const {<br>
>    ArgStringList CmdArgs;<br>
> @@ -8026,6 +8050,7 @@ void darwin::VerifyDebug::ConstructJob(C<br>
>  void solaris::Assembler::ConstructJob(Compilation &C, const JobAction &JA,<br>
>                                        const InputInfo &Output,<br>
>                                        const InputInfoList &Inputs,<br>
> +                                      const llvm::Triple &EffectiveTriple,<br>
>                                        const ArgList &Args,<br>
>                                        const char *LinkingOutput) const {<br>
>    claimNoWarnArgs(Args);<br>
> @@ -8046,6 +8071,7 @@ void solaris::Assembler::ConstructJob(Co<br>
>  void solaris::Linker::ConstructJob(Compilation &C, const JobAction &JA,<br>
>                                     const InputInfo &Output,<br>
>                                     const InputInfoList &Inputs,<br>
> +                                   const llvm::Triple &EffectiveTriple,<br>
>                                     const ArgList &Args,<br>
>                                     const char *LinkingOutput) const {<br>
>    ArgStringList CmdArgs;<br>
> @@ -8115,7 +8141,7 @@ void solaris::Linker::ConstructJob(Compi<br>
>    }<br>
>    CmdArgs.push_back(Args.MakeArgString(getToolChain().GetFilePath("crtn.o")));<br>
><br>
> -  getToolChain().addProfileRTLibs(Args, CmdArgs);<br>
> +  getToolChain().addProfileRTLibs(EffectiveTriple, Args, CmdArgs);<br>
><br>
>    const char *Exec = Args.MakeArgString(getToolChain().GetLinkerPath());<br>
>    C.addCommand(llvm::make_unique<Command>(JA, *this, Exec, CmdArgs, Inputs));<br>
> @@ -8124,6 +8150,7 @@ void solaris::Linker::ConstructJob(Compi<br>
>  void openbsd::Assembler::ConstructJob(Compilation &C, const JobAction &JA,<br>
>                                        const InputInfo &Output,<br>
>                                        const InputInfoList &Inputs,<br>
> +                                      const llvm::Triple &EffectiveTriple,<br>
>                                        const ArgList &Args,<br>
>                                        const char *LinkingOutput) const {<br>
>    claimNoWarnArgs(Args);<br>
> @@ -8195,6 +8222,7 @@ void openbsd::Assembler::ConstructJob(Co<br>
>  void openbsd::Linker::ConstructJob(Compilation &C, const JobAction &JA,<br>
>                                     const InputInfo &Output,<br>
>                                     const InputInfoList &Inputs,<br>
> +                                   const llvm::Triple &EffectiveTriple,<br>
>                                     const ArgList &Args,<br>
>                                     const char *LinkingOutput) const {<br>
>    const Driver &D = getToolChain().getDriver();<br>
> @@ -8317,6 +8345,7 @@ void openbsd::Linker::ConstructJob(Compi<br>
>  void bitrig::Assembler::ConstructJob(Compilation &C, const JobAction &JA,<br>
>                                       const InputInfo &Output,<br>
>                                       const InputInfoList &Inputs,<br>
> +                                     const llvm::Triple &EffectiveTriple,<br>
>                                       const ArgList &Args,<br>
>                                       const char *LinkingOutput) const {<br>
>    claimNoWarnArgs(Args);<br>
> @@ -8337,6 +8366,7 @@ void bitrig::Assembler::ConstructJob(Com<br>
>  void bitrig::Linker::ConstructJob(Compilation &C, const JobAction &JA,<br>
>                                    const InputInfo &Output,<br>
>                                    const InputInfoList &Inputs,<br>
> +                                  const llvm::Triple &EffectiveTriple,<br>
>                                    const ArgList &Args,<br>
>                                    const char *LinkingOutput) const {<br>
>    const Driver &D = getToolChain().getDriver();<br>
> @@ -8446,6 +8476,7 @@ void bitrig::Linker::ConstructJob(Compil<br>
>  void freebsd::Assembler::ConstructJob(Compilation &C, const JobAction &JA,<br></blockquote></div></div>