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

Puyan Lotfi via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 9 10:45:12 PDT 2019


plotfi marked an inline comment as done.
plotfi added inline comments.


================
Comment at: clang/lib/Driver/Types.cpp:313-315
+    for (auto Phase : PhaseList)
+      if (Phase <= phases::Preprocess)
+        P.push_back(Phase);
----------------
aaron.ballman wrote:
> How about:
> 
> `llvm::copy_if(PhaseList, std::back_inserter(P), [](phases::ID Phase) { return Phase <= phases.Preprocess; });`
> 
> Similar below.
That could work. I was using llvm::remove_if before and ran into some problematic behavior. 


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