r240791 - clang-format some of the files in lib/Driver. NFC

Rafael EspĂ­ndola rafael.espindola at gmail.com
Sun Jun 28 05:00:10 PDT 2015


For what it is worth, I find clang-format an awesome tool for *fixing*
conflicts: just clang-format both ends before you merge.
On Jun 27, 2015 12:34 PM, "Nico Weber" <thakis at chromium.org> wrote:

> Can we please not land CLs like this in the future? They screw up `svn
> blame` output, cause tons of local conflicts, and don't add all that much.
>
> On Fri, Jun 26, 2015 at 8:47 AM, Douglas Katzman <dougk at google.com> wrote:
>
>> Author: dougk
>> Date: Fri Jun 26 10:47:46 2015
>> New Revision: 240791
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=240791&view=rev
>> <https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D240791-26view-3Drev&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=HQQNmbImUf4F-mcwxbN9TPWVeRmDPUPU4dZwwCB61Pk&s=ehuiDRVzsaoAEE_Xwi0aZYBuWJWAIKpF0BvdqTqpOj8&e=>
>> Log:
>> clang-format some of the files in lib/Driver. NFC
>>
>> Nothing was hand edited afterward except a few literal strings
>> and comments that were poorly broken.
>>
>> Differential Revision: http://reviews.llvm.org/D10689
>> <https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D10689&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=HQQNmbImUf4F-mcwxbN9TPWVeRmDPUPU4dZwwCB61Pk&s=KjQXFMmiibw0_SEtTwJ4CMCZ4f51wZJxUXrCis-mLJI&e=>
>>
>> Modified:
>>     cfe/trunk/lib/Driver/Driver.cpp
>>     cfe/trunk/lib/Driver/ToolChains.cpp
>>     cfe/trunk/lib/Driver/ToolChains.h
>>     cfe/trunk/lib/Driver/Tools.cpp
>>
>> Modified: cfe/trunk/lib/Driver/Driver.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=240791&r1=240790&r2=240791&view=diff
>> <https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_cfe_trunk_lib_Driver_Driver.cpp-3Frev-3D240791-26r1-3D240790-26r2-3D240791-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=HQQNmbImUf4F-mcwxbN9TPWVeRmDPUPU4dZwwCB61Pk&s=iFEgxCqDJj7sKJnBBLfAOJtr4_JAVx3j2I3JOxCPna8&e=>
>>
>> ==============================================================================
>> --- cfe/trunk/lib/Driver/Driver.cpp (original)
>> +++ cfe/trunk/lib/Driver/Driver.cpp Fri Jun 26 10:47:46 2015
>> @@ -58,7 +58,7 @@ Driver::Driver(StringRef ClangExecutable
>>        CCCUsePCH(true), SuppressMissingInputWarning(false) {
>>
>>    Name = llvm::sys::path::filename(ClangExecutable);
>> -  Dir  = llvm::sys::path::parent_path(ClangExecutable);
>> +  Dir = llvm::sys::path::parent_path(ClangExecutable);
>>
>>    // Compute the path to the resource directory.
>>    StringRef ClangResourceDir(CLANG_RESOURCE_DIR);
>> @@ -81,7 +81,7 @@ Driver::~Driver() {
>>
>>  void Driver::ParseDriverMode(ArrayRef<const char *> Args) {
>>    const std::string OptName =
>> -    getOpts().getOption(options::OPT_driver_mode).getPrefixedName();
>> +      getOpts().getOption(options::OPT_driver_mode).getPrefixedName();
>>
>>    for (const char *ArgPtr : Args) {
>>      // Ingore nullptrs, they are response file's EOL markers
>> @@ -93,11 +93,11 @@ void Driver::ParseDriverMode(ArrayRef<co
>>
>>      const StringRef Value = Arg.drop_front(OptName.size());
>>      const unsigned M = llvm::StringSwitch<unsigned>(Value)
>> -        .Case("gcc", GCCMode)
>> -        .Case("g++", GXXMode)
>> -        .Case("cpp", CPPMode)
>> -        .Case("cl",  CLMode)
>> -        .Default(~0U);
>> +                           .Case("gcc", GCCMode)
>> +                           .Case("g++", GXXMode)
>> +                           .Case("cpp", CPPMode)
>> +                           .Case("cl", CLMode)
>> +                           .Default(~0U);
>>
>>      if (M != ~0U)
>>        Mode = static_cast<DriverMode>(M);
>> @@ -112,7 +112,7 @@ InputArgList Driver::ParseArgStrings(Arr
>>    unsigned IncludedFlagsBitmask;
>>    unsigned ExcludedFlagsBitmask;
>>    std::tie(IncludedFlagsBitmask, ExcludedFlagsBitmask) =
>> -    getIncludeExcludeOptionFlagMasks();
>> +      getIncludeExcludeOptionFlagMasks();
>>
>>    unsigned MissingArgIndex, MissingArgCount;
>>    InputArgList Args =
>> @@ -132,8 +132,7 @@ InputArgList Driver::ParseArgStrings(Arr
>>      }
>>
>>      // Warn about -mcpu= without an argument.
>> -    if (A->getOption().matches(options::OPT_mcpu_EQ) &&
>> -        A->containsValue("")) {
>> +    if (A->getOption().matches(options::OPT_mcpu_EQ) &&
>> A->containsValue("")) {
>>        Diag(clang::diag::warn_drv_empty_joined_argument) <<
>> A->getAsString(Args);
>>      }
>>    }
>> @@ -147,14 +146,13 @@ InputArgList Driver::ParseArgStrings(Arr
>>  // Determine which compilation mode we are in. We look for options which
>>  // affect the phase, starting with the earliest phases, and record which
>>  // option we used to determine the final phase.
>> -phases::ID Driver::getFinalPhase(const DerivedArgList &DAL, Arg
>> **FinalPhaseArg)
>> -const {
>> +phases::ID Driver::getFinalPhase(const DerivedArgList &DAL,
>> +                                 Arg **FinalPhaseArg) const {
>>    Arg *PhaseArg = nullptr;
>>    phases::ID FinalPhase;
>>
>>    // -{E,EP,P,M,MM} only run the preprocessor.
>> -  if (CCCIsCPP() ||
>> -      (PhaseArg = DAL.getLastArg(options::OPT_E)) ||
>> +  if (CCCIsCPP() || (PhaseArg = DAL.getLastArg(options::OPT_E)) ||
>>        (PhaseArg = DAL.getLastArg(options::OPT__SLASH_EP)) ||
>>        (PhaseArg = DAL.getLastArg(options::OPT_M, options::OPT_MM)) ||
>>        (PhaseArg = DAL.getLastArg(options::OPT__SLASH_P))) {
>> @@ -190,7 +188,7 @@ const {
>>    return FinalPhase;
>>  }
>>
>> -static Arg* MakeInputArg(DerivedArgList &Args, OptTable *Opts,
>> +static Arg *MakeInputArg(DerivedArgList &Args, OptTable *Opts,
>>                           StringRef Value) {
>>    Arg *A = new Arg(Opts->getOption(options::OPT_INPUT), Value,
>>                     Args.getBaseArgs().MakeIndex(Value), Value.data());
>> @@ -248,15 +246,13 @@ DerivedArgList *Driver::TranslateInputAr
>>
>>        // Rewrite unless -nostdlib is present.
>>        if (!HasNostdlib && Value == "stdc++") {
>> -        DAL->AddFlagArg(A, Opts->getOption(
>> -                              options::OPT_Z_reserved_lib_stdcxx));
>> +        DAL->AddFlagArg(A,
>> Opts->getOption(options::OPT_Z_reserved_lib_stdcxx));
>>          continue;
>>        }
>>
>>        // Rewrite unconditionally.
>>        if (Value == "cc_kext") {
>> -        DAL->AddFlagArg(A, Opts->getOption(
>> -                              options::OPT_Z_reserved_lib_cckext));
>> +        DAL->AddFlagArg(A,
>> Opts->getOption(options::OPT_Z_reserved_lib_cckext));
>>          continue;
>>        }
>>      }
>> @@ -272,8 +268,8 @@ DerivedArgList *Driver::TranslateInputAr
>>      DAL->append(A);
>>    }
>>
>> -  // Add a default value of -mlinker-version=, if one was given and the
>> user
>> -  // didn't specify one.
>> +// Add a default value of -mlinker-version=, if one was given and the
>> user
>> +// didn't specify one.
>>  #if defined(HOST_LINK_VERSION)
>>    if (!Args.hasArg(options::OPT_mlinker_version_EQ) &&
>>        strlen(HOST_LINK_VERSION) > 0) {
>> @@ -295,8 +291,8 @@ Compilation *Driver::BuildCompilation(Ar
>>    if (char *env = ::getenv("COMPILER_PATH")) {
>>      StringRef CompilerPath = env;
>>      while (!CompilerPath.empty()) {
>> -      std::pair<StringRef, StringRef> Split
>> -        = CompilerPath.split(llvm::sys::EnvPathSeparator);
>> +      std::pair<StringRef, StringRef> Split =
>> +          CompilerPath.split(llvm::sys::EnvPathSeparator);
>>        PrefixDirs.push_back(Split.first);
>>        CompilerPath = Split.second;
>>      }
>> @@ -387,8 +383,8 @@ Compilation *Driver::BuildCompilation(Ar
>>    // Construct the list of abstract actions to perform for this
>> compilation. On
>>    // MachO targets this uses the driver-driver and universal actions.
>>    if (TC.getTriple().isOSBinFormatMachO())
>> -    BuildUniversalActions(C->getDefaultToolChain(), C->getArgs(),
>> -                          Inputs, C->getActions());
>> +    BuildUniversalActions(C->getDefaultToolChain(), C->getArgs(), Inputs,
>> +                          C->getActions());
>>    else
>>      BuildActions(C->getDefaultToolChain(), C->getArgs(), Inputs,
>>                   C->getActions());
>> @@ -420,8 +416,8 @@ void Driver::generateCompilationDiagnost
>>    PrintVersion(C, llvm::errs());
>>
>>    Diag(clang::diag::note_drv_command_failed_diag_msg)
>> -    << "PLEASE submit a bug report to " BUG_REPORT_URL " and include the
>> "
>> -    "crash backtrace, preprocessed source, and associated run script.";
>> +      << "PLEASE submit a bug report to " BUG_REPORT_URL " and include
>> the "
>> +         "crash backtrace, preprocessed source, and associated run
>> script.";
>>
>>    // Suppress driver output and emit preprocessor output to temp file.
>>    Mode = CPPMode;
>> @@ -446,12 +442,12 @@ void Driver::generateCompilationDiagnost
>>
>>      // Ignore input from stdin or any inputs that cannot be preprocessed.
>>      // Check type first as not all linker inputs have a value.
>> -   if (types::getPreprocessedType(it->first) == types::TY_INVALID) {
>> +    if (types::getPreprocessedType(it->first) == types::TY_INVALID) {
>>        IgnoreInput = true;
>>      } else if (!strcmp(it->second->getValue(), "-")) {
>>        Diag(clang::diag::note_drv_command_failed_diag_msg)
>> -        << "Error generating preprocessed source(s) - ignoring input
>> from stdin"
>> -        ".";
>> +          << "Error generating preprocessed source(s) - "
>> +             "ignoring input from stdin.";
>>        IgnoreInput = true;
>>      }
>>
>> @@ -465,7 +461,8 @@ void Driver::generateCompilationDiagnost
>>
>>    if (Inputs.empty()) {
>>      Diag(clang::diag::note_drv_command_failed_diag_msg)
>> -      << "Error generating preprocessed source(s) - no preprocessable
>> inputs.";
>> +        << "Error generating preprocessed source(s) - "
>> +           "no preprocessable inputs.";
>>      return;
>>    }
>>
>> @@ -480,8 +477,8 @@ void Driver::generateCompilationDiagnost
>>    }
>>    if (ArchNames.size() > 1) {
>>      Diag(clang::diag::note_drv_command_failed_diag_msg)
>> -      << "Error generating preprocessed source(s) - cannot generate "
>> -      "preprocessed source with multiple -arch options.";
>> +        << "Error generating preprocessed source(s) - cannot generate "
>> +           "preprocessed source with multiple -arch options.";
>>      return;
>>    }
>>
>> @@ -498,7 +495,7 @@ void Driver::generateCompilationDiagnost
>>    // If there were errors building the compilation, quit now.
>>    if (Trap.hasErrorOccurred()) {
>>      Diag(clang::diag::note_drv_command_failed_diag_msg)
>> -      << "Error generating preprocessed source(s).";
>> +        << "Error generating preprocessed source(s).";
>>      return;
>>    }
>>
>> @@ -512,14 +509,14 @@ void Driver::generateCompilationDiagnost
>>        C.CleanupFileList(C.getTempFiles(), true);
>>
>>      Diag(clang::diag::note_drv_command_failed_diag_msg)
>> -      << "Error generating preprocessed source(s).";
>> +        << "Error generating preprocessed source(s).";
>>      return;
>>    }
>>
>>    const ArgStringList &TempFiles = C.getTempFiles();
>>    if (TempFiles.empty()) {
>>      Diag(clang::diag::note_drv_command_failed_diag_msg)
>> -      << "Error generating preprocessed source(s).";
>> +        << "Error generating preprocessed source(s).";
>>      return;
>>    }
>>
>> @@ -583,12 +580,13 @@ void Driver::setUpResponseFiles(Compilat
>>      return;
>>
>>    std::string TmpName = GetTemporaryPath("response", "txt");
>> -  CurCommand->setResponseFile(C.addTempFile(C.getArgs().MakeArgString(
>> -      TmpName.c_str())));
>> +  CurCommand->setResponseFile(
>> +      C.addTempFile(C.getArgs().MakeArgString(TmpName.c_str())));
>>  }
>>
>> -int Driver::ExecuteCompilation(Compilation &C,
>> -    SmallVectorImpl< std::pair<int, const Command *> > &FailingCommands)
>> {
>> +int Driver::ExecuteCompilation(
>> +    Compilation &C,
>> +    SmallVectorImpl<std::pair<int, const Command *>> &FailingCommands) {
>>    // Just print if -### was present.
>>    if (C.getArgs().hasArg(options::OPT__HASH_HASH_HASH)) {
>>      C.getJobs().Print(llvm::errs(), "\n", true);
>> @@ -640,10 +638,10 @@ int Driver::ExecuteCompilation(Compilati
>>        // FIXME: See FIXME above regarding result code interpretation.
>>        if (Res < 0)
>>          Diag(clang::diag::err_drv_command_signalled)
>> -          << FailingTool.getShortName();
>> +            << FailingTool.getShortName();
>>        else
>> -        Diag(clang::diag::err_drv_command_failed)
>> -          << FailingTool.getShortName() << Res;
>> +        Diag(clang::diag::err_drv_command_failed) <<
>> FailingTool.getShortName()
>> +                                                  << Res;
>>      }
>>    }
>>    return 0;
>> @@ -653,7 +651,7 @@ void Driver::PrintHelp(bool ShowHidden)
>>    unsigned IncludedFlagsBitmask;
>>    unsigned ExcludedFlagsBitmask;
>>    std::tie(IncludedFlagsBitmask, ExcludedFlagsBitmask) =
>> -    getIncludeExcludeOptionFlagMasks();
>> +      getIncludeExcludeOptionFlagMasks();
>>
>>    ExcludedFlagsBitmask |= options::NoDriverOption;
>>    if (!ShowHidden)
>> @@ -684,8 +682,8 @@ void Driver::PrintVersion(const Compilat
>>  /// option.
>>  static void PrintDiagnosticCategories(raw_ostream &OS) {
>>    // Skip the empty category.
>> -  for (unsigned i = 1, max = DiagnosticIDs::getNumberOfCategories();
>> -       i != max; ++i)
>> +  for (unsigned i = 1, max = DiagnosticIDs::getNumberOfCategories(); i
>> != max;
>> +       ++i)
>>      OS << i << ',' << DiagnosticIDs::getCategoryNameFromID(i) << '\n';
>>  }
>>
>> @@ -741,7 +739,8 @@ bool Driver::HandleImmediateArgs(const C
>>      llvm::outs() << "programs: =";
>>      bool separator = false;
>>      for (const std::string &Path : TC.getProgramPaths()) {
>> -      if (separator) llvm::outs() << ':';
>> +      if (separator)
>> +        llvm::outs() << ':';
>>        llvm::outs() << Path;
>>        separator = true;
>>      }
>> @@ -817,7 +816,7 @@ bool Driver::HandleImmediateArgs(const C
>>  // and latest-occuring action. Traversal is in pre-order, visiting the
>>  // inputs to each action before printing the action itself.
>>  static unsigned PrintActions1(const Compilation &C, Action *A,
>> -                              std::map<Action*, unsigned> &Ids) {
>> +                              std::map<Action *, unsigned> &Ids) {
>>    if (Ids.count(A)) // A was already visited.
>>      return Ids[A];
>>
>> @@ -858,8 +857,7 @@ void Driver::PrintActions(const Compilat
>>  /// \brief Check whether the given input tree contains any compilation or
>>  /// assembly actions.
>>  static bool ContainsCompileOrAssembleAction(const Action *A) {
>> -  if (isa<CompileJobAction>(A) ||
>> -      isa<BackendJobAction>(A) ||
>> +  if (isa<CompileJobAction>(A) || isa<BackendJobAction>(A) ||
>>        isa<AssembleJobAction>(A))
>>      return true;
>>
>> @@ -870,8 +868,7 @@ static bool ContainsCompileOrAssembleAct
>>    return false;
>>  }
>>
>> -void Driver::BuildUniversalActions(const ToolChain &TC,
>> -                                   DerivedArgList &Args,
>> +void Driver::BuildUniversalActions(const ToolChain &TC, DerivedArgList
>> &Args,
>>                                     const InputList &BAInputs,
>>                                     ActionList &Actions) const {
>>    llvm::PrettyStackTraceString CrashInfo("Building universal build
>> actions");
>> @@ -884,10 +881,9 @@ void Driver::BuildUniversalActions(const
>>        // Validate the option here; we don't save the type here because
>> its
>>        // particular spelling may participate in other driver choices.
>>        llvm::Triple::ArchType Arch =
>> -        tools::darwin::getArchTypeForMachOArchName(A->getValue());
>> +          tools::darwin::getArchTypeForMachOArchName(A->getValue());
>>        if (Arch == llvm::Triple::UnknownArch) {
>> -        Diag(clang::diag::err_drv_invalid_arch_name)
>> -          << A->getAsString(Args);
>> +        Diag(clang::diag::err_drv_invalid_arch_name) <<
>> A->getAsString(Args);
>>          continue;
>>        }
>>
>> @@ -918,7 +914,7 @@ void Driver::BuildUniversalActions(const
>>
>>      if (Archs.size() > 1 && !types::canLipoType(Act->getType()))
>>        Diag(clang::diag::err_drv_invalid_output_with_multiple_archs)
>> -        << types::getTypeName(Act->getType());
>> +          << types::getTypeName(Act->getType());
>>
>>      ActionList Inputs;
>>      for (unsigned i = 0, e = Archs.size(); i != e; ++i) {
>> @@ -1008,10 +1004,11 @@ void Driver::BuildInputs(const ToolChain
>>                                           options::OPT__SLASH_TP)) {
>>      InputTypeArg = TCTP;
>>      InputType = TCTP->getOption().matches(options::OPT__SLASH_TC)
>> -        ? types::TY_C : types::TY_CXX;
>> +                    ? types::TY_C
>> +                    : types::TY_CXX;
>>
>> -    arg_iterator it = Args.filtered_begin(options::OPT__SLASH_TC,
>> -                                          options::OPT__SLASH_TP);
>> +    arg_iterator it =
>> +        Args.filtered_begin(options::OPT__SLASH_TC,
>> options::OPT__SLASH_TP);
>>      const arg_iterator ie = Args.filtered_end();
>>      Arg *Previous = *it++;
>>      bool ShowNote = false;
>> @@ -1073,7 +1070,7 @@ void Driver::BuildInputs(const ToolChain
>>
>>              if (Ty != OldTy)
>>                Diag(clang::diag::warn_drv_treating_input_as_cxx)
>> -                << getTypeName(OldTy) << getTypeName(Ty);
>> +                  << getTypeName(OldTy) << getTypeName(Ty);
>>            }
>>          }
>>
>> @@ -1175,7 +1172,7 @@ void Driver::BuildActions(const ToolChai
>>          !llvm::sys::path::is_separator(V.back())) {
>>        // Check whether /Fo tries to name an output file for multiple
>> inputs.
>>        Diag(clang::diag::err_drv_out_file_argument_with_multiple_sources)
>> -        << A->getSpelling() << V;
>> +          << A->getSpelling() << V;
>>        Args.eraseArg(options::OPT__SLASH_Fo);
>>      }
>>    }
>> @@ -1187,7 +1184,7 @@ void Driver::BuildActions(const ToolChai
>>          !llvm::sys::path::is_separator(V.back())) {
>>        // Check whether /Fa tries to name an asm file for multiple inputs.
>>        Diag(clang::diag::err_drv_out_file_argument_with_multiple_sources)
>> -        << A->getSpelling() << V;
>> +          << A->getSpelling() << V;
>>        Args.eraseArg(options::OPT__SLASH_Fa);
>>      }
>>    }
>> @@ -1227,30 +1224,27 @@ void Driver::BuildActions(const ToolChai
>>        // by a command-line argument with a corresponding Arg.
>>        if (CCCIsCPP())
>>          Diag(clang::diag::warn_drv_input_file_unused_by_cpp)
>> -          << InputArg->getAsString(Args)
>> -          << getPhaseName(InitialPhase);
>> +            << InputArg->getAsString(Args) << getPhaseName(InitialPhase);
>>        // Special case '-E' warning on a previously preprocessed file to
>> make
>>        // more sense.
>>        else if (InitialPhase == phases::Compile &&
>>                 FinalPhase == phases::Preprocess &&
>>                 getPreprocessedType(InputType) == types::TY_INVALID)
>>          Diag(clang::diag::warn_drv_preprocessed_input_file_unused)
>> -          << InputArg->getAsString(Args)
>> -          << !!FinalPhaseArg
>> -          << (FinalPhaseArg ? FinalPhaseArg->getOption().getName() : "");
>> +            << InputArg->getAsString(Args) << !!FinalPhaseArg
>> +            << (FinalPhaseArg ? FinalPhaseArg->getOption().getName() :
>> "");
>>        else
>>          Diag(clang::diag::warn_drv_input_file_unused)
>> -          << InputArg->getAsString(Args)
>> -          << getPhaseName(InitialPhase)
>> -          << !!FinalPhaseArg
>> -          << (FinalPhaseArg ? FinalPhaseArg->getOption().getName() : "");
>> +            << InputArg->getAsString(Args) << getPhaseName(InitialPhase)
>> +            << !!FinalPhaseArg
>> +            << (FinalPhaseArg ? FinalPhaseArg->getOption().getName() :
>> "");
>>        continue;
>>      }
>>
>>      // Build the pipeline for this file.
>>      std::unique_ptr<Action> Current(new InputAction(*InputArg,
>> InputType));
>> -    for (SmallVectorImpl<phases::ID>::iterator
>> -           i = PL.begin(), e = PL.end(); i != e; ++i) {
>> +    for (SmallVectorImpl<phases::ID>::iterator i = PL.begin(), e =
>> PL.end();
>> +         i != e; ++i) {
>>        phases::ID Phase = *i;
>>
>>        // We are done if this step is past what the user requested.
>> @@ -1303,7 +1297,8 @@ Driver::ConstructPhaseAction(const ToolC
>>    llvm::PrettyStackTraceString CrashInfo("Constructing phase actions");
>>    // Build the appropriate action.
>>    switch (Phase) {
>> -  case phases::Link: llvm_unreachable("link action invalid here.");
>> +  case phases::Link:
>> +    llvm_unreachable("link action invalid here.");
>>    case phases::Preprocess: {
>>      types::ID OutputTy;
>>      // -{M, MM} alter the output type.
>> @@ -1359,12 +1354,12 @@ Driver::ConstructPhaseAction(const ToolC
>>    case phases::Backend: {
>>      if (IsUsingLTO(Args)) {
>>        types::ID Output =
>> -        Args.hasArg(options::OPT_S) ? types::TY_LTO_IR :
>> types::TY_LTO_BC;
>> +          Args.hasArg(options::OPT_S) ? types::TY_LTO_IR :
>> types::TY_LTO_BC;
>>        return llvm::make_unique<BackendJobAction>(std::move(Input),
>> Output);
>>      }
>>      if (Args.hasArg(options::OPT_emit_llvm)) {
>>        types::ID Output =
>> -        Args.hasArg(options::OPT_S) ? types::TY_LLVM_IR :
>> types::TY_LLVM_BC;
>> +          Args.hasArg(options::OPT_S) ? types::TY_LLVM_IR :
>> types::TY_LLVM_BC;
>>        return llvm::make_unique<BackendJobAction>(std::move(Input),
>> Output);
>>      }
>>      return llvm::make_unique<BackendJobAction>(std::move(Input),
>> @@ -1425,11 +1420,10 @@ void Driver::BuildJobs(Compilation &C) c
>>
>>      InputInfo II;
>>      BuildJobsForAction(C, A, &C.getDefaultToolChain(),
>> -                       /*BoundArch*/nullptr,
>> +                       /*BoundArch*/ nullptr,
>>                         /*AtTopLevel*/ true,
>>                         /*MultipleArchs*/ ArchNames.size() > 1,
>> -                       /*LinkingOutput*/ LinkingOutput,
>> -                       II);
>> +                       /*LinkingOutput*/ LinkingOutput, II);
>>    }
>>
>>    // If the user passed -Qunused-arguments or there were errors, don't
>> warn
>> @@ -1439,10 +1433,10 @@ void Driver::BuildJobs(Compilation &C) c
>>      return;
>>
>>    // Claim -### here.
>> -  (void) C.getArgs().hasArg(options::OPT__HASH_HASH_HASH);
>> +  (void)C.getArgs().hasArg(options::OPT__HASH_HASH_HASH);
>>
>>    // Claim --driver-mode, it was handled earlier.
>> -  (void) C.getArgs().hasArg(options::OPT_driver_mode);
>> +  (void)C.getArgs().hasArg(options::OPT_driver_mode);
>>
>>    for (Arg *A : C.getArgs()) {
>>      // FIXME: It would be nice to be able to send the argument to the
>> @@ -1470,7 +1464,7 @@ void Driver::BuildJobs(Compilation &C) c
>>        }
>>
>>        Diag(clang::diag::warn_drv_unused_argument)
>> -        << A->getAsString(C.getArgs());
>> +          << A->getAsString(C.getArgs());
>>      }
>>    }
>>  }
>> @@ -1484,13 +1478,12 @@ static const Tool *SelectToolForJob(Comp
>>    // bottom up, so what we are actually looking for is an assembler job
>> with a
>>    // compiler input.
>>
>> -  if (TC->useIntegratedAs() &&
>> -      !SaveTemps &&
>> +  if (TC->useIntegratedAs() && !SaveTemps &&
>>        !C.getArgs().hasArg(options::OPT_via_file_asm) &&
>>        !C.getArgs().hasArg(options::OPT__SLASH_FA) &&
>>        !C.getArgs().hasArg(options::OPT__SLASH_Fa) &&
>> -      isa<AssembleJobAction>(JA) &&
>> -      Inputs->size() == 1 && isa<BackendJobAction>(*Inputs->begin())) {
>> +      isa<AssembleJobAction>(JA) && Inputs->size() == 1 &&
>> +      isa<BackendJobAction>(*Inputs->begin())) {
>>      // A BackendJob is always preceded by a CompileJob, and without
>>      // -save-temps they will always get combined together, so instead of
>>      // checking the backend tool, check if the tool for the CompileJob
>> @@ -1531,8 +1524,7 @@ static const Tool *SelectToolForJob(Comp
>>    // (irrelevant since we don't support combine yet).
>>    if (Inputs->size() == 1 && isa<PreprocessJobAction>(*Inputs->begin())
>> &&
>>        !C.getArgs().hasArg(options::OPT_no_integrated_cpp) &&
>> -      !C.getArgs().hasArg(options::OPT_traditional_cpp) &&
>> -      !SaveTemps &&
>> +      !C.getArgs().hasArg(options::OPT_traditional_cpp) && !SaveTemps &&
>>        !C.getArgs().hasArg(options::OPT_rewrite_objc) &&
>>        ToolForJob->hasIntegratedCPP())
>>      Inputs = &(*Inputs)[0]->getInputs();
>> @@ -1540,12 +1532,9 @@ static const Tool *SelectToolForJob(Comp
>>    return ToolForJob;
>>  }
>>
>> -void Driver::BuildJobsForAction(Compilation &C,
>> -                                const Action *A,
>> -                                const ToolChain *TC,
>> -                                const char *BoundArch,
>> -                                bool AtTopLevel,
>> -                                bool MultipleArchs,
>> +void Driver::BuildJobsForAction(Compilation &C, const Action *A,
>> +                                const ToolChain *TC, const char
>> *BoundArch,
>> +                                bool AtTopLevel, bool MultipleArchs,
>>                                  const char *LinkingOutput,
>>                                  InputInfo &Result) const {
>>    llvm::PrettyStackTraceString CrashInfo("Building compilation jobs");
>> @@ -1573,8 +1562,8 @@ void Driver::BuildJobsForAction(Compilat
>>      else
>>        TC = &C.getDefaultToolChain();
>>
>> -    BuildJobsForAction(C, *BAA->begin(), TC, BAA->getArchName(),
>> -                       AtTopLevel, MultipleArchs, LinkingOutput, Result);
>> +    BuildJobsForAction(C, *BAA->begin(), TC, BAA->getArchName(),
>> AtTopLevel,
>> +                       MultipleArchs, LinkingOutput, Result);
>>      return;
>>    }
>>
>> @@ -1642,7 +1631,8 @@ const char *Driver::getDefaultImageName(
>>  /// does not provide a filename, then use BaseName, and use the extension
>>  /// suitable for FileType.
>>  static const char *MakeCLOutputFilename(const ArgList &Args, StringRef
>> ArgValue,
>> -                                        StringRef BaseName, types::ID
>> FileType) {
>> +                                        StringRef BaseName,
>> +                                        types::ID FileType) {
>>    SmallString<128> Filename = ArgValue;
>>
>>    if (ArgValue.empty()) {
>> @@ -1669,16 +1659,13 @@ static const char *MakeCLOutputFilename(
>>    return Args.MakeArgString(Filename.c_str());
>>  }
>>
>> -const char *Driver::GetNamedOutputPath(Compilation &C,
>> -                                       const JobAction &JA,
>> +const char *Driver::GetNamedOutputPath(Compilation &C, const JobAction
>> &JA,
>>                                         const char *BaseInput,
>> -                                       const char *BoundArch,
>> -                                       bool AtTopLevel,
>> +                                       const char *BoundArch, bool
>> AtTopLevel,
>>                                         bool MultipleArchs) const {
>>    llvm::PrettyStackTraceString CrashInfo("Computing output path");
>>    // Output to a user requested destination?
>> -  if (AtTopLevel && !isa<DsymutilJobAction>(JA) &&
>> -      !isa<VerifyJobAction>(JA)) {
>> +  if (AtTopLevel && !isa<DsymutilJobAction>(JA) &&
>> !isa<VerifyJobAction>(JA)) {
>>      if (Arg *FinalOutput = C.getArgs().getLastArg(options::OPT_o))
>>        return C.addResultFile(FinalOutput->getValue(), &JA);
>>    }
>> @@ -1690,8 +1677,9 @@ const char *Driver::GetNamedOutputPath(C
>>      StringRef NameArg;
>>      if (Arg *A = C.getArgs().getLastArg(options::OPT__SLASH_Fi))
>>        NameArg = A->getValue();
>> -    return C.addResultFile(MakeCLOutputFilename(C.getArgs(), NameArg,
>> BaseName,
>> -                                                types::TY_PP_C), &JA);
>> +    return C.addResultFile(
>> +        MakeCLOutputFilename(C.getArgs(), NameArg, BaseName,
>> types::TY_PP_C),
>> +        &JA);
>>    }
>>
>>    // Default to writing to stdout?
>> @@ -1706,19 +1694,19 @@ const char *Driver::GetNamedOutputPath(C
>>      // Use /Fa and the input filename to determine the asm file name.
>>      StringRef BaseName = llvm::sys::path::filename(BaseInput);
>>      StringRef FaValue =
>> C.getArgs().getLastArgValue(options::OPT__SLASH_Fa);
>> -    return C.addResultFile(MakeCLOutputFilename(C.getArgs(), FaValue,
>> BaseName,
>> -                                                JA.getType()), &JA);
>> +    return C.addResultFile(
>> +        MakeCLOutputFilename(C.getArgs(), FaValue, BaseName,
>> JA.getType()),
>> +        &JA);
>>    }
>>
>>    // Output to a temporary file?
>>    if ((!AtTopLevel && !isSaveTempsEnabled() &&
>> -        !C.getArgs().hasArg(options::OPT__SLASH_Fo)) ||
>> +       !C.getArgs().hasArg(options::OPT__SLASH_Fo)) ||
>>        CCGenDiagnostics) {
>>      StringRef Name = llvm::sys::path::filename(BaseInput);
>>      std::pair<StringRef, StringRef> Split = Name.split('.');
>> -    std::string TmpName =
>> -      GetTemporaryPath(Split.first,
>> -          types::getTypeTempSuffix(JA.getType(), IsCLMode()));
>> +    std::string TmpName = GetTemporaryPath(
>> +        Split.first, types::getTypeTempSuffix(JA.getType(), IsCLMode()));
>>      return C.addTempFile(C.getArgs().MakeArgString(TmpName.c_str()));
>>    }
>>
>> @@ -1737,22 +1725,27 @@ const char *Driver::GetNamedOutputPath(C
>>    if (JA.getType() == types::TY_Object &&
>>        C.getArgs().hasArg(options::OPT__SLASH_Fo, options::OPT__SLASH_o))
>> {
>>      // The /Fo or /o flag decides the object filename.
>> -    StringRef Val = C.getArgs().getLastArg(options::OPT__SLASH_Fo,
>> -
>>  options::OPT__SLASH_o)->getValue();
>> -    NamedOutput = MakeCLOutputFilename(C.getArgs(), Val, BaseName,
>> -                                       types::TY_Object);
>> +    StringRef Val =
>> +        C.getArgs()
>> +            .getLastArg(options::OPT__SLASH_Fo, options::OPT__SLASH_o)
>> +            ->getValue();
>> +    NamedOutput =
>> +        MakeCLOutputFilename(C.getArgs(), Val, BaseName,
>> types::TY_Object);
>>    } else if (JA.getType() == types::TY_Image &&
>> -             C.getArgs().hasArg(options::OPT__SLASH_Fe,
>> options::OPT__SLASH_o)) {
>> +             C.getArgs().hasArg(options::OPT__SLASH_Fe,
>> +                                options::OPT__SLASH_o)) {
>>      // The /Fe or /o flag names the linked file.
>> -    StringRef Val = C.getArgs().getLastArg(options::OPT__SLASH_Fe,
>> -
>>  options::OPT__SLASH_o)->getValue();
>> -    NamedOutput = MakeCLOutputFilename(C.getArgs(), Val, BaseName,
>> -                                       types::TY_Image);
>> +    StringRef Val =
>> +        C.getArgs()
>> +            .getLastArg(options::OPT__SLASH_Fe, options::OPT__SLASH_o)
>> +            ->getValue();
>> +    NamedOutput =
>> +        MakeCLOutputFilename(C.getArgs(), Val, BaseName,
>> types::TY_Image);
>>    } else if (JA.getType() == types::TY_Image) {
>>      if (IsCLMode()) {
>>        // clang-cl uses BaseName for the executable name.
>> -      NamedOutput = MakeCLOutputFilename(C.getArgs(), "", BaseName,
>> -                                         types::TY_Image);
>> +      NamedOutput =
>> +          MakeCLOutputFilename(C.getArgs(), "", BaseName,
>> types::TY_Image);
>>      } else if (MultipleArchs && BoundArch) {
>>        SmallString<128> Output(getDefaultImageName());
>>        Output += "-";
>> @@ -1806,9 +1799,8 @@ const char *Driver::GetNamedOutputPath(C
>>      if (SameFile) {
>>        StringRef Name = llvm::sys::path::filename(BaseInput);
>>        std::pair<StringRef, StringRef> Split = Name.split('.');
>> -      std::string TmpName =
>> -        GetTemporaryPath(Split.first,
>> -            types::getTypeTempSuffix(JA.getType(), IsCLMode()));
>> +      std::string TmpName = GetTemporaryPath(
>> +          Split.first, types::getTypeTempSuffix(JA.getType(),
>> IsCLMode()));
>>        return C.addTempFile(C.getArgs().MakeArgString(TmpName.c_str()));
>>      }
>>    }
>> @@ -1855,9 +1847,9 @@ std::string Driver::GetFilePath(const ch
>>    return Name;
>>  }
>>
>> -void
>> -Driver::generatePrefixedToolNames(const char *Tool, const ToolChain &TC,
>> -                                  SmallVectorImpl<std::string> &Names)
>> const {
>> +void Driver::generatePrefixedToolNames(
>> +    const char *Tool, const ToolChain &TC,
>> +    SmallVectorImpl<std::string> &Names) const {
>>    // FIXME: Needs a better variable than DefaultTargetTriple
>>    Names.emplace_back(DefaultTargetTriple + "-" + Tool);
>>    Names.emplace_back(Tool);
>> @@ -1909,8 +1901,8 @@ std::string Driver::GetProgramPath(const
>>    return Name;
>>  }
>>
>> -std::string Driver::GetTemporaryPath(StringRef Prefix, const char
>> *Suffix)
>> -  const {
>> +std::string Driver::GetTemporaryPath(StringRef Prefix,
>> +                                     const char *Suffix) const {
>>    SmallString<128> Path;
>>    std::error_code EC = llvm::sys::fs::createTemporaryFile(Prefix,
>> Suffix, Path);
>>    if (EC) {
>> @@ -1984,7 +1976,7 @@ static llvm::Triple computeTargetTriple(
>>        if (Target.getEnvironment() == llvm::Triple::GNUX32)
>>          Target.setEnvironment(llvm::Triple::GNU);
>>      } else if (A->getOption().matches(options::OPT_mx32) &&
>> -             Target.get64BitArchVariant().getArch() ==
>> llvm::Triple::x86_64) {
>> +               Target.get64BitArchVariant().getArch() ==
>> llvm::Triple::x86_64) {
>>        AT = llvm::Triple::x86_64;
>>        Target.setEnvironment(llvm::Triple::GNUX32);
>>      } else if (A->getOption().matches(options::OPT_m32)) {
>> @@ -1992,7 +1984,7 @@ static llvm::Triple computeTargetTriple(
>>        if (Target.getEnvironment() == llvm::Triple::GNUX32)
>>          Target.setEnvironment(llvm::Triple::GNU);
>>      } else if (A->getOption().matches(options::OPT_m16) &&
>> -             Target.get32BitArchVariant().getArch() ==
>> llvm::Triple::x86) {
>> +               Target.get32BitArchVariant().getArch() ==
>> llvm::Triple::x86) {
>>        AT = llvm::Triple::x86;
>>        Target.setEnvironment(llvm::Triple::CODE16);
>>      }
>> @@ -2102,8 +2094,7 @@ const ToolChain &Driver::getToolChain(co
>>
>>  bool Driver::ShouldUseClangCompiler(const JobAction &JA) const {
>>    // Say "no" if there is not exactly one input of a type clang
>> understands.
>> -  if (JA.size() != 1 ||
>> -      !types::isAcceptedByClang((*JA.begin())->getType()))
>> +  if (JA.size() != 1 ||
>> !types::isAcceptedByClang((*JA.begin())->getType()))
>>      return false;
>>
>>    // And say "no" if this is not a kind of action clang understands.
>> @@ -2129,21 +2120,21 @@ bool Driver::GetReleaseVersion(const cha
>>      return false;
>>
>>    char *End;
>> -  Major = (unsigned) strtol(Str, &End, 10);
>> +  Major = (unsigned)strtol(Str, &End, 10);
>>    if (*Str != '\0' && *End == '\0')
>>      return true;
>>    if (*End != '.')
>>      return false;
>>
>> -  Str = End+1;
>> -  Minor = (unsigned) strtol(Str, &End, 10);
>> +  Str = End + 1;
>> +  Minor = (unsigned)strtol(Str, &End, 10);
>>    if (*Str != '\0' && *End == '\0')
>>      return true;
>>    if (*End != '.')
>>      return false;
>>
>> -  Str = End+1;
>> -  Micro = (unsigned) strtol(Str, &End, 10);
>> +  Str = End + 1;
>> +  Micro = (unsigned)strtol(Str, &End, 10);
>>    if (*Str != '\0' && *End == '\0')
>>      return true;
>>    if (Str == End)
>>
>> Modified: cfe/trunk/lib/Driver/ToolChains.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=240791&r1=240790&r2=240791&view=diff
>> <https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_cfe_trunk_lib_Driver_ToolChains.cpp-3Frev-3D240791-26r1-3D240790-26r2-3D240791-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=HQQNmbImUf4F-mcwxbN9TPWVeRmDPUPU4dZwwCB61Pk&s=WLNsTtev5Ph5hub_OPpO99miSigv8DxizT62UyJWRCc&e=>
>>
>> ==============================================================================
>> --- cfe/trunk/lib/Driver/ToolChains.cpp (original)
>> +++ cfe/trunk/lib/Driver/ToolChains.cpp Fri Jun 26 10:47:46 2015
>> @@ -39,9 +39,8 @@ using namespace clang::driver::toolchain
>>  using namespace clang;
>>  using namespace llvm::opt;
>>
>> -MachO::MachO(const Driver &D, const llvm::Triple &Triple,
>> -                       const ArgList &Args)
>> -  : ToolChain(D, Triple, Args) {
>> +MachO::MachO(const Driver &D, const llvm::Triple &Triple, const ArgList
>> &Args)
>> +    : ToolChain(D, Triple, Args) {
>>    // We expect 'as', 'ld', etc. to be adjacent to our install dir.
>>    getProgramPaths().push_back(getDriver().getInstalledDir());
>>    if (getDriver().getInstalledDir() != getDriver().Dir)
>> @@ -62,9 +61,7 @@ types::ID MachO::LookupTypeForExtension(
>>    return Ty;
>>  }
>>
>> -bool MachO::HasNativeLLVMSupport() const {
>> -  return true;
>> -}
>> +bool MachO::HasNativeLLVMSupport() const { return true; }
>>
>>  /// Darwin provides an ARC runtime starting in MacOS X 10.7 and iOS 5.0.
>>  ObjCRuntime Darwin::getDefaultObjCRuntime(bool isNonFragile) const {
>> @@ -90,20 +87,20 @@ bool Darwin::hasBlocksRuntime() const {
>>  // other assumptions. Maybe MachO should consider standardising
>>  // their nomenclature.
>>  static const char *ArmMachOArchName(StringRef Arch) {
>> -  return llvm::StringSwitch<const char*>(Arch)
>> -    .Case("armv6k", "armv6")
>> -    .Case("armv6m", "armv6m")
>> -    .Case("armv5tej", "armv5")
>> -    .Case("xscale", "xscale")
>> -    .Case("armv4t", "armv4t")
>> -    .Case("armv7", "armv7")
>> -    .Cases("armv7a", "armv7-a", "armv7")
>> -    .Cases("armv7r", "armv7-r", "armv7")
>> -    .Cases("armv7em", "armv7e-m", "armv7em")
>> -    .Cases("armv7k", "armv7-k", "armv7k")
>> -    .Cases("armv7m", "armv7-m", "armv7m")
>> -    .Cases("armv7s", "armv7-s", "armv7s")
>> -    .Default(nullptr);
>> +  return llvm::StringSwitch<const char *>(Arch)
>> +      .Case("armv6k", "armv6")
>> +      .Case("armv6m", "armv6m")
>> +      .Case("armv5tej", "armv5")
>> +      .Case("xscale", "xscale")
>> +      .Case("armv4t", "armv4t")
>> +      .Case("armv7", "armv7")
>> +      .Cases("armv7a", "armv7-a", "armv7")
>> +      .Cases("armv7r", "armv7-r", "armv7")
>> +      .Cases("armv7em", "armv7e-m", "armv7em")
>> +      .Cases("armv7k", "armv7-k", "armv7k")
>> +      .Cases("armv7m", "armv7-m", "armv7m")
>> +      .Cases("armv7s", "armv7-s", "armv7s")
>> +      .Default(nullptr);
>>  }
>>
>>  static const char *ArmMachOArchNameCPU(StringRef CPU) {
>> @@ -159,15 +156,12 @@ StringRef MachO::getMachOArchName(const
>>    }
>>  }
>>
>> -Darwin::~Darwin() {
>> -}
>> -
>> -MachO::~MachO() {
>> -}
>> +Darwin::~Darwin() {}
>>
>> +MachO::~MachO() {}
>>
>>  std::string MachO::ComputeEffectiveClangTriple(const ArgList &Args,
>> -                                                    types::ID InputType)
>> const {
>> +                                               types::ID InputType)
>> const {
>>    llvm::Triple Triple(ComputeLLVMTriple(Args, InputType));
>>
>>    return Triple.getTriple();
>> @@ -305,7 +299,7 @@ void MachO::AddLinkRuntimeLib(const ArgL
>>  }
>>
>>  void Darwin::addProfileRTLibs(const ArgList &Args,
>> -                             ArgStringList &CmdArgs) const {
>> +                              ArgStringList &CmdArgs) const {
>>    if (!(Args.hasFlag(options::OPT_fprofile_arcs,
>> options::OPT_fno_profile_arcs,
>>                       false) ||
>>          Args.hasArg(options::OPT_fprofile_generate) ||
>> @@ -334,10 +328,11 @@ void DarwinClang::AddLinkSanitizerLibArg
>>    }
>>    assert(isTargetMacOS() || isTargetIOSSimulator());
>>    StringRef OS = isTargetMacOS() ? "osx" : "iossim";
>> -  AddLinkRuntimeLib(Args, CmdArgs, (Twine("libclang_rt.") + Sanitizer +
>> "_" +
>> -                                    OS + "_dynamic.dylib").str(),
>> -                    /*AlwaysLink*/ true, /*IsEmbedded*/ false,
>> -                    /*AddRPath*/ true);
>> +  AddLinkRuntimeLib(
>> +      Args, CmdArgs,
>> +      (Twine("libclang_rt.") + Sanitizer + "_" + OS +
>> "_dynamic.dylib").str(),
>> +      /*AlwaysLink*/ true, /*IsEmbedded*/ false,
>> +      /*AddRPath*/ true);
>>
>>    if (GetCXXStdlibType(Args) == ToolChain::CST_Libcxx) {
>>      // Add explicit dependcy on -lc++abi, as -lc++ doesn't re-export
>> @@ -354,7 +349,7 @@ void DarwinClang::AddLinkRuntimeLibArgs(
>>      break;
>>    default:
>>      getDriver().Diag(diag::err_drv_unsupported_rtlib_for_platform)
>> -      << Args.getLastArg(options::OPT_rtlib_EQ)->getValue() << "darwin";
>> +        << Args.getLastArg(options::OPT_rtlib_EQ)->getValue() <<
>> "darwin";
>>      return;
>>    }
>>
>> @@ -369,12 +364,10 @@ void DarwinClang::AddLinkRuntimeLibArgs(
>>    // cares. This is useful in situations where someone wants to
>> statically link
>>    // something like libstdc++, and needs its runtime support routines.
>>    if (const Arg *A = Args.getLastArg(options::OPT_static_libgcc)) {
>> -    getDriver().Diag(diag::err_drv_unsupported_opt)
>> -      << A->getAsString(Args);
>> +    getDriver().Diag(diag::err_drv_unsupported_opt) <<
>> A->getAsString(Args);
>>      return;
>>    }
>>
>> -
>>    const SanitizerArgs &Sanitize = getSanitizerArgs();
>>    if (Sanitize.needsAsanRt())
>>      AddLinkSanitizerLibArgs(Args, CmdArgs, "asan");
>> @@ -440,7 +433,7 @@ void Darwin::AddDeploymentTarget(Derived
>>        if (llvm::sys::path::is_absolute(env) &&
>> llvm::sys::fs::exists(env) &&
>>            StringRef(env) != "/") {
>>          Args.append(Args.MakeSeparateArg(
>> -                      nullptr, Opts.getOption(options::OPT_isysroot),
>> env));
>> +            nullptr, Opts.getOption(options::OPT_isysroot), env));
>>        }
>>      }
>>    }
>> @@ -450,8 +443,7 @@ void Darwin::AddDeploymentTarget(Derived
>>
>>    if (OSXVersion && iOSVersion) {
>>      getDriver().Diag(diag::err_drv_argument_not_allowed_with)
>> -          << OSXVersion->getAsString(Args)
>> -          << iOSVersion->getAsString(Args);
>> +        << OSXVersion->getAsString(Args) <<
>> iOSVersion->getAsString(Args);
>>      iOSVersion = nullptr;
>>    } else if (!OSXVersion && !iOSVersion) {
>>      // If no deployment target was specified on the command line, check
>> for
>> @@ -547,18 +539,18 @@ void Darwin::AddDeploymentTarget(Derived
>>    bool HadExtra;
>>    if (Platform == MacOS) {
>>      assert(!iOSVersion && "Unknown target platform!");
>> -    if (!Driver::GetReleaseVersion(OSXVersion->getValue(), Major, Minor,
>> -                                   Micro, HadExtra) || HadExtra ||
>> -        Major != 10 || Minor >= 100 || Micro >= 100)
>> +    if (!Driver::GetReleaseVersion(OSXVersion->getValue(), Major, Minor,
>> Micro,
>> +                                   HadExtra) ||
>> +        HadExtra || Major != 10 || Minor >= 100 || Micro >= 100)
>>        getDriver().Diag(diag::err_drv_invalid_version_number)
>> -        << OSXVersion->getAsString(Args);
>> +          << OSXVersion->getAsString(Args);
>>    } else if (Platform == IPhoneOS) {
>>      assert(iOSVersion && "Unknown target platform!");
>> -    if (!Driver::GetReleaseVersion(iOSVersion->getValue(), Major, Minor,
>> -                                   Micro, HadExtra) || HadExtra ||
>> -        Major >= 10 || Minor >= 100 || Micro >= 100)
>> +    if (!Driver::GetReleaseVersion(iOSVersion->getValue(), Major, Minor,
>> Micro,
>> +                                   HadExtra) ||
>> +        HadExtra || Major >= 10 || Minor >= 100 || Micro >= 100)
>>        getDriver().Diag(diag::err_drv_invalid_version_number)
>> -        << iOSVersion->getAsString(Args);
>> +          << iOSVersion->getAsString(Args);
>>    } else
>>      llvm_unreachable("unknown kind of Darwin platform");
>>
>> @@ -658,10 +650,11 @@ DerivedArgList *MachO::TranslateArgs(con
>>        // Skip this argument unless the architecture matches either the
>> toolchain
>>        // triple arch, or the arch being bound.
>>        llvm::Triple::ArchType XarchArch =
>> -        tools::darwin::getArchTypeForMachOArchName(A->getValue(0));
>> -      if (!(XarchArch == getArch()  ||
>> -            (BoundArch && XarchArch ==
>> -             tools::darwin::getArchTypeForMachOArchName(BoundArch))))
>> +          tools::darwin::getArchTypeForMachOArchName(A->getValue(0));
>> +      if (!(XarchArch == getArch() ||
>> +            (BoundArch &&
>> +             XarchArch ==
>> +                 tools::darwin::getArchTypeForMachOArchName(BoundArch))))
>>          continue;
>>
>>        Arg *OriginalArg = A;
>> @@ -679,11 +672,11 @@ DerivedArgList *MachO::TranslateArgs(con
>>        // like -O4 are going to slip through.
>>        if (!XarchArg || Index > Prev + 1) {
>>          getDriver().Diag(diag::err_drv_invalid_Xarch_argument_with_args)
>> -          << A->getAsString(Args);
>> +            << A->getAsString(Args);
>>          continue;
>>        } else if (XarchArg->getOption().hasFlag(options::DriverOption)) {
>>          getDriver().Diag(diag::err_drv_invalid_Xarch_argument_isdriver)
>> -          << A->getAsString(Args);
>> +            << A->getAsString(Args);
>>          continue;
>>        }
>>
>> @@ -708,7 +701,7 @@ DerivedArgList *MachO::TranslateArgs(con
>>      // Sob. These is strictly gcc compatible for the time being. Apple
>>      // gcc translates options twice, which means that self-expanding
>>      // options add duplicates.
>> -    switch ((options::ID) A->getOption().getID()) {
>> +    switch ((options::ID)A->getOption().getID()) {
>>      default:
>>        DAL->append(A);
>>        break;
>> @@ -720,20 +713,19 @@ DerivedArgList *MachO::TranslateArgs(con
>>        break;
>>
>>      case options::OPT_dependency_file:
>> -      DAL->AddSeparateArg(A, Opts.getOption(options::OPT_MF),
>> -                          A->getValue());
>> +      DAL->AddSeparateArg(A, Opts.getOption(options::OPT_MF),
>> A->getValue());
>>        break;
>>
>>      case options::OPT_gfull:
>>        DAL->AddFlagArg(A, Opts.getOption(options::OPT_g_Flag));
>> -      DAL->AddFlagArg(A,
>> -
>>  Opts.getOption(options::OPT_fno_eliminate_unused_debug_symbols));
>> +      DAL->AddFlagArg(
>> +          A,
>> Opts.getOption(options::OPT_fno_eliminate_unused_debug_symbols));
>>        break;
>>
>>      case options::OPT_gused:
>>        DAL->AddFlagArg(A, Opts.getOption(options::OPT_g_Flag));
>> -      DAL->AddFlagArg(A,
>> -
>>  Opts.getOption(options::OPT_feliminate_unused_debug_symbols));
>> +      DAL->AddFlagArg(
>> +          A,
>> Opts.getOption(options::OPT_feliminate_unused_debug_symbols));
>>        break;
>>
>>      case options::OPT_shared:
>> @@ -754,8 +746,8 @@ DerivedArgList *MachO::TranslateArgs(con
>>        break;
>>
>>      case options::OPT_Wno_nonportable_cfstrings:
>> -      DAL->AddFlagArg(A,
>> -
>>  Opts.getOption(options::OPT_mno_warn_nonportable_cfstrings));
>> +      DAL->AddFlagArg(
>> +          A,
>> Opts.getOption(options::OPT_mno_warn_nonportable_cfstrings));
>>        break;
>>
>>      case options::OPT_fpascal_strings:
>> @@ -871,7 +863,6 @@ void MachO::AddLinkRuntimeLibArgs(const
>>    AddLinkRuntimeLib(Args, CmdArgs, CompilerRT, false, true);
>>  }
>>
>> -
>>  DerivedArgList *Darwin::TranslateArgs(const DerivedArgList &Args,
>>                                        const char *BoundArch) const {
>>    // First get the generic Apple args, before moving onto
>> Darwin-specific ones.
>> @@ -892,7 +883,7 @@ DerivedArgList *Darwin::TranslateArgs(co
>>    // but we can't check the deployment target in the translation code
>> until
>>    // it is set here.
>>    if (isTargetIOSBased() && !isIPhoneOSVersionLT(6, 0)) {
>> -    for (ArgList::iterator it = DAL->begin(), ie = DAL->end(); it != ie;
>> ) {
>> +    for (ArgList::iterator it = DAL->begin(), ie = DAL->end(); it !=
>> ie;) {
>>        Arg *A = *it;
>>        ++it;
>>        if (A->getOption().getID() != options::OPT_mkernel &&
>> @@ -924,8 +915,7 @@ DerivedArgList *Darwin::TranslateArgs(co
>>        where = "iOS 5.0";
>>
>>      if (where != StringRef()) {
>> -      getDriver().Diag(clang::diag::err_drv_invalid_libcxx_deployment)
>> -        << where;
>> +      getDriver().Diag(clang::diag::err_drv_invalid_libcxx_deployment)
>> << where;
>>      }
>>    }
>>
>> @@ -948,13 +938,9 @@ bool Darwin::UseSjLjExceptions() const {
>>            getTriple().getArch() == llvm::Triple::thumb);
>>  }
>>
>> -bool MachO::isPICDefault() const {
>> -  return true;
>> -}
>> +bool MachO::isPICDefault() const { return true; }
>>
>> -bool MachO::isPIEDefault() const {
>> -  return false;
>> -}
>> +bool MachO::isPIEDefault() const { return false; }
>>
>>  bool MachO::isPICDefaultForced() const {
>>    return (getArch() == llvm::Triple::x86_64 ||
>> @@ -1068,12 +1054,10 @@ void Darwin::addStartObjectFileArgs(cons
>>    }
>>  }
>>
>> -bool Darwin::SupportsObjCGC() const {
>> -  return isTargetMacOS();
>> -}
>> +bool Darwin::SupportsObjCGC() const { return isTargetMacOS(); }
>>
>>  void Darwin::CheckObjCARC() const {
>> -  if (isTargetIOSBased()|| (isTargetMacOS() && !isMacosxVersionLT(10,
>> 6)))
>> +  if (isTargetIOSBased() || (isTargetMacOS() && !isMacosxVersionLT(10,
>> 6)))
>>      return;
>>    getDriver().Diag(diag::err_arc_unsupported_on_toolchain);
>>  }
>> @@ -1099,17 +1083,15 @@ SanitizerMask Darwin::getSupportedSaniti
>>  /// This is the primary means of forming GCCVersion objects.
>>  /*static*/
>>  Generic_GCC::GCCVersion Linux::GCCVersion::Parse(StringRef VersionText) {
>> -  const GCCVersion BadVersion = { VersionText.str(), -1, -1, -1, "", "",
>> "" };
>> +  const GCCVersion BadVersion = {VersionText.str(), -1, -1, -1, "", "",
>> ""};
>>    std::pair<StringRef, StringRef> First = VersionText.split('.');
>>    std::pair<StringRef, StringRef> Second = First.second.split('.');
>>
>> -  GCCVersion GoodVersion = { VersionText.str(), -1, -1, -1, "", "", "" };
>> -  if (First.first.getAsInteger(10, GoodVersion.Major) ||
>> -      GoodVersion.Major < 0)
>> +  GCCVersion GoodVersion = {VersionText.str(), -1, -1, -1, "", "", ""};
>> +  if (First.first.getAsInteger(10, GoodVersion.Major) ||
>> GoodVersion.Major < 0)
>>      return BadVersion;
>>    GoodVersion.MajorStr = First.first.str();
>> -  if (Second.first.getAsInteger(10, GoodVersion.Minor) ||
>> -      GoodVersion.Minor < 0)
>> +  if (Second.first.getAsInteger(10, GoodVersion.Minor) ||
>> GoodVersion.Minor < 0)
>>      return BadVersion;
>>    GoodVersion.MinorStr = Second.first.str();
>>
>> @@ -1186,12 +1168,11 @@ static llvm::StringRef getGCCToolchainDi
>>  /// should instead pull the target out of the driver. This is currently
>>  /// necessary because the driver doesn't store the final version of the
>> target
>>  /// triple.
>> -void
>> -Generic_GCC::GCCInstallationDetector::init(
>> +void Generic_GCC::GCCInstallationDetector::init(
>>      const Driver &D, const llvm::Triple &TargetTriple, const ArgList
>> &Args) {
>> -  llvm::Triple BiarchVariantTriple =
>> -      TargetTriple.isArch32Bit() ? TargetTriple.get64BitArchVariant()
>> -                                 : TargetTriple.get32BitArchVariant();
>> +  llvm::Triple BiarchVariantTriple = TargetTriple.isArch32Bit()
>> +                                         ?
>> TargetTriple.get64BitArchVariant()
>> +                                         :
>> TargetTriple.get32BitArchVariant();
>>    // The library directories which may contain GCC installations.
>>    SmallVector<StringRef, 4> CandidateLibDirs, CandidateBiarchLibDirs;
>>    // The compatible GCC triples for this particular architecture.
>> @@ -1281,91 +1262,82 @@ bool Generic_GCC::GCCInstallationDetecto
>>    // Declare a bunch of static data sets that we'll select between
>> below. These
>>    // are specifically designed to always refer to string literals to
>> avoid any
>>    // lifetime or initialization issues.
>> -  static const char *const AArch64LibDirs[] = { "/lib64", "/lib" };
>> -  static const char *const AArch64Triples[] = { "aarch64-none-linux-gnu",
>> -                                                "aarch64-linux-gnu",
>> -                                                "aarch64-linux-android",
>> -                                                "aarch64-redhat-linux" };
>> -  static const char *const AArch64beLibDirs[] = { "/lib" };
>> -  static const char *const AArch64beTriples[] = {
>> "aarch64_be-none-linux-gnu",
>> -                                                  "aarch64_be-linux-gnu"
>> };
>> -
>> -  static const char *const ARMLibDirs[] = { "/lib" };
>> -  static const char *const ARMTriples[] = { "arm-linux-gnueabi",
>> -                                            "arm-linux-androideabi" };
>> -  static const char *const ARMHFTriples[] = { "arm-linux-gnueabihf",
>> -
>> "armv7hl-redhat-linux-gnueabi" };
>> -  static const char *const ARMebLibDirs[] = { "/lib" };
>> -  static const char *const ARMebTriples[] = { "armeb-linux-gnueabi",
>> -                                              "armeb-linux-androideabi"
>> };
>> -  static const char *const ARMebHFTriples[] = { "armeb-linux-gnueabihf",
>> -
>> "armebv7hl-redhat-linux-gnueabi" };
>> +  static const char *const AArch64LibDirs[] = {"/lib64", "/lib"};
>> +  static const char *const AArch64Triples[] = {
>> +      "aarch64-none-linux-gnu", "aarch64-linux-gnu",
>> "aarch64-linux-android",
>> +      "aarch64-redhat-linux"};
>> +  static const char *const AArch64beLibDirs[] = {"/lib"};
>> +  static const char *const AArch64beTriples[] =
>> {"aarch64_be-none-linux-gnu",
>> +                                                 "aarch64_be-linux-gnu"};
>> +
>> +  static const char *const ARMLibDirs[] = {"/lib"};
>> +  static const char *const ARMTriples[] = {"arm-linux-gnueabi",
>> +                                           "arm-linux-androideabi"};
>> +  static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
>> +
>>  "armv7hl-redhat-linux-gnueabi"};
>> +  static const char *const ARMebLibDirs[] = {"/lib"};
>> +  static const char *const ARMebTriples[] = {"armeb-linux-gnueabi",
>> +                                             "armeb-linux-androideabi"};
>> +  static const char *const ARMebHFTriples[] = {
>> +      "armeb-linux-gnueabihf", "armebv7hl-redhat-linux-gnueabi"};
>>
>> -  static const char *const X86_64LibDirs[] = { "/lib64", "/lib" };
>> +  static const char *const X86_64LibDirs[] = {"/lib64", "/lib"};
>>    static const char *const X86_64Triples[] = {
>> -    "x86_64-linux-gnu", "x86_64-unknown-linux-gnu",
>> "x86_64-pc-linux-gnu",
>> -    "x86_64-redhat-linux6E", "x86_64-redhat-linux", "x86_64-suse-linux",
>> -    "x86_64-manbo-linux-gnu", "x86_64-linux-gnu",
>> "x86_64-slackware-linux",
>> -    "x86_64-linux-android", "x86_64-unknown-linux"
>> -  };
>> -  static const char *const X32LibDirs[] = { "/libx32" };
>> -  static const char *const X86LibDirs[] = { "/lib32", "/lib" };
>> +      "x86_64-linux-gnu",       "x86_64-unknown-linux-gnu",
>> +      "x86_64-pc-linux-gnu",    "x86_64-redhat-linux6E",
>> +      "x86_64-redhat-linux",    "x86_64-suse-linux",
>> +      "x86_64-manbo-linux-gnu", "x86_64-linux-gnu",
>> +      "x86_64-slackware-linux", "x86_64-linux-android",
>> +      "x86_64-unknown-linux"};
>> +  static const char *const X32LibDirs[] = {"/libx32"};
>> +  static const char *const X86LibDirs[] = {"/lib32", "/lib"};
>>    static const char *const X86Triples[] = {
>> -    "i686-linux-gnu", "i686-pc-linux-gnu", "i486-linux-gnu",
>> "i386-linux-gnu",
>> -    "i386-redhat-linux6E", "i686-redhat-linux", "i586-redhat-linux",
>> -    "i386-redhat-linux", "i586-suse-linux", "i486-slackware-linux",
>> -    "i686-montavista-linux", "i686-linux-android", "i586-linux-gnu"
>> -  };
>> -
>> -  static const char *const MIPSLibDirs[] = { "/lib" };
>> -  static const char *const MIPSTriples[] = { "mips-linux-gnu",
>> -                                             "mips-mti-linux-gnu",
>> -                                             "mips-img-linux-gnu" };
>> -  static const char *const MIPSELLibDirs[] = { "/lib" };
>> -  static const char *const MIPSELTriples[] = { "mipsel-linux-gnu",
>> -                                               "mipsel-linux-android",
>> -                                               "mips-img-linux-gnu" };
>> -
>> -  static const char *const MIPS64LibDirs[] = { "/lib64", "/lib" };
>> -  static const char *const MIPS64Triples[] = { "mips64-linux-gnu",
>> -                                               "mips-mti-linux-gnu",
>> -                                               "mips-img-linux-gnu",
>> -                                               "mips64-linux-gnuabi64" };
>> -  static const char *const MIPS64ELLibDirs[] = { "/lib64", "/lib" };
>> -  static const char *const MIPS64ELTriples[] = { "mips64el-linux-gnu",
>> -                                                 "mips-mti-linux-gnu",
>> -                                                 "mips-img-linux-gnu",
>> -
>>  "mips64el-linux-android",
>> -
>>  "mips64el-linux-gnuabi64" };
>> +      "i686-linux-gnu",       "i686-pc-linux-gnu",     "i486-linux-gnu",
>> +      "i386-linux-gnu",       "i386-redhat-linux6E",
>>  "i686-redhat-linux",
>> +      "i586-redhat-linux",    "i386-redhat-linux",     "i586-suse-linux",
>> +      "i486-slackware-linux", "i686-montavista-linux",
>> "i686-linux-android",
>> +      "i586-linux-gnu"};
>> +
>> +  static const char *const MIPSLibDirs[] = {"/lib"};
>> +  static const char *const MIPSTriples[] = {
>> +      "mips-linux-gnu", "mips-mti-linux-gnu", "mips-img-linux-gnu"};
>> +  static const char *const MIPSELLibDirs[] = {"/lib"};
>> +  static const char *const MIPSELTriples[] = {
>> +      "mipsel-linux-gnu", "mipsel-linux-android", "mips-img-linux-gnu"};
>> +
>> +  static const char *const MIPS64LibDirs[] = {"/lib64", "/lib"};
>> +  static const char *const MIPS64Triples[] = {
>> +      "mips64-linux-gnu", "mips-mti-linux-gnu", "mips-img-linux-gnu",
>> +      "mips64-linux-gnuabi64"};
>> +  static const char *const MIPS64ELLibDirs[] = {"/lib64", "/lib"};
>> +  static const char *const MIPS64ELTriples[] = {
>> +      "mips64el-linux-gnu", "mips-mti-linux-gnu", "mips-img-linux-gnu",
>> +      "mips64el-linux-android", "mips64el-linux-gnuabi64"};
>>
>> -  static const char *const PPCLibDirs[] = { "/lib32", "/lib" };
>> +  static const char *const PPCLibDirs[] = {"/lib32", "/lib"};
>>    static const char *const PPCTriples[] = {
>> -    "powerpc-linux-gnu", "powerpc-unknown-linux-gnu",
>> "powerpc-linux-gnuspe",
>> -    "powerpc-suse-linux", "powerpc-montavista-linuxspe"
>> -  };
>> -  static const char *const PPC64LibDirs[] = { "/lib64", "/lib" };
>> -  static const char *const PPC64Triples[] = { "powerpc64-linux-gnu",
>> -
>> "powerpc64-unknown-linux-gnu",
>> -                                              "powerpc64-suse-linux",
>> -                                              "ppc64-redhat-linux" };
>> -  static const char *const PPC64LELibDirs[] = { "/lib64", "/lib" };
>> -  static const char *const PPC64LETriples[] = { "powerpc64le-linux-gnu",
>> -
>> "powerpc64le-unknown-linux-gnu",
>> -                                                "powerpc64le-suse-linux",
>> -                                                "ppc64le-redhat-linux" };
>> -
>> -  static const char *const SPARCv8LibDirs[] = { "/lib32", "/lib" };
>> -  static const char *const SPARCv8Triples[] = { "sparc-linux-gnu",
>> -                                                "sparcv8-linux-gnu" };
>> -  static const char *const SPARCv9LibDirs[] = { "/lib64", "/lib" };
>> -  static const char *const SPARCv9Triples[] = { "sparc64-linux-gnu",
>> -                                                "sparcv9-linux-gnu" };
>> +      "powerpc-linux-gnu", "powerpc-unknown-linux-gnu",
>> "powerpc-linux-gnuspe",
>> +      "powerpc-suse-linux", "powerpc-montavista-linuxspe"};
>> +  static const char *const PPC64LibDirs[] = {"/lib64", "/lib"};
>> +  static const char *const PPC64Triples[] = {
>> +      "powerpc64-linux-gnu", "powerpc64-unknown-linux-gnu",
>> +      "powerpc64-suse-linux", "ppc64-redhat-linux"};
>> +  static const char *const PPC64LELibDirs[] = {"/lib64", "/lib"};
>> +  static const char *const PPC64LETriples[] = {
>> +      "powerpc64le-linux-gnu", "powerpc64le-unknown-linux-gnu",
>> +      "powerpc64le-suse-linux", "ppc64le-redhat-linux"};
>> +
>> +  static const char *const SPARCv8LibDirs[] = {"/lib32", "/lib"};
>> +  static const char *const SPARCv8Triples[] = {"sparc-linux-gnu",
>> +                                               "sparcv8-linux-gnu"};
>> +  static const char *const SPARCv9LibDirs[] = {"/lib64", "/lib"};
>> +  static const char *const SPARCv9Triples[] = {"sparc64-linux-gnu",
>> +                                               "sparcv9-linux-gnu"};
>>
>> -  static const char *const SystemZLibDirs[] = { "/lib64", "/lib" };
>> +  static const char *const SystemZLibDirs[] = {"/lib64", "/lib"};
>>    static const char *const SystemZTriples[] = {
>> -    "s390x-linux-gnu", "s390x-unknown-linux-gnu", "s390x-ibm-linux-gnu",
>> -    "s390x-suse-linux", "s390x-redhat-linux"
>> -  };
>> +      "s390x-linux-gnu", "s390x-unknown-linux-gnu",
>> "s390x-ibm-linux-gnu",
>> +      "s390x-suse-linux", "s390x-redhat-linux"};
>>
>>    using std::begin;
>>    using std::end;
>> @@ -1533,14 +1505,12 @@ static bool isMipsEL(llvm::Triple::ArchT
>>  }
>>
>>  static bool isMips16(const ArgList &Args) {
>> -  Arg *A = Args.getLastArg(options::OPT_mips16,
>> -                           options::OPT_mno_mips16);
>> +  Arg *A = Args.getLastArg(options::OPT_mips16, options::OPT_mno_mips16);
>>    return A && A->getOption().matches(options::OPT_mips16);
>>  }
>>
>>  static bool isMicroMips(const ArgList &Args) {
>> -  Arg *A = Args.getLastArg(options::OPT_mmicromips,
>> -                           options::OPT_mno_micromips);
>> +  Arg *A = Args.getLastArg(options::OPT_mmicromips,
>> options::OPT_mno_micromips);
>>    return A && A->getOption().matches(options::OPT_mmicromips);
>>  }
>>
>> @@ -1561,8 +1531,7 @@ static Multilib makeMultilib(StringRef c
>>  }
>>
>>  static bool findMIPSMultilibs(const llvm::Triple &TargetTriple,
>> StringRef Path,
>> -                              const ArgList &Args,
>> -                              DetectedMultilibs &Result) {
>> +                              const ArgList &Args, DetectedMultilibs
>> &Result) {
>>    // Some MIPS toolchains put libraries and object files compiled
>>    // using different options in to the sub-directoris which names
>>    // reflects the flags used for compilation. For example sysroot
>> @@ -1594,181 +1563,182 @@ static bool findMIPSMultilibs(const llvm
>>    MultilibSet FSFMipsMultilibs;
>>    {
>>      auto MArchMips32 = makeMultilib("/mips32")
>> -
>> .flag("+m32").flag("-m64").flag("-mmicromips").flag("+march=mips32");
>> +                           .flag("+m32")
>> +                           .flag("-m64")
>> +                           .flag("-mmicromips")
>> +                           .flag("+march=mips32");
>>
>>      auto MArchMicroMips = makeMultilib("/micromips")
>> -      .flag("+m32").flag("-m64").flag("+mmicromips");
>> +                              .flag("+m32")
>> +                              .flag("-m64")
>> +                              .flag("+mmicromips");
>>
>>      auto MArchMips64r2 = makeMultilib("/mips64r2")
>> -      .flag("-m32").flag("+m64").flag("+march=mips64r2");
>> +                             .flag("-m32")
>> +                             .flag("+m64")
>> +                             .flag("+march=mips64r2");
>>
>> -    auto MArchMips64 = makeMultilib("/mips64")
>> -      .flag("-m32").flag("+m64").flag("-march=mips64r2");
>> +    auto MArchMips64 =
>> makeMultilib("/mips64").flag("-m32").flag("+m64").flag(
>> +        "-march=mips64r2");
>>
>>      auto MArchDefault = makeMultilib("")
>> -
>> .flag("+m32").flag("-m64").flag("-mmicromips").flag("+march=mips32r2");
>> -
>> -    auto Mips16 = makeMultilib("/mips16")
>> -      .flag("+mips16");
>> -
>> -    auto UCLibc = makeMultilib("/uclibc")
>> -      .flag("+muclibc");
>> -
>> -    auto MAbi64 = makeMultilib("/64")
>> -      .flag("+mabi=n64").flag("-mabi=n32").flag("-m32");
>> -
>> -    auto BigEndian = makeMultilib("")
>> -      .flag("+EB").flag("-EL");
>> -
>> -    auto LittleEndian = makeMultilib("/el")
>> -      .flag("+EL").flag("-EB");
>> -
>> -    auto SoftFloat = makeMultilib("/sof")
>> -      .flag("+msoft-float");
>> -
>> -    auto Nan2008 = makeMultilib("/nan2008")
>> -      .flag("+mnan=2008");
>> -
>> -    FSFMipsMultilibs = MultilibSet()
>> -      .Either(MArchMips32, MArchMicroMips,
>> -              MArchMips64r2, MArchMips64, MArchDefault)
>> -      .Maybe(UCLibc)
>> -      .Maybe(Mips16)
>> -      .FilterOut("/mips64/mips16")
>> -      .FilterOut("/mips64r2/mips16")
>> -      .FilterOut("/micromips/mips16")
>> -      .Maybe(MAbi64)
>> -      .FilterOut("/micromips/64")
>> -      .FilterOut("/mips32/64")
>> -      .FilterOut("^/64")
>> -      .FilterOut("/mips16/64")
>> -      .Either(BigEndian, LittleEndian)
>> -      .Maybe(SoftFloat)
>> -      .Maybe(Nan2008)
>> -      .FilterOut(".*sof/nan2008")
>> -      .FilterOut(NonExistent)
>> -      .setIncludeDirsCallback([](
>> -          StringRef InstallDir, StringRef TripleStr, const Multilib &M) {
>> -        std::vector<std::string> Dirs;
>> -        Dirs.push_back((InstallDir + "/include").str());
>> -        std::string SysRootInc = InstallDir.str() +
>> "/../../../../sysroot";
>> -        if (StringRef(M.includeSuffix()).startswith("/uclibc"))
>> -          Dirs.push_back(SysRootInc + "/uclibc/usr/include");
>> -        else
>> -          Dirs.push_back(SysRootInc + "/usr/include");
>> -        return Dirs;
>> -      });
>> +                            .flag("+m32")
>> +                            .flag("-m64")
>> +                            .flag("-mmicromips")
>> +                            .flag("+march=mips32r2");
>> +
>> +    auto Mips16 = makeMultilib("/mips16").flag("+mips16");
>> +
>> +    auto UCLibc = makeMultilib("/uclibc").flag("+muclibc");
>> +
>> +    auto MAbi64 =
>> +
>> makeMultilib("/64").flag("+mabi=n64").flag("-mabi=n32").flag("-m32");
>> +
>> +    auto BigEndian = makeMultilib("").flag("+EB").flag("-EL");
>> +
>> +    auto LittleEndian = makeMultilib("/el").flag("+EL").flag("-EB");
>> +
>> +    auto SoftFloat = makeMultilib("/sof").flag("+msoft-float");
>> +
>> +    auto Nan2008 = makeMultilib("/nan2008").flag("+mnan=2008");
>> +
>> +    FSFMipsMultilibs =
>> +        MultilibSet()
>> +            .Either(MArchMips32, MArchMicroMips, MArchMips64r2,
>> MArchMips64,
>> +                    MArchDefault)
>> +            .Maybe(UCLibc)
>> +            .Maybe(Mips16)
>> +            .FilterOut("/mips64/mips16")
>> +            .FilterOut("/mips64r2/mips16")
>> +            .FilterOut("/micromips/mips16")
>> +            .Maybe(MAbi64)
>> +            .FilterOut("/micromips/64")
>> +            .FilterOut("/mips32/64")
>> +            .FilterOut("^/64")
>> +            .FilterOut("/mips16/64")
>> +            .Either(BigEndian, LittleEndian)
>> +            .Maybe(SoftFloat)
>> +            .Maybe(Nan2008)
>> +            .FilterOut(".*sof/nan2008")
>> +            .FilterOut(NonExistent)
>> +            .setIncludeDirsCallback([](StringRef InstallDir,
>> +                                       StringRef TripleStr, const
>> Multilib &M) {
>> +              std::vector<std::string> Dirs;
>> +              Dirs.push_back((InstallDir + "/include").str());
>> +              std::string SysRootInc =
>> +                  InstallDir.str() + "/../../../../sysroot";
>> +              if (StringRef(M.includeSuffix()).startswith("/uclibc"))
>> +                Dirs.push_back(SysRootInc + "/uclibc/usr/include");
>> +              else
>> +                Dirs.push_back(SysRootInc + "/usr/include");
>> +              return Dirs;
>> +            });
>>    }
>>
>>    // Check for Code Sourcery toolchain multilibs
>>    MultilibSet CSMipsMultilibs;
>>    {
>> -    auto MArchMips16 = makeMultilib("/mips16")
>> -      .flag("+m32").flag("+mips16");
>> +    auto MArchMips16 =
>> makeMultilib("/mips16").flag("+m32").flag("+mips16");
>>
>> -    auto MArchMicroMips = makeMultilib("/micromips")
>> -      .flag("+m32").flag("+mmicromips");
>> +    auto MArchMicroMips =
>> +        makeMultilib("/micromips").flag("+m32").flag("+mmicromips");
>>
>> -    auto MArchDefault = makeMultilib("")
>> -      .flag("-mips16").flag("-mmicromips");
>> +    auto MArchDefault =
>> makeMultilib("").flag("-mips16").flag("-mmicromips");
>>
>> -    auto UCLibc = makeMultilib("/uclibc")
>> -      .flag("+muclibc");
>> +    auto UCLibc = makeMultilib("/uclibc").flag("+muclibc");
>>
>> -    auto SoftFloat = makeMultilib("/soft-float")
>> -      .flag("+msoft-float");
>> +    auto SoftFloat = makeMultilib("/soft-float").flag("+msoft-float");
>>
>> -    auto Nan2008 = makeMultilib("/nan2008")
>> -      .flag("+mnan=2008");
>> +    auto Nan2008 = makeMultilib("/nan2008").flag("+mnan=2008");
>>
>> -    auto DefaultFloat = makeMultilib("")
>> -      .flag("-msoft-float").flag("-mnan=2008");
>> +    auto DefaultFloat =
>> +        makeMultilib("").flag("-msoft-float").flag("-mnan=2008");
>>
>> -    auto BigEndian = makeMultilib("")
>> -      .flag("+EB").flag("-EL");
>> +    auto BigEndian = makeMultilib("").flag("+EB").flag("-EL");
>>
>> -    auto LittleEndian = makeMultilib("/el")
>> -      .flag("+EL").flag("-EB");
>> +    auto LittleEndian = makeMultilib("/el").flag("+EL").flag("-EB");
>>
>>      // Note that this one's osSuffix is ""
>>      auto MAbi64 = makeMultilib("")
>> -      .gccSuffix("/64")
>> -      .includeSuffix("/64")
>> -      .flag("+mabi=n64").flag("-mabi=n32").flag("-m32");
>> -
>> -    CSMipsMultilibs = MultilibSet()
>> -      .Either(MArchMips16, MArchMicroMips, MArchDefault)
>> -      .Maybe(UCLibc)
>> -      .Either(SoftFloat, Nan2008, DefaultFloat)
>> -      .FilterOut("/micromips/nan2008")
>> -      .FilterOut("/mips16/nan2008")
>> -      .Either(BigEndian, LittleEndian)
>> -      .Maybe(MAbi64)
>> -      .FilterOut("/mips16.*/64")
>> -      .FilterOut("/micromips.*/64")
>> -      .FilterOut(NonExistent)
>> -      .setIncludeDirsCallback([](
>> -          StringRef InstallDir, StringRef TripleStr, const Multilib &M) {
>> -        std::vector<std::string> Dirs;
>> -        Dirs.push_back((InstallDir + "/include").str());
>> -        std::string SysRootInc =
>> -            InstallDir.str() + "/../../../../" + TripleStr.str();
>> -        if (StringRef(M.includeSuffix()).startswith("/uclibc"))
>> -          Dirs.push_back(SysRootInc + "/libc/uclibc/usr/include");
>> -        else
>> -          Dirs.push_back(SysRootInc + "/libc/usr/include");
>> -        return Dirs;
>> -      });
>> -  }
>> -
>> -  MultilibSet AndroidMipsMultilibs = MultilibSet()
>> -    .Maybe(Multilib("/mips-r2").flag("+march=mips32r2"))
>> -    .Maybe(Multilib("/mips-r6").flag("+march=mips32r6"))
>> -    .FilterOut(NonExistent);
>> +                      .gccSuffix("/64")
>> +                      .includeSuffix("/64")
>> +                      .flag("+mabi=n64")
>> +                      .flag("-mabi=n32")
>> +                      .flag("-m32");
>> +
>> +    CSMipsMultilibs =
>> +        MultilibSet()
>> +            .Either(MArchMips16, MArchMicroMips, MArchDefault)
>> +            .Maybe(UCLibc)
>> +            .Either(SoftFloat, Nan2008, DefaultFloat)
>> +            .FilterOut("/micromips/nan2008")
>> +            .FilterOut("/mips16/nan2008")
>> +            .Either(BigEndian, LittleEndian)
>> +            .Maybe(MAbi64)
>> +            .FilterOut("/mips16.*/64")
>> +            .FilterOut("/micromips.*/64")
>> +            .FilterOut(NonExistent)
>> +            .setIncludeDirsCallback([](StringRef InstallDir,
>> +                                       StringRef TripleStr, const
>> Multilib &M) {
>> +              std::vector<std::string> Dirs;
>> +              Dirs.push_back((InstallDir + "/include").str());
>> +              std::string SysRootInc =
>> +                  InstallDir.str() + "/../../../../" + TripleStr.str();
>> +              if (StringRef(M.includeSuffix()).startswith("/uclibc"))
>> +                Dirs.push_back(SysRootInc + "/libc/uclibc/usr/include");
>> +              else
>> +                Dirs.push_back(SysRootInc + "/libc/usr/include");
>> +              return Dirs;
>> +            });
>> +  }
>> +
>> +  MultilibSet AndroidMipsMultilibs =
>> +      MultilibSet()
>> +          .Maybe(Multilib("/mips-r2").flag("+march=mips32r2"))
>> +          .Maybe(Multilib("/mips-r6").flag("+march=mips32r6"))
>> +          .FilterOut(NonExistent);
>>
>>    MultilibSet DebianMipsMultilibs;
>>    {
>> -    Multilib MAbiN32 = Multilib()
>> -      .gccSuffix("/n32")
>> -      .includeSuffix("/n32")
>> -      .flag("+mabi=n32");
>> +    Multilib MAbiN32 =
>> +
>> Multilib().gccSuffix("/n32").includeSuffix("/n32").flag("+mabi=n32");
>>
>>      Multilib M64 = Multilib()
>> -      .gccSuffix("/64")
>> -      .includeSuffix("/64")
>> -      .flag("+m64").flag("-m32").flag("-mabi=n32");
>> -
>> -    Multilib M32 = Multilib()
>> -      .flag("-m64").flag("+m32").flag("-mabi=n32");
>> -
>> -    DebianMipsMultilibs = MultilibSet()
>> -      .Either(M32, M64, MAbiN32)
>> -      .FilterOut(NonExistent);
>> +                       .gccSuffix("/64")
>> +                       .includeSuffix("/64")
>> +                       .flag("+m64")
>> +                       .flag("-m32")
>> +                       .flag("-mabi=n32");
>> +
>> +    Multilib M32 =
>> Multilib().flag("-m64").flag("+m32").flag("-mabi=n32");
>> +
>> +    DebianMipsMultilibs =
>> +        MultilibSet().Either(M32, M64, MAbiN32).FilterOut(NonExistent);
>>    }
>>
>>    MultilibSet ImgMultilibs;
>>    {
>> -    auto Mips64r6 = makeMultilib("/mips64r6")
>> -      .flag("+m64").flag("-m32");
>> +    auto Mips64r6 = makeMultilib("/mips64r6").flag("+m64").flag("-m32");
>>
>> -    auto LittleEndian = makeMultilib("/el")
>> -      .flag("+EL").flag("-EB");
>> +    auto LittleEndian = makeMultilib("/el").flag("+EL").flag("-EB");
>>
>> -    auto MAbi64 = makeMultilib("/64")
>> -      .flag("+mabi=n64").flag("-mabi=n32").flag("-m32");
>> +    auto MAbi64 =
>> +
>> makeMultilib("/64").flag("+mabi=n64").flag("-mabi=n32").flag("-m32");
>>
>> -    ImgMultilibs = MultilibSet()
>> -      .Maybe(Mips64r6)
>> -      .Maybe(MAbi64)
>> -      .Maybe(LittleEndian)
>> -      .FilterOut(NonExistent)
>> -      .setIncludeDirsCallback([](
>> -          StringRef InstallDir, StringRef TripleStr, const Multilib &M) {
>> -        std::vector<std::string> Dirs;
>> -        Dirs.push_back((InstallDir + "/include").str());
>> -        Dirs.push_back((InstallDir +
>> "/../../../../sysroot/usr/include").str());
>> -        return Dirs;
>> -      });
>> +    ImgMultilibs =
>> +        MultilibSet()
>> +            .Maybe(Mips64r6)
>> +            .Maybe(MAbi64)
>> +            .Maybe(LittleEndian)
>> +            .FilterOut(NonExistent)
>> +            .setIncludeDirsCallback([](StringRef InstallDir,
>> +                                       StringRef TripleStr, const
>> Multilib &M) {
>> +              std::vector<std::string> Dirs;
>> +              Dirs.push_back((InstallDir + "/include").str());
>> +              Dirs.push_back(
>> +                  (InstallDir +
>> "/../../../../sysroot/usr/include").str());
>> +              return Dirs;
>> +            });
>>    }
>>
>>    StringRef CPUName;
>> @@ -1823,8 +1793,8 @@ static bool findMIPSMultilibs(const llvm
>>
>>    // Sort candidates. Toolchain that best meets the directories goes
>> first.
>>    // Then select the first toolchains matches command line flags.
>> -  MultilibSet *candidates[] = { &DebianMipsMultilibs, &FSFMipsMultilibs,
>> -                                &CSMipsMultilibs };
>> +  MultilibSet *candidates[] = {&DebianMipsMultilibs, &FSFMipsMultilibs,
>> +                               &CSMipsMultilibs};
>>    std::sort(
>>        std::begin(candidates), std::end(candidates),
>>        [](MultilibSet *a, MultilibSet *b) { return a->size() > b->size();
>> });
>> @@ -1866,17 +1836,23 @@ static bool findBiarchMultilibs(const ll
>>
>>    Multilib Default;
>>    Multilib Alt64 = Multilib()
>> -    .gccSuffix("/64")
>> -    .includeSuffix("/64")
>> -    .flag("-m32").flag("+m64").flag("-mx32");
>> +                       .gccSuffix("/64")
>> +                       .includeSuffix("/64")
>> +                       .flag("-m32")
>> +                       .flag("+m64")
>> +                       .flag("-mx32");
>>    Multilib Alt32 = Multilib()
>> -    .gccSuffix("/32")
>> -    .includeSuffix("/32")
>> -    .flag("+m32").flag("-m64").flag("-mx32");
>> +                       .gccSuffix("/32")
>> +                       .includeSuffix("/32")
>> +                       .flag("+m32")
>> +                       .flag("-m64")
>> +                       .flag("-mx32");
>>    Multilib Altx32 = Multilib()
>> -    .gccSuffix("/x32")
>> -    .includeSuffix("/x32")
>> -    .flag("-m32").flag("-m64").flag("+mx32");
>> +                        .gccSuffix("/x32")
>> +                        .includeSuffix("/x32")
>> +                        .flag("-m32")
>> +                        .flag("-m64")
>> +                        .flag("+mx32");
>>
>>    FilterNonExistent NonExistent(Path);
>>
>> @@ -1923,8 +1899,7 @@ static bool findBiarchMultilibs(const ll
>>    if (!Result.Multilibs.select(Flags, Result.SelectedMultilib))
>>      return false;
>>
>> -  if (Result.SelectedMultilib == Alt64 ||
>> -      Result.SelectedMultilib == Alt32 ||
>> +  if (Result.SelectedMultilib == Alt64 || Result.SelectedMultilib ==
>> Alt32 ||
>>        Result.SelectedMultilib == Altx32)
>>      Result.BiarchSibling = Default;
>>
>> @@ -1940,27 +1915,26 @@ void Generic_GCC::GCCInstallationDetecto
>>    // check for. We also record what is necessary to walk from each back
>>    // up to the lib directory.
>>    const std::string LibSuffixes[] = {
>> -    "/gcc/" + CandidateTriple.str(),
>> -    // Debian puts cross-compilers in gcc-cross
>> -    "/gcc-cross/" + CandidateTriple.str(),
>> -    "/" + CandidateTriple.str() + "/gcc/" + CandidateTriple.str(),
>> -
>> -    // The Freescale PPC SDK has the gcc libraries in
>> -    // <sysroot>/usr/lib/<triple>/x.y.z so have a look there as well.
>> -    "/" + CandidateTriple.str(),
>> -
>> -    // Ubuntu has a strange mis-matched pair of triples that this
>> happens to
>> -    // match.
>> -    // FIXME: It may be worthwhile to generalize this and look for a
>> second
>> -    // triple.
>> -    "/i386-linux-gnu/gcc/" + CandidateTriple.str()
>> -  };
>> +      "/gcc/" + CandidateTriple.str(),
>> +      // Debian puts cross-compilers in gcc-cross
>> +      "/gcc-cross/" + CandidateTriple.str(),
>> +      "/" + CandidateTriple.str() + "/gcc/" + CandidateTriple.str(),
>> +
>> +      // The Freescale PPC SDK has the gcc libraries in
>> +      // <sysroot>/usr/lib/<triple>/x.y.z so have a look there as well.
>> +      "/" + CandidateTriple.str(),
>> +
>> +      // Ubuntu has a strange mis-matched pair of triples that this
>> happens to
>> +      // match.
>> +      // FIXME: It may be worthwhile to generalize this and look for a
>> second
>> +      // triple.
>> +      "/i386-linux-gnu/gcc/" + CandidateTriple.str()};
>>    const std::string InstallSuffixes[] = {
>> -    "/../../..",    // gcc/
>> -    "/../../..",    // gcc-cross/
>> -    "/../../../..", // <triple>/gcc/
>> -    "/../..",       // <triple>/
>> -    "/../../../.."  // i386-linux-gnu/gcc/<triple>/
>> +      "/../../..",    // gcc/
>> +      "/../../..",    // gcc-cross/
>> +      "/../../../..", // <triple>/gcc/
>> +      "/../..",       // <triple>/
>> +      "/../../../.."  // i386-linux-gnu/gcc/<triple>/
>>    };
>>    // Only look at the final, weird Ubuntu suffix for i386-linux-gnu.
>>    const unsigned NumLibSuffixes =
>> @@ -2007,16 +1981,15 @@ void Generic_GCC::GCCInstallationDetecto
>>    }
>>  }
>>
>> -Generic_GCC::Generic_GCC(const Driver &D, const llvm::Triple& Triple,
>> +Generic_GCC::Generic_GCC(const Driver &D, const llvm::Triple &Triple,
>>                           const ArgList &Args)
>> -  : ToolChain(D, Triple, Args), GCCInstallation() {
>> +    : ToolChain(D, Triple, Args), GCCInstallation() {
>>    getProgramPaths().push_back(getDriver().getInstalledDir());
>>    if (getDriver().getInstalledDir() != getDriver().Dir)
>>      getProgramPaths().push_back(getDriver().Dir);
>>  }
>>
>> -Generic_GCC::~Generic_GCC() {
>> -}
>> +Generic_GCC::~Generic_GCC() {}
>>
>>  Tool *Generic_GCC::getTool(Action::ActionClass AC) const {
>>    switch (AC) {
>> @@ -2048,17 +2021,11 @@ bool Generic_GCC::IsUnwindTablesDefault(
>>    return getArch() == llvm::Triple::x86_64;
>>  }
>>
>> -bool Generic_GCC::isPICDefault() const {
>> -  return false;
>> -}
>> +bool Generic_GCC::isPICDefault() const { return false; }
>>
>> -bool Generic_GCC::isPIEDefault() const {
>> -  return false;
>> -}
>> +bool Generic_GCC::isPIEDefault() const { return false; }
>>
>> -bool Generic_GCC::isPICDefaultForced() const {
>> -  return false;
>> -}
>> +bool Generic_GCC::isPICDefaultForced() const { return false; }
>>
>>  bool Generic_GCC::IsIntegratedAssemblerDefault() const {
>>    switch (getTriple().getArch()) {
>> @@ -2097,8 +2064,7 @@ void Generic_ELF::addClangTargetOptions(
>>        getTriple().getOS() == llvm::Triple::NaCl;
>>
>>    if (DriverArgs.hasFlag(options::OPT_fuse_init_array,
>> -                         options::OPT_fno_use_init_array,
>> -                         UseInitArrayDefault))
>> +                         options::OPT_fno_use_init_array,
>> UseInitArrayDefault))
>>      CC1Args.push_back("-fuse-init-array");
>>  }
>>
>> @@ -2124,18 +2090,15 @@ std::string Hexagon_TC::GetGnuDir(const
>>    return InstallRelDir;
>>  }
>>
>> -const char *Hexagon_TC::GetSmallDataThreshold(const ArgList &Args)
>> -{
>> +const char *Hexagon_TC::GetSmallDataThreshold(const ArgList &Args) {
>>    Arg *A;
>>
>> -  A = Args.getLastArg(options::OPT_G,
>> -                      options::OPT_G_EQ,
>> +  A = Args.getLastArg(options::OPT_G, options::OPT_G_EQ,
>>                        options::OPT_msmall_data_threshold_EQ);
>>    if (A)
>>      return A->getValue();
>>
>> -  A = Args.getLastArg(options::OPT_shared,
>> -                      options::OPT_fpic,
>> +  A = Args.getLastArg(options::OPT_shared, options::OPT_fpic,
>>                        options::OPT_fPIC);
>>    if (A)
>>      return "0";
>> @@ -2143,18 +2106,14 @@ const char *Hexagon_TC::GetSmallDataThre
>>    return 0;
>>  }
>>
>> -bool Hexagon_TC::UsesG0(const char* smallDataThreshold)
>> -{
>> +bool Hexagon_TC::UsesG0(const char *smallDataThreshold) {
>>    return smallDataThreshold && smallDataThreshold[0] == '0';
>>  }
>>
>> -static void GetHexagonLibraryPaths(
>> -  const ArgList &Args,
>> -  const std::string &Ver,
>> -  const std::string &MarchString,
>> -  const std::string &InstalledDir,
>> -  ToolChain::path_list *LibPaths)
>> -{
>> +static void GetHexagonLibraryPaths(const ArgList &Args, const
>> std::string &Ver,
>> +                                   const std::string &MarchString,
>> +                                   const std::string &InstalledDir,
>> +                                   ToolChain::path_list *LibPaths) {
>>    bool buildingLib = Args.hasArg(options::OPT_shared);
>>
>>
>>  //----------------------------------------------------------------------------
>> @@ -2196,7 +2155,7 @@ static void GetHexagonLibraryPaths(
>>
>>  Hexagon_TC::Hexagon_TC(const Driver &D, const llvm::Triple &Triple,
>>                         const ArgList &Args)
>> -  : Linux(D, Triple, Args) {
>> +    : Linux(D, Triple, Args) {
>>    const std::string InstalledDir(getDriver().getInstalledDir());
>>    const std::string GnuDir = Hexagon_TC::GetGnuDir(InstalledDir, Args);
>>
>> @@ -2209,7 +2168,7 @@ Hexagon_TC::Hexagon_TC(const Driver &D,
>>    // Determine version of GCC libraries and headers to use.
>>    const std::string HexagonDir(GnuDir + "/lib/gcc/hexagon");
>>    std::error_code ec;
>> -  GCCVersion MaxVersion= GCCVersion::Parse("0.0.0");
>> +  GCCVersion MaxVersion = GCCVersion::Parse("0.0.0");
>>    for (llvm::sys::fs::directory_iterator di(HexagonDir, ec), de;
>>         !ec && di != de; di = di.increment(ec)) {
>>      GCCVersion cv =
>> GCCVersion::Parse(llvm::sys::path::filename(di->path()));
>> @@ -2218,19 +2177,15 @@ Hexagon_TC::Hexagon_TC(const Driver &D,
>>    }
>>    GCCLibAndIncVersion = MaxVersion;
>>
>> -  ToolChain::path_list *LibPaths= &getFilePaths();
>> +  ToolChain::path_list *LibPaths = &getFilePaths();
>>
>>    // Remove paths added by Linux toolchain. Currently Hexagon_TC really
>> targets
>>    // 'elf' OS type, so the Linux paths are not appropriate. When we
>> actually
>>    // support 'linux' we'll need to fix this up
>>    LibPaths->clear();
>>
>> -  GetHexagonLibraryPaths(
>> -    Args,
>> -    GetGCCLibAndIncVersion(),
>> -    GetTargetCPU(Args),
>> -    InstalledDir,
>> -    LibPaths);
>> +  GetHexagonLibraryPaths(Args, GetGCCLibAndIncVersion(),
>> GetTargetCPU(Args),
>> +                         InstalledDir, LibPaths);
>>  }
>>
>>  Hexagon_TC::~Hexagon_TC() {}
>> @@ -2284,8 +2239,7 @@ Hexagon_TC::GetCXXStdlibType(const ArgLi
>>
>>    StringRef Value = A->getValue();
>>    if (Value != "libstdc++") {
>> -    getDriver().Diag(diag::err_drv_invalid_stdlib_name)
>> -      << A->getAsString(Args);
>> +    getDriver().Diag(diag::err_drv_invalid_stdlib_name) <<
>> A->getAsString(Args);
>>    }
>>
>>    return ToolChain::CST_Libstdcxx;
>> @@ -2314,8 +2268,7 @@ static int getHexagonVersion(const ArgLi
>>    return 4;
>>  }
>>
>> -StringRef Hexagon_TC::GetTargetCPU(const ArgList &Args)
>> -{
>> +StringRef Hexagon_TC::GetTargetCPU(const ArgList &Args) {
>>    int V = getHexagonVersion(Args);
>>    // FIXME: We don't support versions < 4. We should error on them.
>>    switch (V) {
>> @@ -2338,13 +2291,13 @@ StringRef Hexagon_TC::GetTargetCPU(const
>>  /// NaCl Toolchain
>>  NaCl_TC::NaCl_TC(const Driver &D, const llvm::Triple &Triple,
>>                   const ArgList &Args)
>> -  : Generic_ELF(D, Triple, Args) {
>> +    : Generic_ELF(D, Triple, Args) {
>>
>>    // Remove paths added by Generic_GCC. NaCl Toolchain cannot use the
>>    // default paths, and must instead only use the paths provided
>>    // with this toolchain based on architecture.
>> -  path_list& file_paths = getFilePaths();
>> -  path_list& prog_paths = getProgramPaths();
>> +  path_list &file_paths = getFilePaths();
>> +  path_list &prog_paths = getProgramPaths();
>>
>>    file_paths.clear();
>>    prog_paths.clear();
>> @@ -2358,30 +2311,30 @@ NaCl_TC::NaCl_TC(const Driver &D, const
>>    // Path for toolchain libraries (libgcc.a, ...)
>>    std::string ToolPath(getDriver().ResourceDir + "/lib/");
>>
>> -  switch(Triple.getArch()) {
>> -    case llvm::Triple::x86: {
>> -      file_paths.push_back(FilePath + "x86_64-nacl/lib32");
>> -      file_paths.push_back(FilePath + "x86_64-nacl/usr/lib32");
>> -      prog_paths.push_back(ProgPath + "x86_64-nacl/bin");
>> -      file_paths.push_back(ToolPath + "i686-nacl");
>> -      break;
>> -    }
>> -    case llvm::Triple::x86_64: {
>> -      file_paths.push_back(FilePath + "x86_64-nacl/lib");
>> -      file_paths.push_back(FilePath + "x86_64-nacl/usr/lib");
>> -      prog_paths.push_back(ProgPath + "x86_64-nacl/bin");
>> -      file_paths.push_back(ToolPath + "x86_64-nacl");
>> -      break;
>> -    }
>> -    case llvm::Triple::arm: {
>> -      file_paths.push_back(FilePath + "arm-nacl/lib");
>> -      file_paths.push_back(FilePath + "arm-nacl/usr/lib");
>> -      prog_paths.push_back(ProgPath + "arm-nacl/bin");
>> -      file_paths.push_back(ToolPath + "arm-nacl");
>> -      break;
>> -    }
>> -    default:
>> -      break;
>> +  switch (Triple.getArch()) {
>> +  case llvm::Triple::x86: {
>> +    file_paths.push_back(FilePath + "x86_64-nacl/lib32");
>> +    file_paths.push_back(FilePath + "x86_64-nacl/usr/lib32");
>> +    prog_paths.push_back(ProgPath + "x86_64-nacl/bin");
>> +    file_paths.push_back(ToolPath + "i686-nacl");
>> +    break;
>> +  }
>> +  case llvm::Triple::x86_64: {
>> +    file_paths.push_back(FilePath + "x86_64-nacl/lib");
>> +    file_paths.push_back(FilePath + "x86_64-nacl/usr/lib");
>> +    prog_paths.push_back(ProgPath + "x86_64-nacl/bin");
>> +    file_paths.push_back(ToolPath + "x86_64-nacl");
>> +    break;
>> +  }
>> +  case llvm::Triple::arm: {
>> +    file_paths.push_back(FilePath + "arm-nacl/lib");
>> +    file_paths.push_back(FilePath + "arm-nacl/usr/lib");
>> +    prog_paths.push_back(ProgPath + "arm-nacl/bin");
>> +    file_paths.push_back(ToolPath + "arm-nacl");
>> +    break;
>> +  }
>> +  default:
>> +    break;
>>    }
>>
>>    // Use p
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
> ...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150628/13b8891c/attachment.html>


More information about the cfe-commits mailing list