Reid Kleckner | af7c445 | 2018-06-23 02:02:38 +0000 | [diff] [blame] | 1 | // RUN: llvm-tblgen -gen-intrinsic-impl %s | FileCheck %s |
NAKAMURA Takumi | a22657f | 2013-11-10 14:26:08 +0000 | [diff] [blame] | 2 | // XFAIL: vg_leak |
Andrew Trick | 2e50b8a | 2013-10-31 17:18:11 +0000 | [diff] [blame] | 3 | |
| 4 | class IntrinsicProperty; |
Matt Arsenault | 082879a | 2017-12-20 19:36:28 +0000 | [diff] [blame] | 5 | class SDNodeProperty; |
Andrew Trick | 2e50b8a | 2013-10-31 17:18:11 +0000 | [diff] [blame] | 6 | |
| 7 | class ValueType<int size, int value> { |
| 8 | string Namespace = "MVT"; |
| 9 | int Size = size; |
| 10 | int Value = value; |
| 11 | } |
| 12 | |
| 13 | class LLVMType<ValueType vt> { |
| 14 | ValueType VT = vt; |
| 15 | } |
| 16 | |
| 17 | class Intrinsic<string name, list<LLVMType> param_types = []> { |
| 18 | string LLVMName = name; |
| 19 | bit isTarget = 0; |
| 20 | string TargetPrefix = ""; |
| 21 | list<LLVMType> RetTypes = []; |
| 22 | list<LLVMType> ParamTypes = param_types; |
Matt Arsenault | b9f1dbe | 2016-02-10 18:40:04 +0000 | [diff] [blame] | 23 | list<IntrinsicProperty> IntrProperties = []; |
Matt Arsenault | 082879a | 2017-12-20 19:36:28 +0000 | [diff] [blame] | 24 | list<SDNodeProperty> Properties = []; |
Andrew Trick | 2e50b8a | 2013-10-31 17:18:11 +0000 | [diff] [blame] | 25 | } |
| 26 | |
| 27 | // isVoid needs to match the definition in ValueTypes.td |
Krzysztof Parzyszek | a3a5536 | 2017-12-14 19:05:21 +0000 | [diff] [blame] | 28 | def isVoid : ValueType<0, 111>; // Produces no value |
Andrew Trick | 2e50b8a | 2013-10-31 17:18:11 +0000 | [diff] [blame] | 29 | def llvm_vararg_ty : LLVMType<isVoid>; // this means vararg here |
| 30 | |
Joseph Tremoulet | 16c6479 | 2015-09-02 13:36:25 +0000 | [diff] [blame] | 31 | // CHECK: /* 0 */ 0, 29, 0, |
Andrew Trick | 2e50b8a | 2013-10-31 17:18:11 +0000 | [diff] [blame] | 32 | def int_foo : Intrinsic<"llvm.foo", [llvm_vararg_ty]>; |