[InstCombine] Signed saturation patterns
[llvm-core.git] / include / llvm / IR / Metadata.def
blob1df60cadac088e2e294134c79a4334138e640fc6
1 //===- llvm/IR/Metadata.def - Metadata definitions --------------*- 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 // Macros for running through all types of metadata.
11 //===----------------------------------------------------------------------===//
13 #if !(defined HANDLE_METADATA || defined HANDLE_METADATA_LEAF || \
14 defined HANDLE_METADATA_BRANCH || defined HANDLE_MDNODE_LEAF || \
15 defined HANDLE_MDNODE_LEAF_UNIQUABLE || defined HANDLE_MDNODE_BRANCH || \
16 defined HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE || \
17 defined HANDLE_SPECIALIZED_MDNODE_LEAF || \
18 defined HANDLE_SPECIALIZED_MDNODE_BRANCH)
19 #error "Missing macro definition of HANDLE_METADATA*"
20 #endif
22 // Handler for all types of metadata.
23 #ifndef HANDLE_METADATA
24 #define HANDLE_METADATA(CLASS)
25 #endif
27 // Handler for leaf nodes in the class hierarchy.
28 #ifndef HANDLE_METADATA_LEAF
29 #define HANDLE_METADATA_LEAF(CLASS) HANDLE_METADATA(CLASS)
30 #endif
32 // Handler for non-leaf nodes in the class hierarchy.
33 #ifndef HANDLE_METADATA_BRANCH
34 #define HANDLE_METADATA_BRANCH(CLASS) HANDLE_METADATA(CLASS)
35 #endif
37 // Handler for specialized and uniquable leaf nodes under MDNode. Defers to
38 // HANDLE_MDNODE_LEAF_UNIQUABLE if it's defined, otherwise to
39 // HANDLE_SPECIALIZED_MDNODE_LEAF.
40 #ifndef HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE
41 #ifdef HANDLE_MDNODE_LEAF_UNIQUABLE
42 #define HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(CLASS) \
43 HANDLE_MDNODE_LEAF_UNIQUABLE(CLASS)
44 #else
45 #define HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(CLASS) \
46 HANDLE_SPECIALIZED_MDNODE_LEAF(CLASS)
47 #endif
48 #endif
50 // Handler for leaf nodes under MDNode.
51 #ifndef HANDLE_MDNODE_LEAF_UNIQUABLE
52 #define HANDLE_MDNODE_LEAF_UNIQUABLE(CLASS) HANDLE_MDNODE_LEAF(CLASS)
53 #endif
55 // Handler for leaf nodes under MDNode.
56 #ifndef HANDLE_MDNODE_LEAF
57 #define HANDLE_MDNODE_LEAF(CLASS) HANDLE_METADATA_LEAF(CLASS)
58 #endif
60 // Handler for non-leaf nodes under MDNode.
61 #ifndef HANDLE_MDNODE_BRANCH
62 #define HANDLE_MDNODE_BRANCH(CLASS) HANDLE_METADATA_BRANCH(CLASS)
63 #endif
65 // Handler for specialized leaf nodes under MDNode.
66 #ifndef HANDLE_SPECIALIZED_MDNODE_LEAF
67 #define HANDLE_SPECIALIZED_MDNODE_LEAF(CLASS) HANDLE_MDNODE_LEAF(CLASS)
68 #endif
70 // Handler for specialized non-leaf nodes under MDNode.
71 #ifndef HANDLE_SPECIALIZED_MDNODE_BRANCH
72 #define HANDLE_SPECIALIZED_MDNODE_BRANCH(CLASS) HANDLE_MDNODE_BRANCH(CLASS)
73 #endif
75 HANDLE_METADATA_LEAF(MDString)
76 HANDLE_METADATA_BRANCH(ValueAsMetadata)
77 HANDLE_METADATA_LEAF(ConstantAsMetadata)
78 HANDLE_METADATA_LEAF(LocalAsMetadata)
79 HANDLE_METADATA_LEAF(DistinctMDOperandPlaceholder)
80 HANDLE_MDNODE_BRANCH(MDNode)
81 HANDLE_MDNODE_LEAF_UNIQUABLE(MDTuple)
82 HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DILocation)
83 HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DIExpression)
84 HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DIGlobalVariableExpression)
85 HANDLE_SPECIALIZED_MDNODE_BRANCH(DINode)
86 HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(GenericDINode)
87 HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DISubrange)
88 HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DIEnumerator)
89 HANDLE_SPECIALIZED_MDNODE_BRANCH(DIScope)
90 HANDLE_SPECIALIZED_MDNODE_BRANCH(DIType)
91 HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DIBasicType)
92 HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DIDerivedType)
93 HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DICompositeType)
94 HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DISubroutineType)
95 HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DIFile)
96 HANDLE_SPECIALIZED_MDNODE_LEAF(DICompileUnit)
97 HANDLE_SPECIALIZED_MDNODE_BRANCH(DILocalScope)
98 HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DISubprogram)
99 HANDLE_SPECIALIZED_MDNODE_BRANCH(DILexicalBlockBase)
100 HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DILexicalBlock)
101 HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DILexicalBlockFile)
102 HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DINamespace)
103 HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DIModule)
104 HANDLE_SPECIALIZED_MDNODE_BRANCH(DITemplateParameter)
105 HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DITemplateTypeParameter)
106 HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DITemplateValueParameter)
107 HANDLE_SPECIALIZED_MDNODE_BRANCH(DIVariable)
108 HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DIGlobalVariable)
109 HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DILocalVariable)
110 HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DILabel)
111 HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DIObjCProperty)
112 HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DIImportedEntity)
113 HANDLE_SPECIALIZED_MDNODE_BRANCH(DIMacroNode)
114 HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DIMacro)
115 HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DIMacroFile)
116 HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE(DICommonBlock)
118 #undef HANDLE_METADATA
119 #undef HANDLE_METADATA_LEAF
120 #undef HANDLE_METADATA_BRANCH
121 #undef HANDLE_MDNODE_LEAF
122 #undef HANDLE_MDNODE_LEAF_UNIQUABLE
123 #undef HANDLE_MDNODE_BRANCH
124 #undef HANDLE_SPECIALIZED_MDNODE_LEAF
125 #undef HANDLE_SPECIALIZED_MDNODE_LEAF_UNIQUABLE
126 #undef HANDLE_SPECIALIZED_MDNODE_BRANCH