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