clang  19.0.0git
ComputeDependence.h
Go to the documentation of this file.
1 //===--- ComputeDependence.h -------------------------------------- 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 // Calculate various template dependency flags for the AST.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_CLANG_AST_COMPUTEDEPENDENCE_H
14 #define LLVM_CLANG_AST_COMPUTEDEPENDENCE_H
15 
18 #include "llvm/ADT/ArrayRef.h"
19 
20 namespace clang {
21 
22 class ASTContext;
23 
24 class Expr;
25 class FullExpr;
26 class OpaqueValueExpr;
27 class ParenExpr;
28 class UnaryOperator;
29 class UnaryExprOrTypeTraitExpr;
30 class ArraySubscriptExpr;
31 class MatrixSubscriptExpr;
32 class CompoundLiteralExpr;
33 class ImplicitCastExpr;
34 class ExplicitCastExpr;
35 class BinaryOperator;
36 class ConditionalOperator;
37 class BinaryConditionalOperator;
38 class StmtExpr;
39 class ConvertVectorExpr;
40 class VAArgExpr;
41 class ChooseExpr;
42 class NoInitExpr;
43 class ArrayInitLoopExpr;
44 class ImplicitValueInitExpr;
45 class InitListExpr;
46 class ExtVectorElementExpr;
47 class BlockExpr;
48 class AsTypeExpr;
49 class DeclRefExpr;
50 class RecoveryExpr;
51 class CXXRewrittenBinaryOperator;
52 class CXXStdInitializerListExpr;
53 class CXXTypeidExpr;
54 class MSPropertyRefExpr;
55 class MSPropertySubscriptExpr;
56 class CXXUuidofExpr;
57 class CXXThisExpr;
58 class CXXThrowExpr;
59 class CXXBindTemporaryExpr;
60 class CXXScalarValueInitExpr;
61 class CXXDeleteExpr;
62 class ArrayTypeTraitExpr;
63 class ExpressionTraitExpr;
64 class CXXNoexceptExpr;
65 class PackExpansionExpr;
66 class PackIndexingExpr;
67 class SubstNonTypeTemplateParmExpr;
68 class CoroutineSuspendExpr;
69 class DependentCoawaitExpr;
70 class CXXNewExpr;
71 class CXXPseudoDestructorExpr;
72 class OverloadExpr;
73 class DependentScopeDeclRefExpr;
74 class CXXConstructExpr;
75 class CXXTemporaryObjectExpr;
76 class CXXDefaultInitExpr;
77 class CXXDefaultArgExpr;
78 class LambdaExpr;
79 class CXXUnresolvedConstructExpr;
80 class CXXDependentScopeMemberExpr;
81 class MaterializeTemporaryExpr;
82 class CXXFoldExpr;
83 class CXXParenListInitExpr;
84 class TypeTraitExpr;
85 class ConceptSpecializationExpr;
86 class SYCLUniqueStableIdExpr;
87 class SYCLUniqueStableNameExpr;
88 class PredefinedExpr;
89 class CallExpr;
90 class OffsetOfExpr;
91 class MemberExpr;
92 class ShuffleVectorExpr;
93 class GenericSelectionExpr;
94 class DesignatedInitExpr;
95 class ParenListExpr;
96 class PseudoObjectExpr;
97 class AtomicExpr;
98 class ArraySectionExpr;
99 class OMPArrayShapingExpr;
100 class OMPIteratorExpr;
101 class ObjCArrayLiteral;
102 class ObjCDictionaryLiteral;
103 class ObjCBoxedExpr;
104 class ObjCEncodeExpr;
105 class ObjCIvarRefExpr;
106 class ObjCPropertyRefExpr;
107 class ObjCSubscriptRefExpr;
108 class ObjCIsaExpr;
109 class ObjCIndirectCopyRestoreExpr;
110 class ObjCMessageExpr;
111 class SYCLBuiltinNumFieldsExpr;
112 class SYCLBuiltinNumBasesExpr;
113 class SYCLBuiltinFieldTypeExpr;
114 class SYCLBuiltinBaseTypeExpr;
115 
116 // The following functions are called from constructors of `Expr`, so they
117 // should not access anything beyond basic
118 ExprDependence computeDependence(FullExpr *E);
119 ExprDependence computeDependence(OpaqueValueExpr *E);
120 ExprDependence computeDependence(ParenExpr *E);
121 ExprDependence computeDependence(UnaryOperator *E, const ASTContext &Ctx);
122 ExprDependence computeDependence(UnaryExprOrTypeTraitExpr *E);
123 ExprDependence computeDependence(ArraySubscriptExpr *E);
124 ExprDependence computeDependence(MatrixSubscriptExpr *E);
125 ExprDependence computeDependence(CompoundLiteralExpr *E);
126 ExprDependence computeDependence(ImplicitCastExpr *E);
127 ExprDependence computeDependence(ExplicitCastExpr *E);
128 ExprDependence computeDependence(BinaryOperator *E);
129 ExprDependence computeDependence(ConditionalOperator *E);
130 ExprDependence computeDependence(BinaryConditionalOperator *E);
131 ExprDependence computeDependence(StmtExpr *E, unsigned TemplateDepth);
132 ExprDependence computeDependence(ConvertVectorExpr *E);
133 ExprDependence computeDependence(VAArgExpr *E);
134 ExprDependence computeDependence(ChooseExpr *E);
135 ExprDependence computeDependence(NoInitExpr *E);
136 ExprDependence computeDependence(ArrayInitLoopExpr *E);
137 ExprDependence computeDependence(ImplicitValueInitExpr *E);
138 ExprDependence computeDependence(InitListExpr *E);
139 ExprDependence computeDependence(ExtVectorElementExpr *E);
140 ExprDependence computeDependence(BlockExpr *E);
141 ExprDependence computeDependence(AsTypeExpr *E);
142 ExprDependence computeDependence(DeclRefExpr *E, const ASTContext &Ctx);
143 ExprDependence computeDependence(RecoveryExpr *E);
144 ExprDependence computeDependence(CXXRewrittenBinaryOperator *E);
145 ExprDependence computeDependence(CXXStdInitializerListExpr *E);
146 ExprDependence computeDependence(CXXTypeidExpr *E);
147 ExprDependence computeDependence(MSPropertyRefExpr *E);
148 ExprDependence computeDependence(MSPropertySubscriptExpr *E);
149 ExprDependence computeDependence(CXXUuidofExpr *E);
150 ExprDependence computeDependence(CXXThisExpr *E);
151 ExprDependence computeDependence(CXXThrowExpr *E);
152 ExprDependence computeDependence(CXXBindTemporaryExpr *E);
153 ExprDependence computeDependence(CXXScalarValueInitExpr *E);
154 ExprDependence computeDependence(CXXDeleteExpr *E);
155 ExprDependence computeDependence(ArrayTypeTraitExpr *E);
156 ExprDependence computeDependence(ExpressionTraitExpr *E);
157 ExprDependence computeDependence(CXXNoexceptExpr *E, CanThrowResult CT);
158 ExprDependence computeDependence(PackExpansionExpr *E);
159 ExprDependence computeDependence(PackIndexingExpr *E);
160 ExprDependence computeDependence(SubstNonTypeTemplateParmExpr *E);
161 ExprDependence computeDependence(CoroutineSuspendExpr *E);
162 ExprDependence computeDependence(DependentCoawaitExpr *E);
163 ExprDependence computeDependence(CXXNewExpr *E);
164 ExprDependence computeDependence(CXXPseudoDestructorExpr *E);
165 ExprDependence computeDependence(OverloadExpr *E, bool KnownDependent,
166  bool KnownInstantiationDependent,
167  bool KnownContainsUnexpandedParameterPack);
168 ExprDependence computeDependence(DependentScopeDeclRefExpr *E);
169 ExprDependence computeDependence(CXXConstructExpr *E);
170 ExprDependence computeDependence(CXXTemporaryObjectExpr *E);
171 ExprDependence computeDependence(CXXDefaultInitExpr *E);
172 ExprDependence computeDependence(CXXDefaultArgExpr *E);
173 ExprDependence computeDependence(LambdaExpr *E,
174  bool ContainsUnexpandedParameterPack);
175 ExprDependence computeDependence(CXXUnresolvedConstructExpr *E);
176 ExprDependence computeDependence(CXXDependentScopeMemberExpr *E);
177 ExprDependence computeDependence(MaterializeTemporaryExpr *E);
178 ExprDependence computeDependence(CXXFoldExpr *E);
179 ExprDependence computeDependence(CXXParenListInitExpr *E);
180 ExprDependence computeDependence(TypeTraitExpr *E);
181 ExprDependence computeDependence(ConceptSpecializationExpr *E,
182  bool ValueDependent);
183 
184 ExprDependence computeDependence(SYCLUniqueStableNameExpr *E);
185 ExprDependence computeDependence(SYCLUniqueStableIdExpr *E);
186 ExprDependence computeDependence(PredefinedExpr *E);
188 ExprDependence computeDependence(OffsetOfExpr *E);
189 ExprDependence computeDependence(MemberExpr *E);
190 ExprDependence computeDependence(ShuffleVectorExpr *E);
191 ExprDependence computeDependence(GenericSelectionExpr *E,
192  bool ContainsUnexpandedPack);
193 ExprDependence computeDependence(DesignatedInitExpr *E);
194 ExprDependence computeDependence(ParenListExpr *E);
195 ExprDependence computeDependence(PseudoObjectExpr *E);
196 ExprDependence computeDependence(AtomicExpr *E);
197 
198 ExprDependence computeDependence(ArraySectionExpr *E);
199 ExprDependence computeDependence(OMPArrayShapingExpr *E);
200 ExprDependence computeDependence(OMPIteratorExpr *E);
201 
202 ExprDependence computeDependence(ObjCArrayLiteral *E);
203 ExprDependence computeDependence(ObjCDictionaryLiteral *E);
204 ExprDependence computeDependence(ObjCBoxedExpr *E);
205 ExprDependence computeDependence(ObjCEncodeExpr *E);
206 ExprDependence computeDependence(ObjCIvarRefExpr *E);
207 ExprDependence computeDependence(ObjCPropertyRefExpr *E);
208 ExprDependence computeDependence(ObjCSubscriptRefExpr *E);
209 ExprDependence computeDependence(ObjCIsaExpr *E);
210 ExprDependence computeDependence(ObjCIndirectCopyRestoreExpr *E);
211 ExprDependence computeDependence(ObjCMessageExpr *E);
212 
213 ExprDependence computeDependence(SYCLBuiltinNumFieldsExpr *E);
214 ExprDependence computeDependence(SYCLBuiltinNumBasesExpr *E);
215 ExprDependence computeDependence(SYCLBuiltinFieldTypeExpr *E);
216 ExprDependence computeDependence(SYCLBuiltinBaseTypeExpr *E);
217 
218 } // namespace clang
219 #endif
Defines the ExceptionSpecificationType enumeration and various utility functions.
The JSON file list parser is used to communicate input to InstallAPI.
CanThrowResult
Possible results from evaluation of a noexcept expression.
ExprDependenceScope::ExprDependence ExprDependence
ExprDependence computeDependence(FullExpr *E)