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