[PATCH] D52193: RFC: [clang] Multithreaded compilation support -- NOT FOR SUBMIT

Steven Noonan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 13 20:46:58 PDT 2019


tycho added a comment.

OK, those two problems were actually easy enough to fix.

  diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp
  index 2f98cf9e04..93e974842f 100644
  --- a/lib/Driver/Driver.cpp
  +++ b/lib/Driver/Driver.cpp
  @@ -3241,8 +3241,8 @@ void Driver::BuildActions(Compilation &C, DerivedArgList &Args,
     }
     if (FinalPhase != phases::Preprocess) {
       if (Arg *A = Args.getLastArg(options::OPT__SLASH_MP)) {
  +      if (!StringRef(A->getValue()).getAsInteger(10, C.CoresToUse))
           C.CoresToUse = llvm::hardware_concurrency();
  -        StringRef(A->getValue()).getAsInteger(10, C.CoresToUse);
       }
     }

And:

  diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp
  index 93e974842f..c1e8e798d4 100644
  --- a/lib/Driver/Driver.cpp
  +++ b/lib/Driver/Driver.cpp
  @@ -3239,7 +3239,7 @@ void Driver::BuildActions(Compilation &C, DerivedArgList &Args,
       Args.eraseArg(options::OPT__SLASH_Yu);
       YcArg = YuArg = nullptr;
     }
  -  if (FinalPhase != phases::Preprocess) {
  +  if (!YcArg && FinalPhase != phases::Preprocess) {
       if (Arg *A = Args.getLastArg(options::OPT__SLASH_MP)) {
         if (!StringRef(A->getValue()).getAsInteger(10, C.CoresToUse))
           C.CoresToUse = llvm::hardware_concurrency();

The result is a thing of beauty:

F9989375: Taskmgr_GE0Zo74CYl.png <https://reviews.llvm.org/F9989375>


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D52193/new/

https://reviews.llvm.org/D52193





More information about the cfe-commits mailing list