HomePhabricator

[TblGen] Extend !if semantics through new feature !cond

Description

[TblGen] Extend !if semantics through new feature !cond

This patch extends TableGen language with !cond operator.
Instead of embedding !if inside !if which can get cumbersome,
one can now use !cond.
Below is an example to convert an integer 'x' into a string:

!cond(!lt(x,0) : "Negative",
      !eq(x,0) : "Zero",
      !eq(x,1) : "One,
      1        : "MoreThanOne")

Reviewed By: hfinkel, simon_tatham, greened
Differential Revision: https://reviews.llvm.org/D55758

Details

Committed
javed.absarJan 25 2019, 2:25 AM
Reviewer
hfinkel
Differential Revision
D55758: [TableGen] : Extend !if semantics through new language feature !ifs
Parents
rL352184: [clangd] Log clang-tidy configuration, NFC
Branches
Unknown
Tags
Unknown