1 //===-------- llvm
/IR
/Value.def
- File that describes Values
---v
-*- C
++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 // This file contains descriptions of the various LLVM values. This is
10 // used as a central place for enumerating the different values.
12 //===----------------------------------------------------------------------===//
14 // NOTE
: NO INCLUDE GUARD DESIRED
!
16 // Provide definitions of macros so that users of this file do not have to
17 // define everything to use it...
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*"
26 #ifndef HANDLE_MEMORY_VALUE
27 #define
HANDLE_MEMORY_VALUE(ValueName
) HANDLE_VALUE(ValueName
)
30 #ifndef HANDLE_GLOBAL_VALUE
31 #define
HANDLE_GLOBAL_VALUE(ValueName
) HANDLE_CONSTANT(ValueName
)
34 #ifndef HANDLE_CONSTANT
35 #define
HANDLE_CONSTANT(ValueName
) HANDLE_VALUE(ValueName
)
38 #ifndef HANDLE_INSTRUCTION
39 #define
HANDLE_INSTRUCTION(ValueName
) HANDLE_VALUE(ValueName
)
42 #ifndef HANDLE_INLINE_ASM_VALUE
43 #define
HANDLE_INLINE_ASM_VALUE(ValueName
) HANDLE_VALUE(ValueName
)
46 #ifndef HANDLE_METADATA_VALUE
47 #define
HANDLE_METADATA_VALUE(ValueName
) HANDLE_VALUE(ValueName
)
51 #define
HANDLE_VALUE(ValueName
)
54 #ifndef HANDLE_CONSTANT_MARKER
55 #define
HANDLE_CONSTANT_MARKER(MarkerName
, ValueName
)
58 // Having constant first makes the range check for isa
<Constant
> faster
59 // and smaller by one operation.
62 HANDLE_GLOBAL_VALUE(Function
)
63 HANDLE_GLOBAL_VALUE(GlobalAlias
)
64 HANDLE_GLOBAL_VALUE(GlobalIFunc
)
65 HANDLE_GLOBAL_VALUE(GlobalVariable
)
66 HANDLE_CONSTANT(BlockAddress
)
67 HANDLE_CONSTANT(ConstantExpr
)
70 HANDLE_CONSTANT(ConstantArray
)
71 HANDLE_CONSTANT(ConstantStruct
)
72 HANDLE_CONSTANT(ConstantVector
)
75 HANDLE_CONSTANT(UndefValue
)
76 HANDLE_CONSTANT(ConstantAggregateZero
)
77 HANDLE_CONSTANT(ConstantDataArray
)
78 HANDLE_CONSTANT(ConstantDataVector
)
79 HANDLE_CONSTANT(ConstantInt
)
80 HANDLE_CONSTANT(ConstantFP
)
81 HANDLE_CONSTANT(ConstantPointerNull
)
82 HANDLE_CONSTANT(ConstantTokenNone
)
84 HANDLE_CONSTANT_MARKER(ConstantFirstVal
, Function
)
85 HANDLE_CONSTANT_MARKER(ConstantLastVal
, ConstantTokenNone
)
86 HANDLE_CONSTANT_MARKER(ConstantDataFirstVal
, UndefValue
)
87 HANDLE_CONSTANT_MARKER(ConstantDataLastVal
, ConstantTokenNone
)
88 HANDLE_CONSTANT_MARKER(ConstantAggregateFirstVal
, ConstantArray
)
89 HANDLE_CONSTANT_MARKER(ConstantAggregateLastVal
, ConstantVector
)
91 HANDLE_VALUE(Argument
)
92 HANDLE_VALUE(BasicBlock
)
95 HANDLE_METADATA_VALUE(MetadataAsValue
)
96 HANDLE_INLINE_ASM_VALUE(InlineAsm
)
98 // FIXME
: It
's awkward that Value.def knows about classes in Analysis. While
99 // this doesn't introduce a strict link or include dependency
, we should remove
100 // the circular dependency eventually.
101 HANDLE_MEMORY_VALUE(MemoryUse
)
102 HANDLE_MEMORY_VALUE(MemoryDef
)
103 HANDLE_MEMORY_VALUE(MemoryPhi
)
105 HANDLE_INSTRUCTION(Instruction
)
106 // Enum values starting at InstructionVal are used for Instructions
;
107 // don
't add new values here!
109 #undef HANDLE_MEMORY_VALUE
110 #undef HANDLE_GLOBAL_VALUE
111 #undef HANDLE_CONSTANT
112 #undef HANDLE_INSTRUCTION
113 #undef HANDLE_METADATA_VALUE
114 #undef HANDLE_INLINE_ASM_VALUE
116 #undef HANDLE_CONSTANT_MARKER