[PATCH] D71474: [TableGen] Introduce an if/then/else statement.

Simon Tatham via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 13 09:29:00 PST 2019


simon_tatham added a comment.

This is a hasty first draft because I'm about to go away for the holidays, and won't have access to this account until the New Year.

It certainly needs documentation, and might also benefit from a refactoring of the mechanism (perhaps the stack of ForeachLoops ought to become a stack of some kind of polymorphic type that can be either a loop or an if).

This patch applies on top of the `defvar` one (D71407 <https://reviews.llvm.org/D71407>), and in this version, I've made it so that unlike a foreach, an if statement //doesn't// begin a new local-variable scope. I think that might be useful because that way you can conditionally define the same local var in both branches of the if, and then use it afterwards.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71474





More information about the llvm-commits mailing list