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 #ifndef MAPLE_IR_INCLUDE_DWARF_H
17 #define MAPLE_IR_INCLUDE_DWARF_H
18 
19 #include <cstdint>
20 
21 enum Tag : uint16_t {
22 #define DW_TAG(ID, NAME) DW_TAG_##NAME = (ID),
23 #include "dwarf.def"
24     DW_TAG_lo_user = 0x4080,
25     DW_TAG_hi_user = 0xffff,
26     DW_TAG_user_base = 0x1000
27 };
28 
29 enum Attribute : uint16_t {
30 #define DW_AT(ID, NAME) DW_AT_##NAME = (ID),
31 #include "dwarf.def"
32     DW_AT_lo_user = 0x2000,
33     DW_AT_hi_user = 0x3fff,
34 };
35 
36 enum Form : uint16_t {
37 #define DW_FORM(ID, NAME) DW_FORM_##NAME = (ID),
38 #include "dwarf.def"
39     DW_FORM_lo_user = 0x1f00,
40 };
41 
42 enum LocationAtom {
43 #define DW_OP(ID, NAME) DW_OP_##NAME = (ID),
44 #include "dwarf.def"
45     DW_OP_lo_user = 0xe0,
46     DW_OP_hi_user = 0xff,
47 };
48 
49 enum TypeKind : uint8_t {
50 #define DW_ATE(ID, NAME) DW_ATE_##NAME = (ID),
51 #include "dwarf.def"
52     DW_ATE_lo_user = 0x80,
53     DW_ATE_hi_user = 0xff,
54     DW_ATE_void = 0x20
55 };
56 
57 enum AccessAttribute { DW_ACCESS_public = 0x01, DW_ACCESS_protected = 0x02, DW_ACCESS_private = 0x03 };
58 
59 enum SourceLanguage {
60 #define DW_LANG(ID, NAME, LOWER_BOUND) DW_LANG_##NAME = (ID),
61 #include "dwarf.def"
62     DW_LANG_LO_USER = 0x8000,
63     DW_LANG_HI_USER = 0xffff
64 };
65 
66 #endif
67