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