[PATCH] D65993: [NFC][clang] Adding argument based Phase list filtering to getComplicationPhases

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 9 06:48:35 PDT 2019


aaron.ballman added inline comments.


================
Comment at: clang/lib/Driver/Driver.cpp:3220
 
-  unsigned LastPLSize = 0;
-  for (auto &I : Inputs) {
-    types::ID InputType = I.first;
-    const Arg *InputArg = I.second;
+  {
+    Arg *FinalPhaseArg;
----------------
Why do you need this compound statement?


================
Comment at: clang/lib/Driver/Types.cpp:313-315
+    for (auto Phase : PhaseList)
+      if (Phase <= phases::Preprocess)
+        P.push_back(Phase);
----------------
How about:

`llvm::copy_if(PhaseList, std::back_inserter(P), [](phases::ID Phase) { return Phase <= phases.Preprocess; });`

Similar below.


================
Comment at: clang/lib/Driver/Types.cpp:348-349
+    // Generally means, do every phase until Link.
+    for (auto Phase : PhaseList)
+      P.push_back(Phase);
+  }
----------------
`P = PhaseList;` ? Or does `P` come in with data already in it, in which case, `llvm::copy()` is a better choice.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65993





More information about the cfe-commits mailing list