mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-01 21:04:04 -04:00
c4ce20752b
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352185 91177308-0d34-0410-b5e6-96231b3b80d8
12 lines
300 B
TableGen
12 lines
300 B
TableGen
// RUN: not llvm-tblgen %s 2>&1 | FileCheck %s
|
|
// XFAIL: vg_leak
|
|
|
|
class A<int dummy> {}
|
|
class B<int dummy> : A<dummy> {}
|
|
class C<int dummy> : A<dummy> {}
|
|
|
|
// CHECK: Value 'x' of type 'C' is incompatible with initializer '{{.*}}' of type 'A'
|
|
class X<int cc, B b, C c> {
|
|
C x = !cond(cc: b, 1 : c);
|
|
}
|