Lines Matching +full:- +full:e
1 //===- ComputeDependence.cpp ----------------------------------------------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
24 ExprDependence clang::computeDependence(FullExpr *E) { in computeDependence() argument
25 return E->getSubExpr()->getDependence(); in computeDependence()
28 ExprDependence clang::computeDependence(OpaqueValueExpr *E) { in computeDependence() argument
29 auto D = toExprDependenceForImpliedType(E->getType()->getDependence()); in computeDependence()
30 if (auto *S = E->getSourceExpr()) in computeDependence()
31 D |= S->getDependence(); in computeDependence()
36 ExprDependence clang::computeDependence(ParenExpr *E) { in computeDependence() argument
37 return E->getSubExpr()->getDependence(); in computeDependence()
40 ExprDependence clang::computeDependence(UnaryOperator *E, in computeDependence() argument
44 toExprDependenceForImpliedType(E->getType()->getDependence()) | in computeDependence()
45 E->getSubExpr()->getDependence(); in computeDependence()
48 // An expression of the form & qualified-id where the qualified-id names a in computeDependence()
49 // dependent member of the current instantiation is value-dependent. An in computeDependence()
50 // expression of the form & cast-expression is also value-dependent if in computeDependence()
51 // evaluating cast-expression as a core constant expression succeeds and in computeDependence()
55 // What this amounts to is: constant-evaluate the operand and check whether it in computeDependence()
57 if (Ctx.getLangOpts().CPlusPlus && E->getOpcode() == UO_AddrOf && in computeDependence()
63 if (E->getSubExpr()->EvaluateAsConstantExpr(Result, Ctx) && Diag.empty() && in computeDependence()
66 if (VD && VD->isTemplated()) { in computeDependence()
68 if (!VarD || !VarD->hasLocalStorage()) in computeDependence()
77 ExprDependence clang::computeDependence(UnaryExprOrTypeTraitExpr *E) { in computeDependence() argument
78 // Never type-dependent (C++ [temp.dep.expr]p3). in computeDependence()
79 // Value-dependent if the argument is type-dependent. in computeDependence()
80 if (E->isArgumentType()) in computeDependence()
82 toExprDependenceAsWritten(E->getArgumentType()->getDependence())); in computeDependence()
84 auto ArgDeps = E->getArgumentExpr()->getDependence(); in computeDependence()
86 // Value-dependent if the argument is type-dependent. in computeDependence()
91 auto ExprKind = E->getKind(); in computeDependence()
97 auto *NoParens = E->getArgumentExpr()->IgnoreParens(); in computeDependence()
100 D = DRE->getDecl(); in computeDependence()
102 D = ME->getMemberDecl(); in computeDependence()
105 for (const auto *I : D->specific_attrs<AlignedAttr>()) { in computeDependence()
106 if (I->isAlignmentErrorDependent()) in computeDependence()
108 if (I->isAlignmentDependent()) in computeDependence()
114 ExprDependence clang::computeDependence(ArraySubscriptExpr *E) { in computeDependence() argument
115 return E->getLHS()->getDependence() | E->getRHS()->getDependence(); in computeDependence()
118 ExprDependence clang::computeDependence(MatrixSubscriptExpr *E) { in computeDependence() argument
119 return E->getBase()->getDependence() | E->getRowIdx()->getDependence() | in computeDependence()
120 (E->getColumnIdx() ? E->getColumnIdx()->getDependence() in computeDependence()
124 ExprDependence clang::computeDependence(CompoundLiteralExpr *E) { in computeDependence() argument
126 E->getTypeSourceInfo()->getType()->getDependence()) | in computeDependence()
127 toExprDependenceForImpliedType(E->getType()->getDependence()) | in computeDependence()
128 turnTypeToValueDependence(E->getInitializer()->getDependence()); in computeDependence()
131 ExprDependence clang::computeDependence(ImplicitCastExpr *E) { in computeDependence() argument
136 toExprDependenceForImpliedType(E->getType()->getDependence()); in computeDependence()
137 if (auto *S = E->getSubExpr()) in computeDependence()
138 D |= S->getDependence() & ~ExprDependence::Type; in computeDependence()
142 ExprDependence clang::computeDependence(ExplicitCastExpr *E) { in computeDependence() argument
143 // Cast expressions are type-dependent if the type is in computeDependence()
145 // Cast expressions are value-dependent if the type is in computeDependence()
146 // dependent or if the subexpression is value-dependent. in computeDependence()
153 cast<ExplicitCastExpr>(E)->getTypeAsWritten()->getDependence()) | in computeDependence()
154 toExprDependenceForImpliedType(E->getType()->getDependence()); in computeDependence()
155 if (auto *S = E->getSubExpr()) in computeDependence()
156 D |= S->getDependence() & ~ExprDependence::Type; in computeDependence()
160 ExprDependence clang::computeDependence(BinaryOperator *E) { in computeDependence() argument
161 return E->getLHS()->getDependence() | E->getRHS()->getDependence(); in computeDependence()
164 ExprDependence clang::computeDependence(ConditionalOperator *E) { in computeDependence() argument
169 return E->getCond()->getDependence() | E->getLHS()->getDependence() | in computeDependence()
170 E->getRHS()->getDependence(); in computeDependence()
173 ExprDependence clang::computeDependence(BinaryConditionalOperator *E) { in computeDependence() argument
174 return E->getCommon()->getDependence() | E->getFalseExpr()->getDependence(); in computeDependence()
177 ExprDependence clang::computeDependence(StmtExpr *E, unsigned TemplateDepth) { in computeDependence() argument
178 auto D = toExprDependenceForImpliedType(E->getType()->getDependence()); in computeDependence()
181 dyn_cast_or_null<ValueStmt>(E->getSubStmt()->getStmtExprResult())) in computeDependence()
182 if (const Expr *ResultExpr = CompoundExprResult->getExprStmt()) in computeDependence()
183 D |= ResultExpr->getDependence(); in computeDependence()
184 // Note: we treat a statement-expression in a dependent context as always in computeDependence()
185 // being value- and instantiation-dependent. This matches the behavior of in computeDependence()
186 // lambda-expressions and GCC. in computeDependence()
193 ExprDependence clang::computeDependence(ConvertVectorExpr *E) { in computeDependence() argument
195 E->getTypeSourceInfo()->getType()->getDependence()) | in computeDependence()
196 E->getSrcExpr()->getDependence(); in computeDependence()
197 if (!E->getType()->isDependentType()) in computeDependence()
202 ExprDependence clang::computeDependence(ChooseExpr *E) { in computeDependence() argument
203 if (E->isConditionDependent()) in computeDependence()
205 E->getCond()->getDependence() | E->getLHS()->getDependence() | in computeDependence()
206 E->getRHS()->getDependence(); in computeDependence()
208 auto Cond = E->getCond()->getDependence(); in computeDependence()
209 auto Active = E->getLHS()->getDependence(); in computeDependence()
210 auto Inactive = E->getRHS()->getDependence(); in computeDependence()
211 if (!E->isConditionTrue()) in computeDependence()
213 // Take type- and value- dependency from the active branch. Propagate all in computeDependence()
221 for (auto *E : P->exprs()) in computeDependence() local
222 D |= E->getDependence(); in computeDependence()
226 ExprDependence clang::computeDependence(VAArgExpr *E) { in computeDependence() argument
228 E->getWrittenTypeInfo()->getType()->getDependence()) | in computeDependence()
229 (E->getSubExpr()->getDependence() & ~ExprDependence::Type); in computeDependence()
233 ExprDependence clang::computeDependence(NoInitExpr *E) { in computeDependence() argument
234 return toExprDependenceForImpliedType(E->getType()->getDependence()) & in computeDependence()
238 ExprDependence clang::computeDependence(ArrayInitLoopExpr *E) { in computeDependence() argument
239 auto D = E->getCommonExpr()->getDependence() | in computeDependence()
240 E->getSubExpr()->getDependence() | ExprDependence::Instantiation; in computeDependence()
241 if (!E->getType()->isInstantiationDependentType()) in computeDependence()
246 ExprDependence clang::computeDependence(ImplicitValueInitExpr *E) { in computeDependence() argument
247 return toExprDependenceForImpliedType(E->getType()->getDependence()) & in computeDependence()
251 ExprDependence clang::computeDependence(ExtVectorElementExpr *E) { in computeDependence() argument
252 return E->getBase()->getDependence(); in computeDependence()
255 ExprDependence clang::computeDependence(BlockExpr *E) { in computeDependence() argument
256 auto D = toExprDependenceForImpliedType(E->getType()->getDependence()); in computeDependence()
257 if (E->getBlockDecl()->isDependentContext()) in computeDependence()
262 ExprDependence clang::computeDependence(AsTypeExpr *E) { in computeDependence() argument
264 // type has identical sugar for now, so is a type-as-written. in computeDependence()
265 auto D = toExprDependenceAsWritten(E->getType()->getDependence()) | in computeDependence()
266 E->getSrcExpr()->getDependence(); in computeDependence()
267 if (!E->getType()->isDependentType()) in computeDependence()
272 ExprDependence clang::computeDependence(CXXRewrittenBinaryOperator *E) { in computeDependence() argument
273 return E->getSemanticForm()->getDependence(); in computeDependence()
276 ExprDependence clang::computeDependence(CXXStdInitializerListExpr *E) { in computeDependence() argument
277 auto D = turnTypeToValueDependence(E->getSubExpr()->getDependence()); in computeDependence()
278 D |= toExprDependenceForImpliedType(E->getType()->getDependence()); in computeDependence()
282 ExprDependence clang::computeDependence(CXXTypeidExpr *E) { in computeDependence() argument
284 if (E->isTypeOperand()) in computeDependence()
286 E->getTypeOperandSourceInfo()->getType()->getDependence()); in computeDependence()
288 D = turnTypeToValueDependence(E->getExprOperand()->getDependence()); in computeDependence()
289 // typeid is never type-dependent (C++ [temp.dep.expr]p4) in computeDependence()
293 ExprDependence clang::computeDependence(MSPropertyRefExpr *E) { in computeDependence() argument
294 return E->getBaseExpr()->getDependence() & ~ExprDependence::Type; in computeDependence()
297 ExprDependence clang::computeDependence(MSPropertySubscriptExpr *E) { in computeDependence() argument
298 return E->getIdx()->getDependence(); in computeDependence()
301 ExprDependence clang::computeDependence(CXXUuidofExpr *E) { in computeDependence() argument
302 if (E->isTypeOperand()) in computeDependence()
304 E->getTypeOperandSourceInfo()->getType()->getDependence())); in computeDependence()
306 return turnTypeToValueDependence(E->getExprOperand()->getDependence()); in computeDependence()
309 ExprDependence clang::computeDependence(CXXThisExpr *E) { in computeDependence() argument
310 // 'this' is type-dependent if the class type of the enclosing in computeDependence()
312 auto D = toExprDependenceForImpliedType(E->getType()->getDependence()); in computeDependence()
316 // is type-dependent, so is the object and thus 'this'. in computeDependence()
320 if (E->isCapturedByCopyInLambdaWithExplicitObjectParameter()) in computeDependence()
327 ExprDependence clang::computeDependence(CXXThrowExpr *E) { in computeDependence() argument
328 auto *Op = E->getSubExpr(); in computeDependence()
331 return Op->getDependence() & ~ExprDependence::TypeValue; in computeDependence()
334 ExprDependence clang::computeDependence(CXXBindTemporaryExpr *E) { in computeDependence() argument
335 return E->getSubExpr()->getDependence(); in computeDependence()
338 ExprDependence clang::computeDependence(CXXScalarValueInitExpr *E) { in computeDependence() argument
339 auto D = toExprDependenceForImpliedType(E->getType()->getDependence()); in computeDependence()
340 if (auto *TSI = E->getTypeSourceInfo()) in computeDependence()
341 D |= toExprDependenceAsWritten(TSI->getType()->getDependence()); in computeDependence()
345 ExprDependence clang::computeDependence(CXXDeleteExpr *E) { in computeDependence() argument
346 return turnTypeToValueDependence(E->getArgument()->getDependence()); in computeDependence()
349 ExprDependence clang::computeDependence(ArrayTypeTraitExpr *E) { in computeDependence() argument
350 auto D = toExprDependenceAsWritten(E->getQueriedType()->getDependence()); in computeDependence()
351 if (auto *Dim = E->getDimensionExpression()) in computeDependence()
352 D |= Dim->getDependence(); in computeDependence()
356 ExprDependence clang::computeDependence(ExpressionTraitExpr *E) { in computeDependence() argument
357 // Never type-dependent. in computeDependence()
358 auto D = E->getQueriedExpression()->getDependence() & ~ExprDependence::Type; in computeDependence()
359 // Value-dependent if the argument is type-dependent. in computeDependence()
360 if (E->getQueriedExpression()->isTypeDependent()) in computeDependence()
365 ExprDependence clang::computeDependence(CXXNoexceptExpr *E, CanThrowResult CT) { in computeDependence() argument
366 auto D = E->getOperand()->getDependence() & ~ExprDependence::TypeValue; in computeDependence()
372 ExprDependence clang::computeDependence(PackExpansionExpr *E) { in computeDependence() argument
373 return (E->getPattern()->getDependence() & ~ExprDependence::UnexpandedPack) | in computeDependence()
377 ExprDependence clang::computeDependence(PackIndexingExpr *E) { in computeDependence() argument
379 ExprDependence PatternDep = E->getPackIdExpression()->getDependence() & in computeDependence()
382 ExprDependence D = E->getIndexExpr()->getDependence(); in computeDependence()
384 D |= E->getIndexExpr()->getDependence() | PatternDep | in computeDependence()
387 ArrayRef<Expr *> Exprs = E->getExpressions(); in computeDependence()
391 else if (!E->getIndexExpr()->isInstantiationDependent()) { in computeDependence()
392 std::optional<unsigned> Index = E->getSelectedIndex(); in computeDependence()
394 D |= Exprs[*Index]->getDependence(); in computeDependence()
399 ExprDependence clang::computeDependence(SubstNonTypeTemplateParmExpr *E) { in computeDependence() argument
400 return E->getReplacement()->getDependence(); in computeDependence()
403 ExprDependence clang::computeDependence(CoroutineSuspendExpr *E) { in computeDependence() argument
404 if (auto *Resume = E->getResumeExpr()) in computeDependence()
405 return (Resume->getDependence() & in computeDependence()
407 (E->getCommonExpr()->getDependence() & ~ExprDependence::TypeValue); in computeDependence()
408 return E->getCommonExpr()->getDependence() | in computeDependence()
412 ExprDependence clang::computeDependence(DependentCoawaitExpr *E) { in computeDependence() argument
413 return E->getOperand()->getDependence() | in computeDependence()
417 ExprDependence clang::computeDependence(ObjCBoxedExpr *E) { in computeDependence() argument
418 return E->getSubExpr()->getDependence(); in computeDependence()
421 ExprDependence clang::computeDependence(ObjCEncodeExpr *E) { in computeDependence() argument
422 return toExprDependenceAsWritten(E->getEncodedType()->getDependence()); in computeDependence()
425 ExprDependence clang::computeDependence(ObjCIvarRefExpr *E) { in computeDependence() argument
426 return turnTypeToValueDependence(E->getBase()->getDependence()); in computeDependence()
429 ExprDependence clang::computeDependence(ObjCPropertyRefExpr *E) { in computeDependence() argument
430 if (E->isObjectReceiver()) in computeDependence()
431 return E->getBase()->getDependence() & ~ExprDependence::Type; in computeDependence()
432 if (E->isSuperReceiver()) in computeDependence()
434 E->getSuperReceiverType()->getDependence()) & in computeDependence()
436 assert(E->isClassReceiver()); in computeDependence()
440 ExprDependence clang::computeDependence(ObjCSubscriptRefExpr *E) { in computeDependence() argument
441 return E->getBaseExpr()->getDependence() | E->getKeyExpr()->getDependence(); in computeDependence()
444 ExprDependence clang::computeDependence(ObjCIsaExpr *E) { in computeDependence() argument
445 return E->getBase()->getDependence() & ~ExprDependence::Type & in computeDependence()
449 ExprDependence clang::computeDependence(ObjCIndirectCopyRestoreExpr *E) { in computeDependence() argument
450 return E->getSubExpr()->getDependence(); in computeDependence()
453 ExprDependence clang::computeDependence(ArraySectionExpr *E) { in computeDependence() argument
454 auto D = E->getBase()->getDependence(); in computeDependence()
455 if (auto *LB = E->getLowerBound()) in computeDependence()
456 D |= LB->getDependence(); in computeDependence()
457 if (auto *Len = E->getLength()) in computeDependence()
458 D |= Len->getDependence(); in computeDependence()
460 if (E->isOMPArraySection()) { in computeDependence()
461 if (auto *Stride = E->getStride()) in computeDependence()
462 D |= Stride->getDependence(); in computeDependence()
467 ExprDependence clang::computeDependence(OMPArrayShapingExpr *E) { in computeDependence() argument
468 auto D = E->getBase()->getDependence(); in computeDependence()
469 for (Expr *Dim: E->getDimensions()) in computeDependence()
471 D |= turnValueToTypeDependence(Dim->getDependence()); in computeDependence()
475 ExprDependence clang::computeDependence(OMPIteratorExpr *E) { in computeDependence() argument
476 auto D = toExprDependenceForImpliedType(E->getType()->getDependence()); in computeDependence()
477 for (unsigned I = 0, End = E->numOfIterators(); I < End; ++I) { in computeDependence()
478 if (auto *DD = cast_or_null<DeclaratorDecl>(E->getIteratorDecl(I))) { in computeDependence()
480 if (auto *TSI = DD->getTypeSourceInfo()) { in computeDependence()
481 D |= toExprDependenceAsWritten(TSI->getType()->getDependence()); in computeDependence()
484 OMPIteratorExpr::IteratorRange IR = E->getIteratorRange(I); in computeDependence()
486 D |= BE->getDependence(); in computeDependence()
488 D |= EE->getDependence(); in computeDependence()
490 D |= SE->getDependence(); in computeDependence()
495 /// Compute the type-, value-, and instantiation-dependence of a
498 ExprDependence clang::computeDependence(DeclRefExpr *E, const ASTContext &Ctx) { in computeDependence() argument
501 if (auto *NNS = E->getQualifier()) in computeDependence()
502 Deps |= toExprDependence(NNS->getDependence() & in computeDependence()
505 if (auto *FirstArg = E->getTemplateArgs()) { in computeDependence()
506 unsigned NumArgs = E->getNumTemplateArgs(); in computeDependence()
508 Deps |= toExprDependence(Arg->getArgument().getDependence()); in computeDependence()
511 auto *Decl = E->getDecl(); in computeDependence()
512 auto Type = E->getType(); in computeDependence()
514 if (Decl->isParameterPack()) in computeDependence()
516 Deps |= toExprDependenceForImpliedType(Type->getDependence()) & in computeDependence()
520 // An id-expression is type-dependent if it contains: in computeDependence()
522 // - an identifier associated by name lookup with one or more declarations in computeDependence()
524 // - an identifier associated by name lookup with an entity captured by in computeDependence()
526 // in a lambda-expression that has an explicit object parameter whose in computeDependence()
532 if (Type->isDependentType()) in computeDependence()
534 else if (Type->isInstantiationDependentType()) in computeDependence()
537 // - an identifier associated by name lookup with an entity captured by in computeDependence()
539 if (E->isCapturedByCopyInLambdaWithExplicitObjectParameter()) in computeDependence()
542 // - a conversion-function-id that specifies a dependent type in computeDependence()
543 if (Decl->getDeclName().getNameKind() == in computeDependence()
545 QualType T = Decl->getDeclName().getCXXNameType(); in computeDependence()
546 if (T->isDependentType()) in computeDependence()
549 if (T->isInstantiationDependentType()) in computeDependence()
553 // - a template-id that is dependent, in computeDependence()
554 // - a nested-name-specifier or a qualified-id that names a member of an in computeDependence()
563 // An id-expression is value-dependent if: in computeDependence()
565 // - it is type-dependent [handled above] in computeDependence()
567 // - it is the name of a non-type template parameter, in computeDependence()
571 // - it names a potentially-constant variable that is initialized with an in computeDependence()
572 // expression that is value-dependent in computeDependence()
574 if (const Expr *Init = Var->getAnyInitializer()) { in computeDependence()
575 if (Init->containsErrors()) in computeDependence()
578 if (Var->mightBeUsableInConstantExpressions(Ctx) && in computeDependence()
579 Init->isValueDependent()) in computeDependence()
583 // - it names a static data member that is a dependent member of the in computeDependence()
584 // current instantiation and is not initialized in a member-declarator, in computeDependence()
585 if (Var->isStaticDataMember() && in computeDependence()
586 Var->getDeclContext()->isDependentContext() && in computeDependence()
587 !Var->getFirstDecl()->hasInit()) { in computeDependence()
588 const VarDecl *First = Var->getFirstDecl(); in computeDependence()
589 TypeSourceInfo *TInfo = First->getTypeSourceInfo(); in computeDependence()
590 if (TInfo->getType()->isIncompleteArrayType()) { in computeDependence()
592 } else if (!First->hasInit()) { in computeDependence()
600 // - it names a static member function that is a dependent member of the in computeDependence()
604 // effect: any use of a non-static member function name requires either in computeDependence()
605 // forming a pointer-to-member or providing an object parameter, either of in computeDependence()
606 // which makes the overall expression value-dependent. in computeDependence()
608 if (MD->isStatic() && Decl->getDeclContext()->isDependentContext()) in computeDependence()
615 ExprDependence clang::computeDependence(RecoveryExpr *E) { in computeDependence() argument
617 // - always value-dependent, and therefore instantiation dependent in computeDependence()
618 // - contains errors (ExprDependence::Error), by definition in computeDependence()
619 // - type-dependent if we don't know the type (fallback to an opaque in computeDependence()
621 // type-dependent subexpressions. in computeDependence()
622 auto D = toExprDependenceAsWritten(E->getType()->getDependence()) | in computeDependence()
624 // FIXME: remove the type-dependent bit from subexpressions, if the in computeDependence()
625 // RecoveryExpr has a non-dependent type. in computeDependence()
626 for (auto *S : E->subExpressions()) in computeDependence()
627 D |= S->getDependence(); in computeDependence()
631 ExprDependence clang::computeDependence(SYCLUniqueStableNameExpr *E) { in computeDependence() argument
633 E->getTypeSourceInfo()->getType()->getDependence()); in computeDependence()
636 ExprDependence clang::computeDependence(PredefinedExpr *E) { in computeDependence() argument
637 return toExprDependenceForImpliedType(E->getType()->getDependence()); in computeDependence()
640 ExprDependence clang::computeDependence(CallExpr *E, in computeDependence() argument
642 auto D = E->getCallee()->getDependence(); in computeDependence()
643 if (E->getType()->isDependentType()) in computeDependence()
645 for (auto *A : llvm::ArrayRef(E->getArgs(), E->getNumArgs())) { in computeDependence()
647 D |= A->getDependence(); in computeDependence()
650 D |= A->getDependence(); in computeDependence()
654 ExprDependence clang::computeDependence(OffsetOfExpr *E) { in computeDependence() argument
656 E->getTypeSourceInfo()->getType()->getDependence())); in computeDependence()
657 for (unsigned I = 0, N = E->getNumExpressions(); I < N; ++I) in computeDependence()
658 D |= turnTypeToValueDependence(E->getIndexExpr(I)->getDependence()); in computeDependence()
671 ExprDependence clang::computeDependence(MemberExpr *E) { in computeDependence() argument
672 auto D = E->getBase()->getDependence(); in computeDependence()
673 D |= getDependenceInExpr(E->getMemberNameInfo()); in computeDependence()
675 if (auto *NNS = E->getQualifier()) in computeDependence()
676 D |= toExprDependence(NNS->getDependence() & in computeDependence()
679 for (const auto &A : E->template_arguments()) in computeDependence()
682 auto *MemberDecl = E->getMemberDecl(); in computeDependence()
684 DeclContext *DC = MemberDecl->getDeclContext(); in computeDependence()
688 if (RD && RD->isDependentContext() && RD->isCurrentInstantiation(DC)) { in computeDependence()
689 if (!E->getType()->isDependentType()) in computeDependence()
693 // Bitfield with value-dependent width is type-dependent. in computeDependence()
694 if (FD && FD->isBitField() && FD->getBitWidth()->isValueDependent()) { in computeDependence()
701 ExprDependence clang::computeDependence(InitListExpr *E) { in computeDependence() argument
703 for (auto *A : E->inits()) in computeDependence()
704 D |= A->getDependence(); in computeDependence()
708 ExprDependence clang::computeDependence(ShuffleVectorExpr *E) { in computeDependence() argument
709 auto D = toExprDependenceForImpliedType(E->getType()->getDependence()); in computeDependence()
710 for (auto *C : llvm::ArrayRef(E->getSubExprs(), E->getNumSubExprs())) in computeDependence()
711 D |= C->getDependence(); in computeDependence()
715 ExprDependence clang::computeDependence(GenericSelectionExpr *E, in computeDependence() argument
719 for (auto *AE : E->getAssocExprs()) in computeDependence()
720 D |= AE->getDependence() & ExprDependence::Error; in computeDependence()
722 if (E->isExprPredicate()) in computeDependence()
723 D |= E->getControllingExpr()->getDependence() & ExprDependence::Error; in computeDependence()
726 E->getControllingType()->getType()->getDependence()); in computeDependence()
728 if (E->isResultDependent()) in computeDependence()
730 return D | (E->getResultExpr()->getDependence() & in computeDependence()
734 ExprDependence clang::computeDependence(DesignatedInitExpr *E) { in computeDependence() argument
735 auto Deps = E->getInit()->getDependence(); in computeDependence()
736 for (const auto &D : E->designators()) { in computeDependence()
739 DesignatorDeps |= E->getArrayIndex(D)->getDependence(); in computeDependence()
741 DesignatorDeps |= E->getArrayRangeStart(D)->getDependence() | in computeDependence()
742 E->getArrayRangeEnd(D)->getDependence(); in computeDependence()
751 auto D = O->getSyntacticForm()->getDependence(); in computeDependence()
752 for (auto *E : O->semantics()) in computeDependence() local
753 D |= E->getDependence(); in computeDependence()
759 for (auto *E : llvm::ArrayRef(A->getSubExprs(), A->getNumSubExprs())) in computeDependence() local
760 D |= E->getDependence(); in computeDependence()
764 ExprDependence clang::computeDependence(CXXNewExpr *E) { in computeDependence() argument
766 E->getAllocatedTypeSourceInfo()->getType()->getDependence()); in computeDependence()
767 D |= toExprDependenceForImpliedType(E->getAllocatedType()->getDependence()); in computeDependence()
768 auto Size = E->getArraySize(); in computeDependence()
770 D |= turnTypeToValueDependence((*Size)->getDependence()); in computeDependence()
771 if (auto *I = E->getInitializer()) in computeDependence()
772 D |= turnTypeToValueDependence(I->getDependence()); in computeDependence()
773 for (auto *A : E->placement_arguments()) in computeDependence()
774 D |= turnTypeToValueDependence(A->getDependence()); in computeDependence()
778 ExprDependence clang::computeDependence(CXXPseudoDestructorExpr *E) { in computeDependence() argument
779 auto D = E->getBase()->getDependence(); in computeDependence()
780 if (auto *TSI = E->getDestroyedTypeInfo()) in computeDependence()
781 D |= toExprDependenceAsWritten(TSI->getType()->getDependence()); in computeDependence()
782 if (auto *ST = E->getScopeTypeInfo()) in computeDependence()
784 toExprDependenceAsWritten(ST->getType()->getDependence())); in computeDependence()
785 if (auto *Q = E->getQualifier()) in computeDependence()
786 D |= toExprDependence(Q->getDependence() & in computeDependence()
792 clang::computeDependence(OverloadExpr *E, bool KnownDependent, in computeDependence() argument
802 Deps |= getDependenceInExpr(E->getNameInfo()); in computeDependence()
803 if (auto *Q = E->getQualifier()) in computeDependence()
804 Deps |= toExprDependence(Q->getDependence() & in computeDependence()
806 for (auto *D : E->decls()) { in computeDependence()
807 if (D->getDeclContext()->isDependentContext() || in computeDependence()
814 for (const auto &A : E->template_arguments()) in computeDependence()
819 ExprDependence clang::computeDependence(DependentScopeDeclRefExpr *E) { in computeDependence() argument
821 D |= getDependenceInExpr(E->getNameInfo()); in computeDependence()
822 if (auto *Q = E->getQualifier()) in computeDependence()
823 D |= toExprDependence(Q->getDependence()); in computeDependence()
824 for (const auto &A : E->template_arguments()) in computeDependence()
829 ExprDependence clang::computeDependence(CXXConstructExpr *E) { in computeDependence() argument
831 toExprDependenceForImpliedType(E->getType()->getDependence()); in computeDependence()
832 for (auto *A : E->arguments()) in computeDependence()
833 D |= A->getDependence() & ~ExprDependence::Type; in computeDependence()
837 ExprDependence clang::computeDependence(CXXTemporaryObjectExpr *E) { in computeDependence() argument
838 CXXConstructExpr *BaseE = E; in computeDependence()
840 E->getTypeSourceInfo()->getType()->getDependence()) | in computeDependence()
844 ExprDependence clang::computeDependence(CXXDefaultInitExpr *E) { in computeDependence() argument
845 return E->getExpr()->getDependence(); in computeDependence()
848 ExprDependence clang::computeDependence(CXXDefaultArgExpr *E) { in computeDependence() argument
849 return E->getExpr()->getDependence(); in computeDependence()
852 ExprDependence clang::computeDependence(LambdaExpr *E, in computeDependence() argument
854 auto D = toExprDependenceForImpliedType(E->getType()->getDependence()); in computeDependence()
860 ExprDependence clang::computeDependence(CXXUnresolvedConstructExpr *E) { in computeDependence() argument
862 D |= toExprDependenceAsWritten(E->getTypeAsWritten()->getDependence()); in computeDependence()
863 D |= toExprDependenceForImpliedType(E->getType()->getDependence()); in computeDependence()
864 for (auto *A : E->arguments()) in computeDependence()
865 D |= A->getDependence() & in computeDependence()
870 ExprDependence clang::computeDependence(CXXDependentScopeMemberExpr *E) { in computeDependence() argument
872 if (!E->isImplicitAccess()) in computeDependence()
873 D |= E->getBase()->getDependence(); in computeDependence()
874 if (auto *Q = E->getQualifier()) in computeDependence()
875 D |= toExprDependence(Q->getDependence()); in computeDependence()
876 D |= getDependenceInExpr(E->getMemberNameInfo()); in computeDependence()
877 for (const auto &A : E->template_arguments()) in computeDependence()
882 ExprDependence clang::computeDependence(MaterializeTemporaryExpr *E) { in computeDependence() argument
883 return E->getSubExpr()->getDependence(); in computeDependence()
886 ExprDependence clang::computeDependence(CXXFoldExpr *E) { in computeDependence() argument
888 for (const auto *C : {E->getLHS(), E->getRHS()}) { in computeDependence()
890 D |= C->getDependence() & ~ExprDependence::UnexpandedPack; in computeDependence()
895 ExprDependence clang::computeDependence(CXXParenListInitExpr *E) { in computeDependence() argument
897 for (const auto *A : E->getInitExprs()) in computeDependence()
898 D |= A->getDependence(); in computeDependence()
902 ExprDependence clang::computeDependence(TypeTraitExpr *E) { in computeDependence() argument
904 for (const auto *A : E->getArgs()) in computeDependence()
905 D |= toExprDependenceAsWritten(A->getType()->getDependence()) & in computeDependence()
910 ExprDependence clang::computeDependence(ConceptSpecializationExpr *E, in computeDependence() argument
916 E->getTemplateArgsAsWritten()->arguments()) { in computeDependence()
925 if(!ValueDependent && E->getSatisfaction().ContainsErrors) in computeDependence()
930 ExprDependence clang::computeDependence(ObjCArrayLiteral *E) { in computeDependence() argument
932 Expr **Elements = E->getElements(); in computeDependence()
933 for (unsigned I = 0, N = E->getNumElements(); I != N; ++I) in computeDependence()
934 D |= turnTypeToValueDependence(Elements[I]->getDependence()); in computeDependence()
938 ExprDependence clang::computeDependence(ObjCDictionaryLiteral *E) { in computeDependence() argument
940 for (unsigned I = 0, N = E->getNumElements(); I < N; ++I) { in computeDependence()
941 auto KV = E->getKeyValueElement(I); in computeDependence()
942 auto KVDeps = turnTypeToValueDependence(KV.Key->getDependence() | in computeDependence()
943 KV.Value->getDependence()); in computeDependence()
951 ExprDependence clang::computeDependence(ObjCMessageExpr *E) { in computeDependence() argument
953 if (auto *R = E->getInstanceReceiver()) in computeDependence()
954 D |= R->getDependence(); in computeDependence()
956 D |= toExprDependenceForImpliedType(E->getType()->getDependence()); in computeDependence()
957 for (auto *A : E->arguments()) in computeDependence()
958 D |= A->getDependence(); in computeDependence()