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_COMPUTE_DEPENDENCE_H
14#define LLVM_CLANG_AST_COMPUTE_DEPENDENCE_H
15
16#include "clang/AST/DependenceFlags.h"
17#include "clang/Basic/ExceptionSpecificationType.h"
18#include "llvm/ADT/ArrayRef.h"
19
20namespace clang {
21
22class ASTContext;
23
24class Expr;
25class FullExpr;
26class OpaqueValueExpr;
27class ParenExpr;
28class UnaryOperator;
29class UnaryExprOrTypeTraitExpr;
30class ArraySubscriptExpr;
31class MatrixSubscriptExpr;
32class CompoundLiteralExpr;
33class CastExpr;
34class BinaryOperator;
35class ConditionalOperator;
36class BinaryConditionalOperator;
37class StmtExpr;
38class ConvertVectorExpr;
39class VAArgExpr;
40class ChooseExpr;
41class NoInitExpr;
42class ArrayInitLoopExpr;
43class ImplicitValueInitExpr;
44class InitListExpr;
45class ExtVectorElementExpr;
46class BlockExpr;
47class AsTypeExpr;
48class DeclRefExpr;
49class RecoveryExpr;
50class CXXRewrittenBinaryOperator;
51class CXXStdInitializerListExpr;
52class CXXTypeidExpr;
53class MSPropertyRefExpr;
54class MSPropertySubscriptExpr;
55class CXXUuidofExpr;
56class CXXThisExpr;
57class CXXThrowExpr;
58class CXXBindTemporaryExpr;
59class CXXScalarValueInitExpr;
60class CXXDeleteExpr;
61class ArrayTypeTraitExpr;
62class ExpressionTraitExpr;
63class CXXNoexceptExpr;
64class PackExpansionExpr;
65class SubstNonTypeTemplateParmExpr;
66class CoroutineSuspendExpr;
67class DependentCoawaitExpr;
68class CXXNewExpr;
69class CXXPseudoDestructorExpr;
70class OverloadExpr;
71class DependentScopeDeclRefExpr;
72class CXXConstructExpr;
73class CXXDefaultInitExpr;
74class LambdaExpr;
75class CXXUnresolvedConstructExpr;
76class CXXDependentScopeMemberExpr;
77class MaterializeTemporaryExpr;
78class CXXFoldExpr;
79class TypeTraitExpr;
80class ConceptSpecializationExpr;
81class PredefinedExpr;
82class CallExpr;
83class OffsetOfExpr;
84class MemberExpr;
85class ShuffleVectorExpr;
86class GenericSelectionExpr;
87class DesignatedInitExpr;
88class ParenListExpr;
89class PseudoObjectExpr;
90class AtomicExpr;
91class OMPArraySectionExpr;
92class OMPArrayShapingExpr;
93class OMPIteratorExpr;
94class ObjCArrayLiteral;
95class ObjCDictionaryLiteral;
96class ObjCBoxedExpr;
97class ObjCEncodeExpr;
98class ObjCIvarRefExpr;
99class ObjCPropertyRefExpr;
100class ObjCSubscriptRefExpr;
101class ObjCIsaExpr;
102class ObjCIndirectCopyRestoreExpr;
103class ObjCMessageExpr;
104
105// The following functions are called from constructors of `Expr`, so they
106// should not access anything beyond basic
107ExprDependence computeDependence(FullExpr *E);
108ExprDependence computeDependence(OpaqueValueExpr *E);
109ExprDependence computeDependence(ParenExpr *E);
110ExprDependence computeDependence(UnaryOperator *E, const ASTContext &Ctx);
111ExprDependence computeDependence(UnaryExprOrTypeTraitExpr *E);
112ExprDependence computeDependence(ArraySubscriptExpr *E);
113ExprDependence computeDependence(MatrixSubscriptExpr *E);
114ExprDependence computeDependence(CompoundLiteralExpr *E);
115ExprDependence computeDependence(CastExpr *E);
116ExprDependence computeDependence(BinaryOperator *E);
117ExprDependence computeDependence(ConditionalOperator *E);
118ExprDependence computeDependence(BinaryConditionalOperator *E);
119ExprDependence computeDependence(StmtExpr *E, unsigned TemplateDepth);
120ExprDependence computeDependence(ConvertVectorExpr *E);
121ExprDependence computeDependence(VAArgExpr *E);
122ExprDependence computeDependence(ChooseExpr *E);
123ExprDependence computeDependence(NoInitExpr *E);
124ExprDependence computeDependence(ArrayInitLoopExpr *E);
125ExprDependence computeDependence(ImplicitValueInitExpr *E);
126ExprDependence computeDependence(InitListExpr *E);
127ExprDependence computeDependence(ExtVectorElementExpr *E);
128ExprDependence computeDependence(BlockExpr *E);
129ExprDependence computeDependence(AsTypeExpr *E);
130ExprDependence computeDependence(DeclRefExpr *E, const ASTContext &Ctx);
131ExprDependence computeDependence(RecoveryExpr *E);
132ExprDependence computeDependence(CXXRewrittenBinaryOperator *E);
133ExprDependence computeDependence(CXXStdInitializerListExpr *E);
134ExprDependence computeDependence(CXXTypeidExpr *E);
135ExprDependence computeDependence(MSPropertyRefExpr *E);
136ExprDependence computeDependence(MSPropertySubscriptExpr *E);
137ExprDependence computeDependence(CXXUuidofExpr *E);
138ExprDependence computeDependence(CXXThisExpr *E);
139ExprDependence computeDependence(CXXThrowExpr *E);
140ExprDependence computeDependence(CXXBindTemporaryExpr *E);
141ExprDependence computeDependence(CXXScalarValueInitExpr *E);
142ExprDependence computeDependence(CXXDeleteExpr *E);
143ExprDependence computeDependence(ArrayTypeTraitExpr *E);
144ExprDependence computeDependence(ExpressionTraitExpr *E);
145ExprDependence computeDependence(CXXNoexceptExpr *E, CanThrowResult CT);
146ExprDependence computeDependence(PackExpansionExpr *E);
147ExprDependence computeDependence(SubstNonTypeTemplateParmExpr *E);
148ExprDependence computeDependence(CoroutineSuspendExpr *E);
149ExprDependence computeDependence(DependentCoawaitExpr *E);
150ExprDependence computeDependence(CXXNewExpr *E);
151ExprDependence computeDependence(CXXPseudoDestructorExpr *E);
152ExprDependence computeDependence(OverloadExpr *E, bool KnownDependent,
153 bool KnownInstantiationDependent,
154 bool KnownContainsUnexpandedParameterPack);
155ExprDependence computeDependence(DependentScopeDeclRefExpr *E);
156ExprDependence computeDependence(CXXConstructExpr *E);
157ExprDependence computeDependence(CXXDefaultInitExpr *E);
158ExprDependence computeDependence(LambdaExpr *E,
159 bool ContainsUnexpandedParameterPack);
160ExprDependence computeDependence(CXXUnresolvedConstructExpr *E);
161ExprDependence computeDependence(CXXDependentScopeMemberExpr *E);
162ExprDependence computeDependence(MaterializeTemporaryExpr *E);
163ExprDependence computeDependence(CXXFoldExpr *E);
164ExprDependence computeDependence(TypeTraitExpr *E);
165ExprDependence computeDependence(ConceptSpecializationExpr *E,
166 bool ValueDependent);
167
168ExprDependence computeDependence(PredefinedExpr *E);
169ExprDependence computeDependence(CallExpr *E, llvm::ArrayRef<Expr *> PreArgs);
170ExprDependence computeDependence(OffsetOfExpr *E);
171ExprDependence computeDependence(MemberExpr *E);
172ExprDependence computeDependence(ShuffleVectorExpr *E);
173ExprDependence computeDependence(GenericSelectionExpr *E,
174 bool ContainsUnexpandedPack);
175ExprDependence computeDependence(DesignatedInitExpr *E);
176ExprDependence computeDependence(ParenListExpr *E);
177ExprDependence computeDependence(PseudoObjectExpr *E);
178ExprDependence computeDependence(AtomicExpr *E);
179
180ExprDependence computeDependence(OMPArraySectionExpr *E);
181ExprDependence computeDependence(OMPArrayShapingExpr *E);
182ExprDependence computeDependence(OMPIteratorExpr *E);
183
184ExprDependence computeDependence(ObjCArrayLiteral *E);
185ExprDependence computeDependence(ObjCDictionaryLiteral *E);
186ExprDependence computeDependence(ObjCBoxedExpr *E);
187ExprDependence computeDependence(ObjCEncodeExpr *E);
188ExprDependence computeDependence(ObjCIvarRefExpr *E);
189ExprDependence computeDependence(ObjCPropertyRefExpr *E);
190ExprDependence computeDependence(ObjCSubscriptRefExpr *E);
191ExprDependence computeDependence(ObjCIsaExpr *E);
192ExprDependence computeDependence(ObjCIndirectCopyRestoreExpr *E);
193ExprDependence computeDependence(ObjCMessageExpr *E);
194
195} // namespace clang
196#endif
197