Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
14 | pmbaty | 1 | //===-------- llvm/IR/Value.def - File that describes Values ---v-*- C++ -*-===// |
2 | // |
||
3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
||
4 | // See https://llvm.org/LICENSE.txt for license information. |
||
5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
||
6 | // |
||
7 | //===----------------------------------------------------------------------===// |
||
8 | // |
||
9 | // This file contains descriptions of the various LLVM values. This is |
||
10 | // used as a central place for enumerating the different values. |
||
11 | // |
||
12 | //===----------------------------------------------------------------------===// |
||
13 | |||
14 | // NOTE: NO INCLUDE GUARD DESIRED! |
||
15 | |||
16 | // Provide definitions of macros so that users of this file do not have to |
||
17 | // define everything to use it... |
||
18 | // |
||
19 | #if !(defined HANDLE_GLOBAL_VALUE || defined HANDLE_CONSTANT || \ |
||
20 | defined HANDLE_INSTRUCTION || defined HANDLE_INLINE_ASM_VALUE || \ |
||
21 | defined HANDLE_METADATA_VALUE || defined HANDLE_VALUE || \ |
||
22 | defined HANDLE_CONSTANT_MARKER || defined HANDLE_MEMORY_VALUE) |
||
23 | #error "Missing macro definition of HANDLE_VALUE*" |
||
24 | #endif |
||
25 | |||
26 | // If the LLVM_C_API macro is set, then values handled via HANDLE_*_EXCLUDE_LLVM_C_API will not be expanded in areas the HANDLE_* macro is used. If it is not set, then HANDLE_*_EXCLUDE_LLVM_C_API values are handled normally as their HANDLE_* counterparts. |
||
27 | #ifndef LLVM_C_API |
||
28 | #define LLVM_C_API 0 |
||
29 | #endif |
||
30 | |||
31 | #ifndef HANDLE_MEMORY_VALUE |
||
32 | #define HANDLE_MEMORY_VALUE(ValueName) HANDLE_VALUE(ValueName) |
||
33 | #endif |
||
34 | |||
35 | #ifndef HANDLE_GLOBAL_VALUE |
||
36 | #define HANDLE_GLOBAL_VALUE(ValueName) HANDLE_CONSTANT(ValueName) |
||
37 | #endif |
||
38 | |||
39 | #ifndef HANDLE_CONSTANT |
||
40 | #define HANDLE_CONSTANT(ValueName) HANDLE_VALUE(ValueName) |
||
41 | #endif |
||
42 | |||
43 | #ifndef HANDLE_INSTRUCTION |
||
44 | #define HANDLE_INSTRUCTION(ValueName) HANDLE_VALUE(ValueName) |
||
45 | #endif |
||
46 | |||
47 | #ifndef HANDLE_INLINE_ASM_VALUE |
||
48 | #define HANDLE_INLINE_ASM_VALUE(ValueName) HANDLE_VALUE(ValueName) |
||
49 | #endif |
||
50 | |||
51 | #ifndef HANDLE_METADATA_VALUE |
||
52 | #define HANDLE_METADATA_VALUE(ValueName) HANDLE_VALUE(ValueName) |
||
53 | #endif |
||
54 | |||
55 | #ifndef HANDLE_VALUE |
||
56 | #define HANDLE_VALUE(ValueName) |
||
57 | #endif |
||
58 | |||
59 | #ifndef HANDLE_CONSTANT_MARKER |
||
60 | #define HANDLE_CONSTANT_MARKER(MarkerName, ValueName) |
||
61 | #endif |
||
62 | |||
63 | #ifndef HANDLE_CONSTANT_EXCLUDE_LLVM_C_API |
||
64 | #define HANDLE_CONSTANT_EXCLUDE_LLVM_C_API(ValueName) HANDLE_CONSTANT(ValueName) |
||
65 | #endif |
||
66 | |||
67 | #if LLVM_C_API |
||
68 | #undef HANDLE_CONSTANT_EXCLUDE_LLVM_C_API |
||
69 | #define HANDLE_CONSTANT_EXCLUDE_LLVM_C_API(ValueName) |
||
70 | #endif |
||
71 | |||
72 | // Having constant first makes the range check for isa<Constant> faster |
||
73 | // and smaller by one operation. |
||
74 | |||
75 | // Constant |
||
76 | HANDLE_GLOBAL_VALUE(Function) |
||
77 | HANDLE_GLOBAL_VALUE(GlobalAlias) |
||
78 | HANDLE_GLOBAL_VALUE(GlobalIFunc) |
||
79 | HANDLE_GLOBAL_VALUE(GlobalVariable) |
||
80 | HANDLE_CONSTANT(BlockAddress) |
||
81 | HANDLE_CONSTANT(ConstantExpr) |
||
82 | HANDLE_CONSTANT_EXCLUDE_LLVM_C_API(DSOLocalEquivalent) |
||
83 | HANDLE_CONSTANT_EXCLUDE_LLVM_C_API(NoCFIValue) |
||
84 | |||
85 | // ConstantAggregate. |
||
86 | HANDLE_CONSTANT(ConstantArray) |
||
87 | HANDLE_CONSTANT(ConstantStruct) |
||
88 | HANDLE_CONSTANT(ConstantVector) |
||
89 | |||
90 | // ConstantData. |
||
91 | HANDLE_CONSTANT(UndefValue) |
||
92 | HANDLE_CONSTANT(PoisonValue) |
||
93 | HANDLE_CONSTANT(ConstantAggregateZero) |
||
94 | HANDLE_CONSTANT(ConstantDataArray) |
||
95 | HANDLE_CONSTANT(ConstantDataVector) |
||
96 | HANDLE_CONSTANT(ConstantInt) |
||
97 | HANDLE_CONSTANT(ConstantFP) |
||
98 | HANDLE_CONSTANT(ConstantTargetNone) |
||
99 | HANDLE_CONSTANT(ConstantPointerNull) |
||
100 | HANDLE_CONSTANT(ConstantTokenNone) |
||
101 | |||
102 | HANDLE_CONSTANT_MARKER(ConstantFirstVal, Function) |
||
103 | HANDLE_CONSTANT_MARKER(ConstantLastVal, ConstantTokenNone) |
||
104 | HANDLE_CONSTANT_MARKER(ConstantDataFirstVal, UndefValue) |
||
105 | HANDLE_CONSTANT_MARKER(ConstantDataLastVal, ConstantTokenNone) |
||
106 | HANDLE_CONSTANT_MARKER(ConstantAggregateFirstVal, ConstantArray) |
||
107 | HANDLE_CONSTANT_MARKER(ConstantAggregateLastVal, ConstantVector) |
||
108 | |||
109 | HANDLE_VALUE(Argument) |
||
110 | HANDLE_VALUE(BasicBlock) |
||
111 | |||
112 | |||
113 | HANDLE_METADATA_VALUE(MetadataAsValue) |
||
114 | HANDLE_INLINE_ASM_VALUE(InlineAsm) |
||
115 | |||
116 | // FIXME: It's awkward that Value.def knows about classes in Analysis. While |
||
117 | // this doesn't introduce a strict link or include dependency, we should remove |
||
118 | // the circular dependency eventually. |
||
119 | HANDLE_MEMORY_VALUE(MemoryUse) |
||
120 | HANDLE_MEMORY_VALUE(MemoryDef) |
||
121 | HANDLE_MEMORY_VALUE(MemoryPhi) |
||
122 | |||
123 | HANDLE_INSTRUCTION(Instruction) |
||
124 | // Enum values starting at InstructionVal are used for Instructions; |
||
125 | // don't add new values here! |
||
126 | |||
127 | #undef HANDLE_MEMORY_VALUE |
||
128 | #undef HANDLE_GLOBAL_VALUE |
||
129 | #undef HANDLE_CONSTANT |
||
130 | #undef HANDLE_INSTRUCTION |
||
131 | #undef HANDLE_METADATA_VALUE |
||
132 | #undef HANDLE_INLINE_ASM_VALUE |
||
133 | #undef HANDLE_VALUE |
||
134 | #undef HANDLE_CONSTANT_MARKER |
||
135 | #undef HANDLE_CONSTANT_EXCLUDE_LLVM_C_API |
||
136 | #undef LLVM_C_API |