xref: /freebsd/contrib/llvm-project/clang/include/clang/AST/ComputeDependence.h (revision 7fdf597e96a02165cfe22ff357b857d5fa15ed8a)
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 
16 #include "clang/AST/DependenceFlags.h"
17 #include "clang/Basic/ExceptionSpecificationType.h"
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 SYCLUniqueStableNameExpr;
87 class PredefinedExpr;
88 class CallExpr;
89 class OffsetOfExpr;
90 class MemberExpr;
91 class ShuffleVectorExpr;
92 class GenericSelectionExpr;
93 class DesignatedInitExpr;
94 class ParenListExpr;
95 class PseudoObjectExpr;
96 class AtomicExpr;
97 class ArraySectionExpr;
98 class OMPArrayShapingExpr;
99 class OMPIteratorExpr;
100 class ObjCArrayLiteral;
101 class ObjCDictionaryLiteral;
102 class ObjCBoxedExpr;
103 class ObjCEncodeExpr;
104 class ObjCIvarRefExpr;
105 class ObjCPropertyRefExpr;
106 class ObjCSubscriptRefExpr;
107 class ObjCIsaExpr;
108 class ObjCIndirectCopyRestoreExpr;
109 class ObjCMessageExpr;
110 
111 // The following functions are called from constructors of `Expr`, so they
112 // should not access anything beyond basic
113 ExprDependence computeDependence(FullExpr *E);
114 ExprDependence computeDependence(OpaqueValueExpr *E);
115 ExprDependence computeDependence(ParenExpr *E);
116 ExprDependence computeDependence(UnaryOperator *E, const ASTContext &Ctx);
117 ExprDependence computeDependence(UnaryExprOrTypeTraitExpr *E);
118 ExprDependence computeDependence(ArraySubscriptExpr *E);
119 ExprDependence computeDependence(MatrixSubscriptExpr *E);
120 ExprDependence computeDependence(CompoundLiteralExpr *E);
121 ExprDependence computeDependence(ImplicitCastExpr *E);
122 ExprDependence computeDependence(ExplicitCastExpr *E);
123 ExprDependence computeDependence(BinaryOperator *E);
124 ExprDependence computeDependence(ConditionalOperator *E);
125 ExprDependence computeDependence(BinaryConditionalOperator *E);
126 ExprDependence computeDependence(StmtExpr *E, unsigned TemplateDepth);
127 ExprDependence computeDependence(ConvertVectorExpr *E);
128 ExprDependence computeDependence(VAArgExpr *E);
129 ExprDependence computeDependence(ChooseExpr *E);
130 ExprDependence computeDependence(NoInitExpr *E);
131 ExprDependence computeDependence(ArrayInitLoopExpr *E);
132 ExprDependence computeDependence(ImplicitValueInitExpr *E);
133 ExprDependence computeDependence(InitListExpr *E);
134 ExprDependence computeDependence(ExtVectorElementExpr *E);
135 ExprDependence computeDependence(BlockExpr *E);
136 ExprDependence computeDependence(AsTypeExpr *E);
137 ExprDependence computeDependence(DeclRefExpr *E, const ASTContext &Ctx);
138 ExprDependence computeDependence(RecoveryExpr *E);
139 ExprDependence computeDependence(CXXRewrittenBinaryOperator *E);
140 ExprDependence computeDependence(CXXStdInitializerListExpr *E);
141 ExprDependence computeDependence(CXXTypeidExpr *E);
142 ExprDependence computeDependence(MSPropertyRefExpr *E);
143 ExprDependence computeDependence(MSPropertySubscriptExpr *E);
144 ExprDependence computeDependence(CXXUuidofExpr *E);
145 ExprDependence computeDependence(CXXThisExpr *E);
146 ExprDependence computeDependence(CXXThrowExpr *E);
147 ExprDependence computeDependence(CXXBindTemporaryExpr *E);
148 ExprDependence computeDependence(CXXScalarValueInitExpr *E);
149 ExprDependence computeDependence(CXXDeleteExpr *E);
150 ExprDependence computeDependence(ArrayTypeTraitExpr *E);
151 ExprDependence computeDependence(ExpressionTraitExpr *E);
152 ExprDependence computeDependence(CXXNoexceptExpr *E, CanThrowResult CT);
153 ExprDependence computeDependence(PackExpansionExpr *E);
154 ExprDependence computeDependence(PackIndexingExpr *E);
155 ExprDependence computeDependence(SubstNonTypeTemplateParmExpr *E);
156 ExprDependence computeDependence(CoroutineSuspendExpr *E);
157 ExprDependence computeDependence(DependentCoawaitExpr *E);
158 ExprDependence computeDependence(CXXNewExpr *E);
159 ExprDependence computeDependence(CXXPseudoDestructorExpr *E);
160 ExprDependence computeDependence(OverloadExpr *E, bool KnownDependent,
161                                  bool KnownInstantiationDependent,
162                                  bool KnownContainsUnexpandedParameterPack);
163 ExprDependence computeDependence(DependentScopeDeclRefExpr *E);
164 ExprDependence computeDependence(CXXConstructExpr *E);
165 ExprDependence computeDependence(CXXTemporaryObjectExpr *E);
166 ExprDependence computeDependence(CXXDefaultInitExpr *E);
167 ExprDependence computeDependence(CXXDefaultArgExpr *E);
168 ExprDependence computeDependence(LambdaExpr *E,
169                                  bool ContainsUnexpandedParameterPack);
170 ExprDependence computeDependence(CXXUnresolvedConstructExpr *E);
171 ExprDependence computeDependence(CXXDependentScopeMemberExpr *E);
172 ExprDependence computeDependence(MaterializeTemporaryExpr *E);
173 ExprDependence computeDependence(CXXFoldExpr *E);
174 ExprDependence computeDependence(CXXParenListInitExpr *E);
175 ExprDependence computeDependence(TypeTraitExpr *E);
176 ExprDependence computeDependence(ConceptSpecializationExpr *E,
177                                  bool ValueDependent);
178 
179 ExprDependence computeDependence(SYCLUniqueStableNameExpr *E);
180 ExprDependence computeDependence(PredefinedExpr *E);
181 ExprDependence computeDependence(CallExpr *E, llvm::ArrayRef<Expr *> PreArgs);
182 ExprDependence computeDependence(OffsetOfExpr *E);
183 ExprDependence computeDependence(MemberExpr *E);
184 ExprDependence computeDependence(ShuffleVectorExpr *E);
185 ExprDependence computeDependence(GenericSelectionExpr *E,
186                                  bool ContainsUnexpandedPack);
187 ExprDependence computeDependence(DesignatedInitExpr *E);
188 ExprDependence computeDependence(ParenListExpr *E);
189 ExprDependence computeDependence(PseudoObjectExpr *E);
190 ExprDependence computeDependence(AtomicExpr *E);
191 
192 ExprDependence computeDependence(ArraySectionExpr *E);
193 ExprDependence computeDependence(OMPArrayShapingExpr *E);
194 ExprDependence computeDependence(OMPIteratorExpr *E);
195 
196 ExprDependence computeDependence(ObjCArrayLiteral *E);
197 ExprDependence computeDependence(ObjCDictionaryLiteral *E);
198 ExprDependence computeDependence(ObjCBoxedExpr *E);
199 ExprDependence computeDependence(ObjCEncodeExpr *E);
200 ExprDependence computeDependence(ObjCIvarRefExpr *E);
201 ExprDependence computeDependence(ObjCPropertyRefExpr *E);
202 ExprDependence computeDependence(ObjCSubscriptRefExpr *E);
203 ExprDependence computeDependence(ObjCIsaExpr *E);
204 ExprDependence computeDependence(ObjCIndirectCopyRestoreExpr *E);
205 ExprDependence computeDependence(ObjCMessageExpr *E);
206 
207 } // namespace clang
208 #endif
209