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