diff options
author | Javed Absar <javed.absar@arm.com> | 2019-01-25 10:25:25 +0000 |
---|---|---|
committer | Javed Absar <javed.absar@arm.com> | 2019-01-25 10:25:25 +0000 |
commit | a3e3d8528644b3e432538853804553c62fea7722 (patch) | |
tree | 797687c37a0bb0af848b5346f88d14cce00164c9 /llvm/lib/TableGen/TGLexer.h | |
parent | 7a35bdb7ec6958429bebd42f3ce40f19cdc9fbd8 (diff) | |
download | bcm5719-llvm-a3e3d8528644b3e432538853804553c62fea7722.tar.gz bcm5719-llvm-a3e3d8528644b3e432538853804553c62fea7722.zip |
[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
llvm-svn: 352185
Diffstat (limited to 'llvm/lib/TableGen/TGLexer.h')
-rw-r--r-- | llvm/lib/TableGen/TGLexer.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/TableGen/TGLexer.h b/llvm/lib/TableGen/TGLexer.h index fcee028d3ae..0cb9ae3f567 100644 --- a/llvm/lib/TableGen/TGLexer.h +++ b/llvm/lib/TableGen/TGLexer.h @@ -50,7 +50,7 @@ namespace tgtok { // !keywords. XConcat, XADD, XAND, XOR, XSRA, XSRL, XSHL, XListConcat, XStrConcat, XCast, - XSubst, XForEach, XFoldl, XHead, XTail, XSize, XEmpty, XIf, XEq, XIsA, XDag, + XSubst, XForEach, XFoldl, XHead, XTail, XSize, XEmpty, XIf, XCond, XEq, XIsA, XDag, XNe, XLe, XLt, XGe, XGt, // Integer value. |