• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2023 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16  // opcode keywords
17#define OPCODE(X, Y, Z, S) KEYWORD(X)
18#include "opcodes.def"
19#undef OPCODE
20  // primitive types
21#define LOAD_ALGO_PRIMARY_TYPE
22#define PRIMTYPE(P) KEYWORD(P)
23#include "prim_types.def"
24#undef PRIMTYPE
25  // intrinsic names
26#undef DEF_MIR_INTRINSIC
27#define DEF_MIR_INTRINSIC(X, NAME, INTRN_CLASS, RETURN_TYPE, ...)  KEYWORD(X)
28#include "intrinsics.def"
29#undef DEF_MIR_INTRINSIC
30  KEYWORD(else)
31  // declaration keywords
32  KEYWORD(var)
33  KEYWORD(tempvar)
34  KEYWORD(reg)
35  KEYWORD(type)
36  KEYWORD(func)
37  KEYWORD(struct)
38  KEYWORD(structincomplete)
39  KEYWORD(union)
40  KEYWORD(class)
41  KEYWORD(classincomplete)
42  KEYWORD(interfaceincomplete)
43  // type attribute keywords
44#define FUNC_ATTR
45#define TYPE_ATTR
46#define FIELD_ATTR
47#define ATTR(X) KEYWORD(X)
48#include "all_attributes.def"
49#undef ATTR
50#undef FUNC_ATTR
51#undef TYPE_ATTR
52#undef FIELD_ATTR
53  KEYWORD(align)
54  // per-function declaration keywords
55  KEYWORD(framesize)
56  KEYWORD(upformalsize)
57  KEYWORD(moduleid)
58  KEYWORD(funcsize)
59  KEYWORD(funcid)
60  KEYWORD(formalwordstypetagged)
61  KEYWORD(localwordstypetagged)
62  KEYWORD(formalwordsrefcounted)
63  KEYWORD(localwordsrefcounted)
64  // per-module declaration keywords
65  KEYWORD(flavor)
66  KEYWORD(srclang)
67  KEYWORD(globalmemsize)
68  KEYWORD(globalmemmap)
69  KEYWORD(globalwordstypetagged)
70  KEYWORD(globalwordsrefcounted)
71  KEYWORD(id)
72  KEYWORD(numfuncs)
73  KEYWORD(entryfunc)
74  // file related declaration keywords
75  KEYWORD(fileinfo)
76  KEYWORD(filedata)
77  KEYWORD(srcfileinfo)
78  KEYWORD(funcinfo)
79  // special float constants
80  KEYWORD(nanf)
81  KEYWORD(nan)
82  KEYWORD(inff)
83  KEYWORD(inf)
84  // pragma
85  KEYWORD(pragma)
86  KEYWORD(param)
87  KEYWORD(func_ex)
88  KEYWORD(func_var)
89  // staticvalue
90  KEYWORD(staticvalue)
91  // import
92  KEYWORD(import)
93  KEYWORD(importpath)
94  // source position information
95  KEYWORD(LOC)
96  // scope and source var to mpl var mapping
97  KEYWORD(SCOPE)
98  KEYWORD(ALIAS)
99  // storage class
100  KEYWORD(pstatic)
101  KEYWORD(fstatic)
102  // file-scope asm
103  KEYWORD(asmdecl)
104