clang 19.0.0git
ComputeDependence.cpp
Go to the documentation of this file.
1//===- ComputeDependence.cpp ----------------------------------------------===//
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
10#include "clang/AST/Attr.h"
11#include "clang/AST/DeclCXX.h"
14#include "clang/AST/Expr.h"
15#include "clang/AST/ExprCXX.h"
17#include "clang/AST/ExprObjC.h"
20#include "llvm/ADT/ArrayRef.h"
21
22using namespace clang;
23
25 return E->getSubExpr()->getDependence();
26}
27
30 if (auto *S = E->getSourceExpr())
31 D |= S->getDependence();
32 assert(!(D & ExprDependence::UnexpandedPack));
33 return D;
34}
35
37 return E->getSubExpr()->getDependence();
38}
39
41 const ASTContext &Ctx) {
42 ExprDependence Dep =
43 // FIXME: Do we need to look at the type?
46
47 // C++ [temp.dep.constexpr]p5:
48 // An expression of the form & qualified-id where the qualified-id names a
49 // dependent member of the current instantiation is value-dependent. An
50 // expression of the form & cast-expression is also value-dependent if
51 // evaluating cast-expression as a core constant expression succeeds and
52 // the result of the evaluation refers to a templated entity that is an
53 // object with static or thread storage duration or a member function.
54 //
55 // What this amounts to is: constant-evaluate the operand and check whether it
56 // refers to a templated entity other than a variable with local storage.
57 if (Ctx.getLangOpts().CPlusPlus && E->getOpcode() == UO_AddrOf &&
58 !(Dep & ExprDependence::Value)) {
59 Expr::EvalResult Result;
61 Result.Diag = &Diag;
62 // FIXME: This doesn't enforce the C++98 constant expression rules.
63 if (E->getSubExpr()->EvaluateAsConstantExpr(Result, Ctx) && Diag.empty() &&
64 Result.Val.isLValue()) {
65 auto *VD = Result.Val.getLValueBase().dyn_cast<const ValueDecl *>();
66 if (VD && VD->isTemplated()) {
67 auto *VarD = dyn_cast<VarDecl>(VD);
68 if (!VarD || !VarD->hasLocalStorage())
69 Dep |= ExprDependence::Value;
70 }
71 }
72 }
73
74 return Dep;
75}
76
78 // Never type-dependent (C++ [temp.dep.expr]p3).
79 // Value-dependent if the argument is type-dependent.
80 if (E->isArgumentType())
83
84 auto ArgDeps = E->getArgumentExpr()->getDependence();
85 auto Deps = ArgDeps & ~ExprDependence::TypeValue;
86 // Value-dependent if the argument is type-dependent.
87 if (ArgDeps & ExprDependence::Type)
88 Deps |= ExprDependence::Value;
89 // Check to see if we are in the situation where alignof(decl) should be
90 // dependent because decl's alignment is dependent.
91 auto ExprKind = E->getKind();
92 if (ExprKind != UETT_AlignOf && ExprKind != UETT_PreferredAlignOf)
93 return Deps;
94 if ((Deps & ExprDependence::Value) && (Deps & ExprDependence::Instantiation))
95 return Deps;
96
97 auto *NoParens = E->getArgumentExpr()->IgnoreParens();
98 const ValueDecl *D = nullptr;
99 if (const auto *DRE = dyn_cast<DeclRefExpr>(NoParens))
100 D = DRE->getDecl();
101 else if (const auto *ME = dyn_cast<MemberExpr>(NoParens))
102 D = ME->getMemberDecl();
103 if (!D)
104 return Deps;
105 for (const auto *I : D->specific_attrs<AlignedAttr>()) {
106 if (I->isAlignmentErrorDependent())
107 Deps |= ExprDependence::Error;
108 if (I->isAlignmentDependent())
109 Deps |= ExprDependence::ValueInstantiation;
110 }
111 return Deps;
112}
113
115 return E->getLHS()->getDependence() | E->getRHS()->getDependence();
116}
117
119 return E->getBase()->getDependence() | E->getRowIdx()->getDependence() |
121 : ExprDependence::None);
122}
123
129}
130
132 // We model implicit conversions as combining the dependence of their
133 // subexpression, apart from its type, with the semantic portion of the
134 // target type.
137 if (auto *S = E->getSubExpr())
138 D |= S->getDependence() & ~ExprDependence::Type;
139 return D;
140}
141
143 // Cast expressions are type-dependent if the type is
144 // dependent (C++ [temp.dep.expr]p3).
145 // Cast expressions are value-dependent if the type is
146 // dependent or if the subexpression is value-dependent.
147 //
148 // Note that we also need to consider the dependence of the actual type here,
149 // because when the type as written is a deduced type, that type is not
150 // dependent, but it may be deduced as a dependent type.
153 cast<ExplicitCastExpr>(E)->getTypeAsWritten()->getDependence()) |
155 if (auto *S = E->getSubExpr())
156 D |= S->getDependence() & ~ExprDependence::Type;
157 return D;
158}
159
161 return E->getLHS()->getDependence() | E->getRHS()->getDependence();
162}
163
165 // The type of the conditional operator depends on the type of the conditional
166 // to support the GCC vector conditional extension. Additionally,
167 // [temp.dep.expr] does specify state that this should be dependent on ALL sub
168 // expressions.
169 return E->getCond()->getDependence() | E->getLHS()->getDependence() |
170 E->getRHS()->getDependence();
171}
172
174 return E->getCommon()->getDependence() | E->getFalseExpr()->getDependence();
175}
176
179 // Propagate dependence of the result.
180 if (const auto *CompoundExprResult =
181 dyn_cast_or_null<ValueStmt>(E->getSubStmt()->getStmtExprResult()))
182 if (const Expr *ResultExpr = CompoundExprResult->getExprStmt())
183 D |= ResultExpr->getDependence();
184 // Note: we treat a statement-expression in a dependent context as always
185 // being value- and instantiation-dependent. This matches the behavior of
186 // lambda-expressions and GCC.
187 if (TemplateDepth)
188 D |= ExprDependence::ValueInstantiation;
189 // A param pack cannot be expanded over stmtexpr boundaries.
190 return D & ~ExprDependence::UnexpandedPack;
191}
192
197 if (!E->getType()->isDependentType())
199 return D;
200}
201
203 if (E->isConditionDependent())
204 return ExprDependence::TypeValueInstantiation |
205 E->getCond()->getDependence() | E->getLHS()->getDependence() |
206 E->getRHS()->getDependence();
207
208 auto Cond = E->getCond()->getDependence();
209 auto Active = E->getLHS()->getDependence();
210 auto Inactive = E->getRHS()->getDependence();
211 if (!E->isConditionTrue())
212 std::swap(Active, Inactive);
213 // Take type- and value- dependency from the active branch. Propagate all
214 // other flags from all branches.
215 return (Active & ExprDependence::TypeValue) |
216 ((Cond | Active | Inactive) & ~ExprDependence::TypeValue);
217}
218
220 auto D = ExprDependence::None;
221 for (auto *E : P->exprs())
222 D |= E->getDependence();
223 return D;
224}
225
230 return D;
231}
232
235 (ExprDependence::Instantiation | ExprDependence::Error);
236}
237
239 auto D = E->getCommonExpr()->getDependence() |
240 E->getSubExpr()->getDependence() | ExprDependence::Instantiation;
242 D &= ~ExprDependence::Instantiation;
244}
245
248 ExprDependence::Instantiation;
249}
250
252 return E->getBase()->getDependence();
253}
254
258 D |= ExprDependence::Instantiation;
259 return D;
260}
261
263 // FIXME: AsTypeExpr doesn't store the type as written. Assume the expression
264 // type has identical sugar for now, so is a type-as-written.
267 if (!E->getType()->isDependentType())
269 return D;
270}
271
273 return E->getSemanticForm()->getDependence();
274}
275
279 return D;
280}
281
283 auto D = ExprDependence::None;
284 if (E->isTypeOperand())
287 else
289 // typeid is never type-dependent (C++ [temp.dep.expr]p4)
290 return D & ~ExprDependence::Type;
291}
292
295}
296
298 return E->getIdx()->getDependence();
299}
300
302 if (E->isTypeOperand())
305
307}
308
310 // 'this' is type-dependent if the class type of the enclosing
311 // member function is dependent (C++ [temp.dep.expr]p2)
313
314 // If a lambda with an explicit object parameter captures '*this', then
315 // 'this' now refers to the captured copy of lambda, and if the lambda
316 // is type-dependent, so is the object and thus 'this'.
317 //
318 // Note: The standard does not mention this case explicitly, but we need
319 // to do this so we can mark NSDM accesses as dependent.
321 D |= ExprDependence::Type;
322
323 assert(!(D & ExprDependence::UnexpandedPack));
324 return D;
325}
326
328 auto *Op = E->getSubExpr();
329 if (!Op)
330 return ExprDependence::None;
331 return Op->getDependence() & ~ExprDependence::TypeValue;
332}
333
335 return E->getSubExpr()->getDependence();
336}
337
340 if (auto *TSI = E->getTypeSourceInfo())
341 D |= toExprDependenceAsWritten(TSI->getType()->getDependence());
342 return D;
343}
344
347}
348
351 if (auto *Dim = E->getDimensionExpression())
352 D |= Dim->getDependence();
354}
355
357 // Never type-dependent.
359 // Value-dependent if the argument is type-dependent.
361 D |= ExprDependence::Value;
362 return D;
363}
364
366 auto D = E->getOperand()->getDependence() & ~ExprDependence::TypeValue;
367 if (CT == CT_Dependent)
368 D |= ExprDependence::ValueInstantiation;
369 return D;
370}
371
373 return (E->getPattern()->getDependence() & ~ExprDependence::UnexpandedPack) |
374 ExprDependence::TypeValueInstantiation;
375}
376
379 ArrayRef<Expr *> Exprs = E->getExpressions();
380 if (Exprs.empty())
381 D |= (E->getPackIdExpression()->getDependence() |
382 ExprDependence::TypeValueInstantiation) &
383 ~ExprDependence::UnexpandedPack;
384 else if (!E->getIndexExpr()->isInstantiationDependent()) {
385 std::optional<unsigned> Index = E->getSelectedIndex();
386 assert(Index && *Index < Exprs.size() && "pack index out of bound");
387 D |= Exprs[*Index]->getDependence();
388 }
389 return D;
390}
391
393 return E->getReplacement()->getDependence();
394}
395
397 if (auto *Resume = E->getResumeExpr())
398 return (Resume->getDependence() &
399 (ExprDependence::TypeValue | ExprDependence::Error)) |
400 (E->getCommonExpr()->getDependence() & ~ExprDependence::TypeValue);
401 return E->getCommonExpr()->getDependence() |
402 ExprDependence::TypeValueInstantiation;
403}
404
406 return E->getOperand()->getDependence() |
407 ExprDependence::TypeValueInstantiation;
408}
409
411 return E->getSubExpr()->getDependence();
412}
413
416}
417
420}
421
423 if (E->isObjectReceiver())
425 if (E->isSuperReceiver())
428 ~ExprDependence::TypeValue;
429 assert(E->isClassReceiver());
430 return ExprDependence::None;
431}
432
434 return E->getBaseExpr()->getDependence() | E->getKeyExpr()->getDependence();
435}
436
439 ~ExprDependence::UnexpandedPack;
440}
441
443 return E->getSubExpr()->getDependence();
444}
445
447 auto D = E->getBase()->getDependence();
448 if (auto *LB = E->getLowerBound())
449 D |= LB->getDependence();
450 if (auto *Len = E->getLength())
451 D |= Len->getDependence();
452 return D;
453}
454
456 auto D = E->getBase()->getDependence();
457 for (Expr *Dim: E->getDimensions())
458 if (Dim)
459 D |= turnValueToTypeDependence(Dim->getDependence());
460 return D;
461}
462
465 for (unsigned I = 0, End = E->numOfIterators(); I < End; ++I) {
466 if (auto *DD = cast_or_null<DeclaratorDecl>(E->getIteratorDecl(I))) {
467 // If the type is omitted, it's 'int', and is not dependent in any way.
468 if (auto *TSI = DD->getTypeSourceInfo()) {
469 D |= toExprDependenceAsWritten(TSI->getType()->getDependence());
470 }
471 }
473 if (Expr *BE = IR.Begin)
474 D |= BE->getDependence();
475 if (Expr *EE = IR.End)
476 D |= EE->getDependence();
477 if (Expr *SE = IR.Step)
478 D |= SE->getDependence();
479 }
480 return D;
481}
482
483/// Compute the type-, value-, and instantiation-dependence of a
484/// declaration reference
485/// based on the declaration being referenced.
487 auto Deps = ExprDependence::None;
488
489 if (auto *NNS = E->getQualifier())
490 Deps |= toExprDependence(NNS->getDependence() &
491 ~NestedNameSpecifierDependence::Dependent);
492
493 if (auto *FirstArg = E->getTemplateArgs()) {
494 unsigned NumArgs = E->getNumTemplateArgs();
495 for (auto *Arg = FirstArg, *End = FirstArg + NumArgs; Arg < End; ++Arg)
496 Deps |= toExprDependence(Arg->getArgument().getDependence());
497 }
498
499 auto *Decl = E->getDecl();
500 auto Type = E->getType();
501
502 if (Decl->isParameterPack())
503 Deps |= ExprDependence::UnexpandedPack;
505 ExprDependence::Error;
506
507 // C++ [temp.dep.expr]p3:
508 // An id-expression is type-dependent if it contains:
509
510 // - an identifier associated by name lookup with one or more declarations
511 // declared with a dependent type
512 // - an identifier associated by name lookup with an entity captured by
513 // copy ([expr.prim.lambda.capture])
514 // in a lambda-expression that has an explicit object parameter whose
515 // type is dependent ([dcl.fct]),
516 //
517 // [The "or more" case is not modeled as a DeclRefExpr. There are a bunch
518 // more bullets here that we handle by treating the declaration as having a
519 // dependent type if they involve a placeholder type that can't be deduced.]
520 if (Type->isDependentType())
521 Deps |= ExprDependence::TypeValueInstantiation;
523 Deps |= ExprDependence::Instantiation;
524
525 // - an identifier associated by name lookup with an entity captured by
526 // copy ([expr.prim.lambda.capture])
528 Deps |= ExprDependence::Type;
529
530 // - a conversion-function-id that specifies a dependent type
531 if (Decl->getDeclName().getNameKind() ==
533 QualType T = Decl->getDeclName().getCXXNameType();
534 if (T->isDependentType())
535 return Deps | ExprDependence::TypeValueInstantiation;
536
538 Deps |= ExprDependence::Instantiation;
539 }
540
541 // - a template-id that is dependent,
542 // - a nested-name-specifier or a qualified-id that names a member of an
543 // unknown specialization
544 // [These are not modeled as DeclRefExprs.]
545
546 // or if it names a dependent member of the current instantiation that is a
547 // static data member of type "array of unknown bound of T" for some T
548 // [handled below].
549
550 // C++ [temp.dep.constexpr]p2:
551 // An id-expression is value-dependent if:
552
553 // - it is type-dependent [handled above]
554
555 // - it is the name of a non-type template parameter,
556 if (isa<NonTypeTemplateParmDecl>(Decl))
557 return Deps | ExprDependence::ValueInstantiation;
558
559 // - it names a potentially-constant variable that is initialized with an
560 // expression that is value-dependent
561 if (const auto *Var = dyn_cast<VarDecl>(Decl)) {
562 if (const Expr *Init = Var->getAnyInitializer()) {
563 if (Init->containsErrors())
564 Deps |= ExprDependence::Error;
565
566 if (Var->mightBeUsableInConstantExpressions(Ctx) &&
567 Init->isValueDependent())
568 Deps |= ExprDependence::ValueInstantiation;
569 }
570
571 // - it names a static data member that is a dependent member of the
572 // current instantiation and is not initialized in a member-declarator,
573 if (Var->isStaticDataMember() &&
574 Var->getDeclContext()->isDependentContext() &&
575 !Var->getFirstDecl()->hasInit()) {
576 const VarDecl *First = Var->getFirstDecl();
577 TypeSourceInfo *TInfo = First->getTypeSourceInfo();
578 if (TInfo->getType()->isIncompleteArrayType()) {
579 Deps |= ExprDependence::TypeValueInstantiation;
580 } else if (!First->hasInit()) {
581 Deps |= ExprDependence::ValueInstantiation;
582 }
583 }
584
585 return Deps;
586 }
587
588 // - it names a static member function that is a dependent member of the
589 // current instantiation
590 //
591 // FIXME: It's unclear that the restriction to static members here has any
592 // effect: any use of a non-static member function name requires either
593 // forming a pointer-to-member or providing an object parameter, either of
594 // which makes the overall expression value-dependent.
595 if (auto *MD = dyn_cast<CXXMethodDecl>(Decl)) {
596 if (MD->isStatic() && Decl->getDeclContext()->isDependentContext())
597 Deps |= ExprDependence::ValueInstantiation;
598 }
599
600 return Deps;
601}
602
604 // RecoveryExpr is
605 // - always value-dependent, and therefore instantiation dependent
606 // - contains errors (ExprDependence::Error), by definition
607 // - type-dependent if we don't know the type (fallback to an opaque
608 // dependent type), or the type is known and dependent, or it has
609 // type-dependent subexpressions.
611 ExprDependence::ErrorDependent;
612 // FIXME: remove the type-dependent bit from subexpressions, if the
613 // RecoveryExpr has a non-dependent type.
614 for (auto *S : E->subExpressions())
615 D |= S->getDependence();
616 return D;
617}
618
622}
623
626}
627
629 llvm::ArrayRef<Expr *> PreArgs) {
630 auto D = E->getCallee()->getDependence();
631 if (E->getType()->isDependentType())
632 D |= ExprDependence::Type;
633 for (auto *A : llvm::ArrayRef(E->getArgs(), E->getNumArgs())) {
634 if (A)
635 D |= A->getDependence();
636 }
637 for (auto *A : PreArgs)
638 D |= A->getDependence();
639 return D;
640}
641
645 for (unsigned I = 0, N = E->getNumExpressions(); I < N; ++I)
647 return D;
648}
649
651 auto D = ExprDependence::None;
652 if (Name.isInstantiationDependent())
653 D |= ExprDependence::Instantiation;
654 if (Name.containsUnexpandedParameterPack())
655 D |= ExprDependence::UnexpandedPack;
656 return D;
657}
658
660 auto D = E->getBase()->getDependence();
662
663 if (auto *NNS = E->getQualifier())
664 D |= toExprDependence(NNS->getDependence() &
665 ~NestedNameSpecifierDependence::Dependent);
666
667 for (const auto &A : E->template_arguments())
668 D |= toExprDependence(A.getArgument().getDependence());
669
670 auto *MemberDecl = E->getMemberDecl();
671 if (FieldDecl *FD = dyn_cast<FieldDecl>(MemberDecl)) {
672 DeclContext *DC = MemberDecl->getDeclContext();
673 // dyn_cast_or_null is used to handle objC variables which do not
674 // have a declaration context.
675 CXXRecordDecl *RD = dyn_cast_or_null<CXXRecordDecl>(DC);
676 if (RD && RD->isDependentContext() && RD->isCurrentInstantiation(DC)) {
677 if (!E->getType()->isDependentType())
679 }
680
681 // Bitfield with value-dependent width is type-dependent.
682 if (FD && FD->isBitField() && FD->getBitWidth()->isValueDependent()) {
683 D |= ExprDependence::Type;
684 }
685 }
686 return D;
687}
688
690 auto D = ExprDependence::None;
691 for (auto *A : E->inits())
692 D |= A->getDependence();
693 return D;
694}
695
698 for (auto *C : llvm::ArrayRef(E->getSubExprs(), E->getNumSubExprs()))
699 D |= C->getDependence();
700 return D;
701}
702
704 bool ContainsUnexpandedPack) {
705 auto D = ContainsUnexpandedPack ? ExprDependence::UnexpandedPack
706 : ExprDependence::None;
707 for (auto *AE : E->getAssocExprs())
708 D |= AE->getDependence() & ExprDependence::Error;
709
710 if (E->isExprPredicate())
711 D |= E->getControllingExpr()->getDependence() & ExprDependence::Error;
712 else
715
716 if (E->isResultDependent())
717 return D | ExprDependence::TypeValueInstantiation;
718 return D | (E->getResultExpr()->getDependence() &
719 ~ExprDependence::UnexpandedPack);
720}
721
723 auto Deps = E->getInit()->getDependence();
724 for (const auto &D : E->designators()) {
725 auto DesignatorDeps = ExprDependence::None;
726 if (D.isArrayDesignator())
727 DesignatorDeps |= E->getArrayIndex(D)->getDependence();
728 else if (D.isArrayRangeDesignator())
729 DesignatorDeps |= E->getArrayRangeStart(D)->getDependence() |
731 Deps |= DesignatorDeps;
732 if (DesignatorDeps & ExprDependence::TypeValue)
733 Deps |= ExprDependence::TypeValueInstantiation;
734 }
735 return Deps;
736}
737
739 auto D = O->getSyntacticForm()->getDependence();
740 for (auto *E : O->semantics())
741 D |= E->getDependence();
742 return D;
743}
744
746 auto D = ExprDependence::None;
747 for (auto *E : llvm::ArrayRef(A->getSubExprs(), A->getNumSubExprs()))
748 D |= E->getDependence();
749 return D;
750}
751
756 auto Size = E->getArraySize();
757 if (Size && *Size)
758 D |= turnTypeToValueDependence((*Size)->getDependence());
759 if (auto *I = E->getInitializer())
760 D |= turnTypeToValueDependence(I->getDependence());
761 for (auto *A : E->placement_arguments())
762 D |= turnTypeToValueDependence(A->getDependence());
763 return D;
764}
765
767 auto D = E->getBase()->getDependence();
768 if (auto *TSI = E->getDestroyedTypeInfo())
769 D |= toExprDependenceAsWritten(TSI->getType()->getDependence());
770 if (auto *ST = E->getScopeTypeInfo())
772 toExprDependenceAsWritten(ST->getType()->getDependence()));
773 if (auto *Q = E->getQualifier())
774 D |= toExprDependence(Q->getDependence() &
775 ~NestedNameSpecifierDependence::Dependent);
776 return D;
777}
778
781 bool KnownInstantiationDependent,
782 bool KnownContainsUnexpandedParameterPack) {
783 auto Deps = ExprDependence::None;
784 if (KnownDependent)
785 Deps |= ExprDependence::TypeValue;
786 if (KnownInstantiationDependent)
787 Deps |= ExprDependence::Instantiation;
788 if (KnownContainsUnexpandedParameterPack)
789 Deps |= ExprDependence::UnexpandedPack;
790 Deps |= getDependenceInExpr(E->getNameInfo());
791 if (auto *Q = E->getQualifier())
792 Deps |= toExprDependence(Q->getDependence() &
793 ~NestedNameSpecifierDependence::Dependent);
794 for (auto *D : E->decls()) {
795 if (D->getDeclContext()->isDependentContext() ||
796 isa<UnresolvedUsingValueDecl>(D))
797 Deps |= ExprDependence::TypeValueInstantiation;
798 }
799 // If we have explicit template arguments, check for dependent
800 // template arguments and whether they contain any unexpanded pack
801 // expansions.
802 for (const auto &A : E->template_arguments())
803 Deps |= toExprDependence(A.getArgument().getDependence());
804 return Deps;
805}
806
808 auto D = ExprDependence::TypeValue;
810 if (auto *Q = E->getQualifier())
811 D |= toExprDependence(Q->getDependence());
812 for (const auto &A : E->template_arguments())
813 D |= toExprDependence(A.getArgument().getDependence());
814 return D;
815}
816
820 for (auto *A : E->arguments())
821 D |= A->getDependence() & ~ExprDependence::Type;
822 return D;
823}
824
826 CXXConstructExpr *BaseE = E;
829 computeDependence(BaseE);
830}
831
833 return E->getExpr()->getDependence();
834}
835
837 return E->getExpr()->getDependence();
838}
839
841 bool ContainsUnexpandedParameterPack) {
843 if (ContainsUnexpandedParameterPack)
844 D |= ExprDependence::UnexpandedPack;
845 return D;
846}
847
849 auto D = ExprDependence::ValueInstantiation;
852 for (auto *A : E->arguments())
853 D |= A->getDependence() &
854 (ExprDependence::UnexpandedPack | ExprDependence::Error);
855 return D;
856}
857
859 auto D = ExprDependence::TypeValueInstantiation;
860 if (!E->isImplicitAccess())
861 D |= E->getBase()->getDependence();
862 if (auto *Q = E->getQualifier())
863 D |= toExprDependence(Q->getDependence());
865 for (const auto &A : E->template_arguments())
866 D |= toExprDependence(A.getArgument().getDependence());
867 return D;
868}
869
871 return E->getSubExpr()->getDependence();
872}
873
875 auto D = ExprDependence::TypeValueInstantiation;
876 for (const auto *C : {E->getLHS(), E->getRHS()}) {
877 if (C)
878 D |= C->getDependence() & ~ExprDependence::UnexpandedPack;
879 }
880 return D;
881}
882
884 auto D = ExprDependence::None;
885 for (const auto *A : E->getInitExprs())
886 D |= A->getDependence();
887 return D;
888}
889
891 auto D = ExprDependence::None;
892 for (const auto *A : E->getArgs())
893 D |= toExprDependenceAsWritten(A->getType()->getDependence()) &
895 return D;
896}
897
899 bool ValueDependent) {
900 auto TA = TemplateArgumentDependence::None;
901 const auto InterestingDeps = TemplateArgumentDependence::Instantiation |
902 TemplateArgumentDependence::UnexpandedPack;
903 for (const TemplateArgumentLoc &ArgLoc :
905 TA |= ArgLoc.getArgument().getDependence() & InterestingDeps;
906 if (TA == InterestingDeps)
907 break;
908 }
909
911 ValueDependent ? ExprDependence::Value : ExprDependence::None;
912 auto Res = D | toExprDependence(TA);
913 if(!ValueDependent && E->getSatisfaction().ContainsErrors)
914 Res |= ExprDependence::Error;
915 return Res;
916}
917
919 auto D = ExprDependence::None;
920 Expr **Elements = E->getElements();
921 for (unsigned I = 0, N = E->getNumElements(); I != N; ++I)
922 D |= turnTypeToValueDependence(Elements[I]->getDependence());
923 return D;
924}
925
927 auto Deps = ExprDependence::None;
928 for (unsigned I = 0, N = E->getNumElements(); I < N; ++I) {
929 auto KV = E->getKeyValueElement(I);
930 auto KVDeps = turnTypeToValueDependence(KV.Key->getDependence() |
931 KV.Value->getDependence());
932 if (KV.EllipsisLoc.isValid())
933 KVDeps &= ~ExprDependence::UnexpandedPack;
934 Deps |= KVDeps;
935 }
936 return Deps;
937}
938
940 auto D = ExprDependence::None;
941 if (auto *R = E->getInstanceReceiver())
942 D |= R->getDependence();
943 else
945 for (auto *A : E->arguments())
946 D |= A->getDependence();
947 return D;
948}
StringRef P
static ExprDependence getDependenceInExpr(DeclarationNameInfo Name)
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
Defines the ExceptionSpecificationType enumeration and various utility functions.
Defines the clang::Expr interface and subclasses for C++ expressions.
Defines Expressions and AST nodes for C++2a concepts.
static DiagnosticBuilder Diag(DiagnosticsEngine *Diags, const LangOptions &Features, FullSourceLoc TokLoc, const char *TokBegin, const char *TokRangeBegin, const char *TokRangeEnd, unsigned DiagID)
Produce a diagnostic highlighting some portion of a literal.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:182
const LangOptions & getLangOpts() const
Definition: ASTContext.h:775
Represents a loop initializing the elements of an array.
Definition: Expr.h:5511
OpaqueValueExpr * getCommonExpr() const
Get the common subexpression shared by all initializations (the source array).
Definition: Expr.h:5526
Expr * getSubExpr() const
Get the initializer to use for each array element.
Definition: Expr.h:5531
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
Definition: Expr.h:2664
Expr * getLHS()
An array access can be written A[4] or 4[A] (both are equivalent).
Definition: Expr.h:2693
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent.
Definition: ExprCXX.h:2846
QualType getQueriedType() const
Definition: ExprCXX.h:2888
Expr * getDimensionExpression() const
Definition: ExprCXX.h:2894
AsTypeExpr - Clang builtin function __builtin_astype [OpenCL 6.2.4.2] This AST node provides support ...
Definition: Expr.h:6234
Expr * getSrcExpr() const
getSrcExpr - Return the Expr to be converted.
Definition: Expr.h:6253
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load,...
Definition: Expr.h:6437
Expr ** getSubExprs()
Definition: Expr.h:6514
static unsigned getNumSubExprs(AtomicOp Op)
Determine the number of arguments the specified atomic builtin should have.
Definition: Expr.cpp:4953
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
Definition: Expr.h:4241
Expr * getFalseExpr() const
getFalseExpr - Return the subexpression which will be evaluated if the condnition evaluates to false;...
Definition: Expr.h:4295
Expr * getCommon() const
getCommon - Return the common expression, written to the left of the condition.
Definition: Expr.h:4276
A builtin binary operation expression such as "x + y" or "x <= y".
Definition: Expr.h:3840
Expr * getLHS() const
Definition: Expr.h:3889
Expr * getRHS() const
Definition: Expr.h:3891
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Definition: Expr.h:6173
const BlockDecl * getBlockDecl() const
Definition: Expr.h:6185
Represents binding an expression to a temporary.
Definition: ExprCXX.h:1485
const Expr * getSubExpr() const
Definition: ExprCXX.h:1507
Represents a call to a C++ constructor.
Definition: ExprCXX.h:1540
arg_range arguments()
Definition: ExprCXX.h:1664
A default argument (C++ [dcl.fct.default]).
Definition: ExprCXX.h:1264
A use of a default initializer in a constructor or in aggregate initialization.
Definition: ExprCXX.h:1371
Expr * getExpr()
Get the initialization expression that will be used.
Definition: ExprCXX.cpp:1035
Represents a delete expression for memory deallocation and destructor calls, e.g.
Definition: ExprCXX.h:2491
Expr * getArgument()
Definition: ExprCXX.h:2532
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition: ExprCXX.h:3652
const DeclarationNameInfo & getMemberNameInfo() const
Retrieve the name of the member that this expression refers to.
Definition: ExprCXX.h:3789
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the member name.
Definition: ExprCXX.h:3763
Expr * getBase() const
Retrieve the base object of this member expressions, e.g., the x in x.m.
Definition: ExprCXX.h:3746
bool isImplicitAccess() const
True if this is an implicit access, i.e.
Definition: ExprCXX.h:3738
ArrayRef< TemplateArgumentLoc > template_arguments() const
Definition: ExprCXX.h:3857
Represents a folding of a pack over an operator.
Definition: ExprCXX.h:4798
Expr * getRHS() const
Definition: ExprCXX.h:4833
Expr * getLHS() const
Definition: ExprCXX.h:4832
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)".
Definition: ExprCXX.h:2234
llvm::iterator_range< arg_iterator > placement_arguments()
Definition: ExprCXX.h:2437
QualType getAllocatedType() const
Definition: ExprCXX.h:2312
std::optional< Expr * > getArraySize()
This might return std::nullopt even if isArray() returns true, since there might not be an array size...
Definition: ExprCXX.h:2347
TypeSourceInfo * getAllocatedTypeSourceInfo() const
Definition: ExprCXX.h:2316
Expr * getInitializer()
The initializer of this new-expression.
Definition: ExprCXX.h:2407
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
Definition: ExprCXX.h:4095
Expr * getOperand() const
Definition: ExprCXX.h:4112
Represents a list-initialization with parenthesis.
Definition: ExprCXX.h:4920
ArrayRef< Expr * > getInitExprs()
Definition: ExprCXX.h:4960
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
Definition: ExprCXX.h:2610
TypeSourceInfo * getDestroyedTypeInfo() const
Retrieve the source location information for the type being destroyed.
Definition: ExprCXX.h:2704
TypeSourceInfo * getScopeTypeInfo() const
Retrieve the scope type in a qualified pseudo-destructor expression.
Definition: ExprCXX.h:2688
NestedNameSpecifier * getQualifier() const
If the member name was qualified, retrieves the nested-name-specifier that precedes the member name.
Definition: ExprCXX.h:2668
Represents a C++ struct/union/class.
Definition: DeclCXX.h:258
bool isCurrentInstantiation(const DeclContext *CurContext) const
Determine whether this dependent class is a current instantiation, when viewed from within the given ...
A rewritten comparison expression that was originally written using operator syntax.
Definition: ExprCXX.h:283
Expr * getSemanticForm()
Get an equivalent semantic form for this expression.
Definition: ExprCXX.h:301
An expression "T()" which creates a value-initialized rvalue of type T, which is a non-class type.
Definition: ExprCXX.h:2175
TypeSourceInfo * getTypeSourceInfo() const
Definition: ExprCXX.h:2194
Implicit construction of a std::initializer_list<T> object from an array temporary within list-initia...
Definition: ExprCXX.h:797
Represents a C++ functional cast expression that builds a temporary object.
Definition: ExprCXX.h:1879
TypeSourceInfo * getTypeSourceInfo() const
Definition: ExprCXX.h:1908
Represents the this expression in C++.
Definition: ExprCXX.h:1148
bool isCapturedByCopyInLambdaWithExplicitObjectParameter() const
Definition: ExprCXX.h:1174
A C++ throw-expression (C++ [except.throw]).
Definition: ExprCXX.h:1202
const Expr * getSubExpr() const
Definition: ExprCXX.h:1222
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
Definition: ExprCXX.h:845
bool isTypeOperand() const
Definition: ExprCXX.h:881
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
Definition: ExprCXX.h:888
Expr * getExprOperand() const
Definition: ExprCXX.h:892
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
Definition: ExprCXX.h:3526
QualType getTypeAsWritten() const
Retrieve the type that is being constructed, as specified in the source code.
Definition: ExprCXX.h:3560
A Microsoft C++ __uuidof expression, which gets the _GUID that corresponds to the supplied type or ex...
Definition: ExprCXX.h:1062
Expr * getExprOperand() const
Definition: ExprCXX.h:1103
bool isTypeOperand() const
Definition: ExprCXX.h:1092
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
Definition: ExprCXX.h:1099
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition: Expr.h:2820
Expr * getCallee()
Definition: Expr.h:2970
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
Definition: Expr.h:2998
Expr ** getArgs()
Retrieve the call arguments.
Definition: Expr.h:3001
Expr * getSubExpr()
Definition: Expr.h:3533
ChooseExpr - GNU builtin-in function __builtin_choose_expr.
Definition: Expr.h:4558
Expr * getLHS() const
Definition: Expr.h:4600
bool isConditionDependent() const
Definition: Expr.h:4588
bool isConditionTrue() const
isConditionTrue - Return whether the condition is true (i.e.
Definition: Expr.h:4581
Expr * getRHS() const
Definition: Expr.h:4602
Expr * getCond() const
Definition: Expr.h:4598
CompoundLiteralExpr - [C99 6.5.2.5].
Definition: Expr.h:3413
const Expr * getInitializer() const
Definition: Expr.h:3436
TypeSourceInfo * getTypeSourceInfo() const
Definition: Expr.h:3446
Stmt * getStmtExprResult()
Definition: Stmt.h:1723
Represents the specialization of a concept - evaluates to a prvalue of type bool.
Definition: ExprConcepts.h:42
const ASTTemplateArgumentListInfo * getTemplateArgsAsWritten() const
Definition: ExprConcepts.h:98
const ASTConstraintSatisfaction & getSatisfaction() const
Get elaborated satisfaction info about the template arguments' satisfaction of the named concept.
Definition: ExprConcepts.h:133
ConditionalOperator - The ?: ternary operator.
Definition: Expr.h:4179
Expr * getLHS() const
Definition: Expr.h:4213
Expr * getCond() const
getCond - Return the expression representing the condition for the ?: operator.
Definition: Expr.h:4202
Expr * getRHS() const
Definition: Expr.h:4214
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
Definition: Expr.h:4499
TypeSourceInfo * getTypeSourceInfo() const
getTypeSourceInfo - Return the destination type.
Definition: Expr.h:4522
Expr * getSrcExpr() const
getSrcExpr - Return the Expr to be converted.
Definition: Expr.h:4519
Represents an expression that might suspend coroutine execution; either a co_await or co_yield expres...
Definition: ExprCXX.h:5037
Expr * getResumeExpr() const
Definition: ExprCXX.h:5101
Expr * getCommonExpr() const
Definition: ExprCXX.h:5086
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Definition: DeclBase.h:1438
bool isDependentContext() const
Determines whether this context is dependent on a template parameter.
Definition: DeclBase.cpp:1264
A reference to a declared variable, function, enum, etc.
Definition: Expr.h:1260
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition: Expr.h:1429
bool isCapturedByCopyInLambdaWithExplicitObjectParameter() const
Definition: Expr.h:1470
ValueDecl * getDecl()
Definition: Expr.h:1328
const TemplateArgumentLoc * getTemplateArgs() const
Retrieve the template arguments provided as part of this template-id.
Definition: Expr.h:1421
NestedNameSpecifier * getQualifier() const
If the name was qualified, retrieves the nested-name-specifier that precedes the name.
Definition: Expr.h:1355
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:85
bool isParameterPack() const
Whether this declaration is a parameter pack.
Definition: DeclBase.cpp:220
llvm::iterator_range< specific_attr_iterator< T > > specific_attrs() const
Definition: DeclBase.h:567
DeclContext * getDeclContext()
Definition: DeclBase.h:456
Represents a 'co_await' expression while the type of the promise is dependent.
Definition: ExprCXX.h:5183
Expr * getOperand() const
Definition: ExprCXX.h:5206
A qualified reference to a name whose declaration cannot yet be resolved.
Definition: ExprCXX.h:3292
ArrayRef< TemplateArgumentLoc > template_arguments() const
Definition: ExprCXX.h:3400
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies this declaration.
Definition: ExprCXX.h:3344
const DeclarationNameInfo & getNameInfo() const
Retrieve the name that this expression refers to.
Definition: ExprCXX.h:3328
Represents a C99 designated initializer expression.
Definition: Expr.h:5092
Expr * getArrayRangeEnd(const Designator &D) const
Definition: Expr.cpp:4649
llvm::MutableArrayRef< Designator > designators()
Definition: Expr.h:5325
Expr * getArrayRangeStart(const Designator &D) const
Definition: Expr.cpp:4644
Expr * getArrayIndex(const Designator &D) const
Definition: Expr.cpp:4639
Expr * getInit() const
Retrieve the initializer value.
Definition: Expr.h:5360
ExplicitCastExpr - An explicit cast written in the source code.
Definition: Expr.h:3730
This represents one expression.
Definition: Expr.h:110
bool isTypeDependent() const
Determines whether the type of this expression depends on.
Definition: Expr.h:192
Expr * IgnoreParens() LLVM_READONLY
Skip past any parentheses which might surround this expression until reaching a fixed point.
Definition: Expr.cpp:3055
bool EvaluateAsConstantExpr(EvalResult &Result, const ASTContext &Ctx, ConstantExprKind Kind=ConstantExprKind::Normal) const
Evaluate an expression that is required to be a constant expression.
bool isInstantiationDependent() const
Whether this expression is instantiation-dependent, meaning that it depends in some way on.
Definition: Expr.h:221
QualType getType() const
Definition: Expr.h:142
ExprDependence getDependence() const
Definition: Expr.h:162
An expression trait intrinsic.
Definition: ExprCXX.h:2917
Expr * getQueriedExpression() const
Definition: ExprCXX.h:2956
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
Definition: Expr.h:6113
const Expr * getBase() const
Definition: Expr.h:6130
Represents a member of a struct/union/class.
Definition: Decl.h:3058
FullExpr - Represents a "full-expression" node.
Definition: Expr.h:1039
const Expr * getSubExpr() const
Definition: Expr.h:1052
Represents a C11 generic selection.
Definition: Expr.h:5725
TypeSourceInfo * getControllingType()
Return the controlling type of this generic selection expression.
Definition: Expr.h:6000
ArrayRef< Expr * > getAssocExprs() const
Definition: Expr.h:6020
bool isExprPredicate() const
Whether this generic selection uses an expression as its controlling argument.
Definition: Expr.h:5981
Expr * getResultExpr()
Return the result expression of this controlling expression.
Definition: Expr.h:6009
bool isResultDependent() const
Whether this generic selection is result-dependent.
Definition: Expr.h:5977
Expr * getControllingExpr()
Return the controlling expression of this generic selection expression.
Definition: Expr.h:5988
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition: Expr.h:3655
Represents an implicitly-generated value initialization of an object of a given type.
Definition: Expr.h:5600
Describes an C or C++ initializer list.
Definition: Expr.h:4847
ArrayRef< Expr * > inits()
Definition: Expr.h:4887
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
Definition: ExprCXX.h:1948
A member reference to an MSPropertyDecl.
Definition: ExprCXX.h:929
Expr * getBaseExpr() const
Definition: ExprCXX.h:982
MS property subscript expression.
Definition: ExprCXX.h:1000
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
Definition: ExprCXX.h:4686
Expr * getSubExpr() const
Retrieve the temporary-generating subexpression whose value will be materialized into a glvalue.
Definition: ExprCXX.h:4703
MatrixSubscriptExpr - Matrix subscript expression for the MatrixType extension.
Definition: Expr.h:2742
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Definition: Expr.h:3172
ArrayRef< TemplateArgumentLoc > template_arguments() const
Definition: Expr.h:3344
ValueDecl * getMemberDecl() const
Retrieve the member declaration to which this expression refers.
Definition: Expr.h:3255
Expr * getBase() const
Definition: Expr.h:3249
NestedNameSpecifier * getQualifier() const
If the member name was qualified, retrieves the nested-name-specifier that precedes the member name.
Definition: Expr.h:3283
DeclarationNameInfo getMemberNameInfo() const
Retrieve the member declaration name info.
Definition: Expr.h:3349
Represents a place-holder for an object not to be initialized by anything.
Definition: Expr.h:5420
OpenMP 5.0 [2.1.5, Array Sections].
Definition: ExprOpenMP.h:56
Expr * getLength()
Get length of array section.
Definition: ExprOpenMP.h:102
Expr * getBase()
An array section can be written only as Base[LowerBound:Length].
Definition: ExprOpenMP.h:85
Expr * getLowerBound()
Get lower bound of array section.
Definition: ExprOpenMP.h:94
An explicit cast in C or a C-style cast in C++, which uses the syntax ([s1][s2]......
Definition: ExprOpenMP.h:148
Expr * getBase()
Fetches base expression of array shaping expression.
Definition: ExprOpenMP.h:214
ArrayRef< Expr * > getDimensions() const
Fetches the dimensions for array shaping expression.
Definition: ExprOpenMP.h:204
OpenMP 5.0 [2.1.6 Iterators] Iterators are identifiers that expand to multiple values in the clause o...
Definition: ExprOpenMP.h:275
IteratorRange getIteratorRange(unsigned I)
Gets the iterator range for the given iterator.
Definition: Expr.cpp:5207
unsigned numOfIterators() const
Returns number of iterator definitions.
Definition: ExprOpenMP.h:399
Decl * getIteratorDecl(unsigned I)
Gets the iterator declaration for the given iterator.
Definition: Expr.cpp:5203
ObjCArrayLiteral - used for objective-c array containers; as in: @["Hello", NSApp,...
Definition: ExprObjC.h:191
Expr ** getElements()
Retrieve elements of array of literals.
Definition: ExprObjC.h:220
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c array literal.
Definition: ExprObjC.h:228
ObjCBoxedExpr - used for generalized expression boxing.
Definition: ExprObjC.h:127
Expr * getSubExpr()
Definition: ExprObjC.h:143
ObjCDictionaryLiteral - AST node to represent objective-c dictionary literals; as in:"name" : NSUserN...
Definition: ExprObjC.h:309
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c dictionary literal.
Definition: ExprObjC.h:360
ObjCDictionaryElement getKeyValueElement(unsigned Index) const
Definition: ExprObjC.h:362
ObjCEncodeExpr, used for @encode in Objective-C.
Definition: ExprObjC.h:410
QualType getEncodedType() const
Definition: ExprObjC.h:429
ObjCIndirectCopyRestoreExpr - Represents the passing of a function argument by indirect copy-restore ...
Definition: ExprObjC.h:1575
ObjCIsaExpr - Represent X->isa and X.isa when X is an ObjC 'id' type.
Definition: ExprObjC.h:1491
Expr * getBase() const
Definition: ExprObjC.h:1516
ObjCIvarRefExpr - A reference to an ObjC instance variable.
Definition: ExprObjC.h:549
const Expr * getBase() const
Definition: ExprObjC.h:583
An expression that sends a message to the given Objective-C object or class.
Definition: ExprObjC.h:945
Expr * getInstanceReceiver()
Returns the object expression (receiver) for an instance message, or null for a message that is not a...
Definition: ExprObjC.h:1260
llvm::iterator_range< arg_iterator > arguments()
Definition: ExprObjC.h:1462
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
Definition: ExprObjC.h:617
const Expr * getBase() const
Definition: ExprObjC.h:755
bool isObjectReceiver() const
Definition: ExprObjC.h:774
QualType getSuperReceiverType() const
Definition: ExprObjC.h:766
bool isClassReceiver() const
Definition: ExprObjC.h:776
bool isSuperReceiver() const
Definition: ExprObjC.h:775
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
Definition: ExprObjC.h:844
Expr * getKeyExpr() const
Definition: ExprObjC.h:886
Expr * getBaseExpr() const
Definition: ExprObjC.h:883
OffsetOfExpr - [C99 7.17] - This represents an expression of the form offsetof(record-type,...
Definition: Expr.h:2465
Expr * getIndexExpr(unsigned Idx)
Definition: Expr.h:2526
TypeSourceInfo * getTypeSourceInfo() const
Definition: Expr.h:2505
unsigned getNumExpressions() const
Definition: Expr.h:2541
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class.
Definition: Expr.h:1168
Expr * getSourceExpr() const
The source expression of an opaque value expression is the expression which originally generated the ...
Definition: Expr.h:1218
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr.
Definition: ExprCXX.h:2976
NestedNameSpecifier * getQualifier() const
Fetches the nested-name qualifier, if one was given.
Definition: ExprCXX.h:3091
const DeclarationNameInfo & getNameInfo() const
Gets the full name info.
Definition: ExprCXX.h:3082
llvm::iterator_range< decls_iterator > decls() const
Definition: ExprCXX.h:3074
ArrayRef< TemplateArgumentLoc > template_arguments() const
Definition: ExprCXX.h:3142
Represents a C++11 pack expansion that produces a sequence of expressions.
Definition: ExprCXX.h:4149
Expr * getPattern()
Retrieve the pattern of the pack expansion.
Definition: ExprCXX.h:4178
Expr * getIndexExpr() const
Definition: ExprCXX.h:4407
ArrayRef< Expr * > getExpressions() const
Definition: ExprCXX.h:4424
std::optional< unsigned > getSelectedIndex() const
Definition: ExprCXX.h:4409
Expr * getPackIdExpression() const
Definition: ExprCXX.h:4403
ParenExpr - This represents a parethesized expression, e.g.
Definition: Expr.h:2130
const Expr * getSubExpr() const
Definition: Expr.h:2145
[C99 6.4.2.2] - A predefined identifier such as func.
Definition: Expr.h:1986
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
Definition: Expr.h:6305
ArrayRef< Expr * > semantics()
Definition: Expr.h:6384
Expr * getSyntacticForm()
Return the syntactic form of this expression, i.e.
Definition: Expr.h:6347
A (possibly-)qualified type.
Definition: Type.h:738
Frontend produces RecoveryExprs on semantic errors that prevent creating other well-formed expression...
Definition: Expr.h:6640
ArrayRef< Expr * > subExpressions()
Definition: Expr.h:6647
TypeSourceInfo * getTypeSourceInfo()
Definition: Expr.h:2091
ShuffleVectorExpr - clang-specific builtin-in function __builtin_shufflevector.
Definition: Expr.h:4431
Expr ** getSubExprs()
Retrieve the array of expressions.
Definition: Expr.h:4468
unsigned getNumSubExprs() const
getNumSubExprs - Return the size of the SubExprs array.
Definition: Expr.h:4465
StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).
Definition: Expr.h:4383
CompoundStmt * getSubStmt()
Definition: Expr.h:4400
Represents a reference to a non-type template parameter that has been substituted with a template arg...
Definition: ExprCXX.h:4442
Location wrapper for a TemplateArgument.
Definition: TemplateBase.h:524
A container of type source information.
Definition: Type.h:7120
QualType getType() const
Return the type wrapped by this type source info.
Definition: Type.h:7131
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
Definition: ExprCXX.h:2761
ArrayRef< TypeSourceInfo * > getArgs() const
Retrieve the argument types.
Definition: ExprCXX.h:2817
The base class of the type hierarchy.
Definition: Type.h:1607
bool isIncompleteArrayType() const
Definition: Type.h:7476
bool isInstantiationDependentType() const
Determine whether this type is an instantiation-dependent type, meaning that the type involves a temp...
Definition: Type.h:2451
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
Definition: Type.h:2443
TypeDependence getDependence() const
Definition: Type.h:2432
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand.
Definition: Expr.h:2568
QualType getArgumentType() const
Definition: Expr.h:2611
bool isArgumentType() const
Definition: Expr.h:2610
UnaryExprOrTypeTrait getKind() const
Definition: Expr.h:2600
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
Definition: Expr.h:2183
Expr * getSubExpr() const
Definition: Expr.h:2228
Opcode getOpcode() const
Definition: Expr.h:2223
Represents a call to the builtin function __builtin_va_arg.
Definition: Expr.h:4667
TypeSourceInfo * getWrittenTypeInfo() const
Definition: Expr.h:4691
const Expr * getSubExpr() const
Definition: Expr.h:4683
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Definition: Decl.h:706
const Expr * getExprStmt() const
Definition: Stmt.cpp:404
Represents a variable declaration or definition.
Definition: Decl.h:918
The JSON file list parser is used to communicate input to InstallAPI.
ExprDependence toExprDependence(TemplateArgumentDependence TA)
Computes dependencies of a reference with the name having template arguments with TA dependencies.
CanThrowResult
Possible results from evaluation of a noexcept expression.
ExprDependence turnTypeToValueDependence(ExprDependence D)
ExprDependence toExprDependenceAsWritten(TypeDependence D)
ExprDependence computeDependence(FullExpr *E)
ExprDependence turnValueToTypeDependence(ExprDependence D)
ExprDependence toExprDependenceForImpliedType(TypeDependence D)
const FunctionProtoType * T
llvm::ArrayRef< TemplateArgumentLoc > arguments() const
Definition: TemplateBase.h:705
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspon...
EvalResult is a struct with detailed info about an evaluated expression.
Definition: Expr.h:642
Iterator range representation begin:end[:step].
Definition: ExprOpenMP.h:278