[PATCH] D110770: [clang] Remove duplication in types::getCompilationPhases()

Hans Wennborg via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 30 11:02:58 PDT 2021


hans accepted this revision.
hans added a comment.
This revision is now accepted and ready to land.

lgtm



================
Comment at: clang/include/clang/Driver/Phases.h:25
     IfsMerge,
-    LastPhase = IfsMerge,
   };
----------------
thakis wrote:
> hans wrote:
> > Any reason not to keep the LastPhase alias?
> I found it more confusing than helpful. `Link` and `LastPhase` both start with `L` and it took me a while to realize that the last return in `getFinalPhase()` was `Link`, but the last one in was `getCompilationPhases()`. For the call on line 3847, passing phases::IfsMerge is clearer. And then there's only one use of it left (the default arg), and it doesn't add a ton of clarity there imho. But maybe I subconsciously feel vengeful because I lost 10 minutes due to misreading it for `Link` :) If you want me to put it back, let me know and I'll do so.
No, that sounds reasonable, let's keep your patch as it is.


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

https://reviews.llvm.org/D110770



More information about the cfe-commits mailing list