clang 23.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
27
30 if (auto *S = E->getSourceExpr())
31 D |= S->getDependence();
32 assert(!(D & ExprDependence::UnexpandedPack));
33 return D;
34}
35
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)) {
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
117
121
123 return E->getBase()->getDependence() | E->getRowIdx()->getDependence() |
125 : ExprDependence::None);
126}
127
134
136 // We model implicit conversions as combining the dependence of their
137 // subexpression, apart from its type, with the semantic portion of the
138 // target type.
141 if (auto *S = E->getSubExpr())
142 D |= S->getDependence() & ~ExprDependence::Type;
143 return D;
144}
145
147 // Cast expressions are type-dependent if the type is
148 // dependent (C++ [temp.dep.expr]p3).
149 // Cast expressions are value-dependent if the type is
150 // dependent or if the subexpression is value-dependent.
151 //
152 // Note that we also need to consider the dependence of the actual type here,
153 // because when the type as written is a deduced type, that type is not
154 // dependent, but it may be deduced as a dependent type.
157 cast<ExplicitCastExpr>(E)->getTypeAsWritten()->getDependence()) |
159 if (auto *S = E->getSubExpr())
160 D |= S->getDependence() & ~ExprDependence::Type;
161 return D;
162}
163
167
169 // The type of the conditional operator depends on the type of the conditional
170 // to support the GCC vector conditional extension. Additionally,
171 // [temp.dep.expr] does specify that this should be dependent on ALL sub
172 // expressions.
173 return E->getCond()->getDependence() | E->getLHS()->getDependence() |
174 E->getRHS()->getDependence();
175}
176
180
183 // Propagate dependence of the result.
184 if (const auto *CompoundExprResult =
185 dyn_cast_or_null<ValueStmt>(E->getSubStmt()->body_back()))
186 if (const Expr *ResultExpr = CompoundExprResult->getExprStmt())
187 D |= ResultExpr->getDependence();
188 // Note: we treat a statement-expression in a dependent context as always
189 // being value- and instantiation-dependent. This matches the behavior of
190 // lambda-expressions and GCC.
191 if (TemplateDepth)
192 D |= ExprDependence::ValueInstantiation;
193 // A param pack cannot be expanded over stmtexpr boundaries.
194 return D & ~ExprDependence::UnexpandedPack;
195}
196
205
207 if (E->isConditionDependent())
208 return ExprDependence::TypeValueInstantiation |
209 E->getCond()->getDependence() | E->getLHS()->getDependence() |
210 E->getRHS()->getDependence();
211
212 auto Cond = E->getCond()->getDependence();
213 auto Active = E->getLHS()->getDependence();
214 auto Inactive = E->getRHS()->getDependence();
215 if (!E->isConditionTrue())
216 std::swap(Active, Inactive);
217 // Take type- and value- dependency from the active branch. Propagate all
218 // other flags from all branches.
219 return (Active & ExprDependence::TypeValue) |
220 ((Cond | Active | Inactive) & ~ExprDependence::TypeValue);
221}
222
224 auto D = ExprDependence::None;
225 for (auto *E : P->exprs())
226 D |= E->getDependence();
227 return D;
228}
229
233 (E->getSubExpr()->getDependence() & ~ExprDependence::Type);
234 return D;
235}
236
239 (ExprDependence::Instantiation | ExprDependence::Error);
240}
241
243 auto D = E->getCommonExpr()->getDependence() |
244 E->getSubExpr()->getDependence() | ExprDependence::Instantiation;
246 D &= ~ExprDependence::Instantiation;
248}
249
254
258
262
264 bool ContainsUnexpandedParameterPack) {
267 D |= ExprDependence::Instantiation;
268 if (ContainsUnexpandedParameterPack)
269 D |= ExprDependence::UnexpandedPack;
270 return D;
271}
272
274 // FIXME: AsTypeExpr doesn't store the type as written. Assume the expression
275 // type has identical sugar for now, so is a type-as-written.
278 if (!E->getType()->isDependentType())
280 return D;
281}
282
286
292
294 auto D = ExprDependence::None;
295 if (E->isTypeOperand())
298 else
300 // typeid is never type-dependent (C++ [temp.dep.expr]p4)
301 return D & ~ExprDependence::Type;
302}
303
307
311
319
321 // 'this' is type-dependent if the class type of the enclosing
322 // member function is dependent (C++ [temp.dep.expr]p2)
324
325 // If a lambda with an explicit object parameter captures '*this', then
326 // 'this' now refers to the captured copy of lambda, and if the lambda
327 // is type-dependent, so is the object and thus 'this'.
328 //
329 // Note: The standard does not mention this case explicitly, but we need
330 // to do this so we can mark NSDM accesses as dependent.
332 D |= ExprDependence::Type;
333
334 assert(!(D & ExprDependence::UnexpandedPack));
335 return D;
336}
337
339 auto *Op = E->getSubExpr();
340 if (!Op)
341 return ExprDependence::None;
342 return Op->getDependence() & ~ExprDependence::TypeValue;
343}
344
348
351 if (auto *TSI = E->getTypeSourceInfo())
352 D |= toExprDependenceAsWritten(TSI->getType()->getDependence());
353 return D;
354}
355
359
366
368 // Never type-dependent.
370 // Value-dependent if the argument is type-dependent.
372 D |= ExprDependence::Value;
373 return D;
374}
375
377 auto D = E->getOperand()->getDependence() & ~ExprDependence::TypeValue;
378 if (CT == CT_Dependent)
379 D |= ExprDependence::ValueInstantiation;
380 return D;
381}
382
384 return (E->getPattern()->getDependence() & ~ExprDependence::UnexpandedPack) |
385 ExprDependence::TypeValueInstantiation;
386}
387
389
391 ~ExprDependence::UnexpandedPack;
392
394 if (D & ExprDependence::TypeValueInstantiation)
395 D |= E->getIndexExpr()->getDependence() | PatternDep |
396 ExprDependence::Instantiation;
397
398 ArrayRef<Expr *> Exprs = E->getExpressions();
399 if (Exprs.empty() || !E->isFullySubstituted())
400 D |= PatternDep | ExprDependence::Instantiation;
401 else if (!E->getIndexExpr()->isInstantiationDependent()) {
402 UnsignedOrNone Index = E->getSelectedIndex();
403 assert(Index && *Index < Exprs.size() && "pack index out of bound");
404 D |= Exprs[*Index]->getDependence();
405 }
406 return D;
407}
408
412
414 if (auto *Resume = E->getResumeExpr())
415 return (Resume->getDependence() &
416 (ExprDependence::TypeValue | ExprDependence::Error)) |
417 (E->getCommonExpr()->getDependence() & ~ExprDependence::TypeValue);
418 return E->getCommonExpr()->getDependence() |
419 ExprDependence::TypeValueInstantiation;
420}
421
423 return E->getOperand()->getDependence() |
424 ExprDependence::TypeValueInstantiation;
425}
426
430
434
438
440 if (E->isObjectReceiver())
442 if (E->isSuperReceiver())
445 ~ExprDependence::TypeValue;
446 assert(E->isClassReceiver());
447 return ExprDependence::None;
448}
449
453
458
462
464 auto D = E->getBase()->getDependence();
465 if (auto *LB = E->getLowerBound())
466 D |= LB->getDependence();
467 if (auto *Len = E->getLength())
468 D |= Len->getDependence();
469
470 if (E->isOMPArraySection()) {
471 if (auto *Stride = E->getStride())
472 D |= Stride->getDependence();
473 }
474 return D;
475}
476
478 auto D = E->getBase()->getDependence();
479 for (Expr *Dim: E->getDimensions())
480 if (Dim)
481 D |= turnValueToTypeDependence(Dim->getDependence());
482 return D;
483}
484
487 for (unsigned I = 0, End = E->numOfIterators(); I < End; ++I) {
488 if (auto *DD = cast_or_null<DeclaratorDecl>(E->getIteratorDecl(I))) {
489 // If the type is omitted, it's 'int', and is not dependent in any way.
490 if (auto *TSI = DD->getTypeSourceInfo()) {
491 D |= toExprDependenceAsWritten(TSI->getType()->getDependence());
492 }
493 }
495 if (Expr *BE = IR.Begin)
496 D |= BE->getDependence();
497 if (Expr *EE = IR.End)
498 D |= EE->getDependence();
499 if (Expr *SE = IR.Step)
500 D |= SE->getDependence();
501 }
502 return D;
503}
504
505/// Compute the type-, value-, and instantiation-dependence of a
506/// declaration reference
507/// based on the declaration being referenced.
509 auto Deps = ExprDependence::None;
510
512 ~NestedNameSpecifierDependence::Dependent);
513
514 if (auto *FirstArg = E->getTemplateArgs()) {
515 unsigned NumArgs = E->getNumTemplateArgs();
516 for (auto *Arg = FirstArg, *End = FirstArg + NumArgs; Arg < End; ++Arg)
517 Deps |= toExprDependence(Arg->getArgument().getDependence());
518 }
519
520 auto *Decl = E->getDecl();
521 auto Type = E->getType();
522
523 if (Decl->isParameterPack())
524 Deps |= ExprDependence::UnexpandedPack;
526 ExprDependence::Error;
527
528 // C++ [temp.dep.expr]p3:
529 // An id-expression is type-dependent if it contains:
530
531 // - an identifier associated by name lookup with one or more declarations
532 // declared with a dependent type
533 // - an identifier associated by name lookup with an entity captured by
534 // copy ([expr.prim.lambda.capture])
535 // in a lambda-expression that has an explicit object parameter whose
536 // type is dependent ([dcl.fct]),
537 //
538 // [The "or more" case is not modeled as a DeclRefExpr. There are a bunch
539 // more bullets here that we handle by treating the declaration as having a
540 // dependent type if they involve a placeholder type that can't be deduced.]
541 if (Type->isDependentType())
542 Deps |= ExprDependence::TypeValueInstantiation;
544 Deps |= ExprDependence::Instantiation;
545
546 // - an identifier associated by name lookup with an entity captured by
547 // copy ([expr.prim.lambda.capture])
549 Deps |= ExprDependence::Type;
550
551 // - a conversion-function-id that specifies a dependent type
552 if (Decl->getDeclName().getNameKind() ==
554 QualType T = Decl->getDeclName().getCXXNameType();
555 if (T->isDependentType())
556 return Deps | ExprDependence::TypeValueInstantiation;
557
558 if (T->isInstantiationDependentType())
559 Deps |= ExprDependence::Instantiation;
560 }
561
562 // - a template-id that is dependent,
563 // - a nested-name-specifier or a qualified-id that names a member of an
564 // unknown specialization
565 // [These are not modeled as DeclRefExprs.]
566
567 // or if it names a dependent member of the current instantiation that is a
568 // static data member of type "array of unknown bound of T" for some T
569 // [handled below].
570
571 // C++ [temp.dep.constexpr]p2:
572 // An id-expression is value-dependent if:
573
574 // - it is type-dependent [handled above]
575
576 // - it is the name of a non-type template parameter,
578 return Deps | ExprDependence::ValueInstantiation;
579
580 // - it names a potentially-constant variable that is initialized with an
581 // expression that is value-dependent
582 if (const auto *Var = dyn_cast<VarDecl>(Decl)) {
583 if (const Expr *Init = Var->getAnyInitializer()) {
584 if (Init->containsErrors())
585 Deps |= ExprDependence::Error;
586
587 if (Var->mightBeUsableInConstantExpressions(Ctx) &&
588 Init->isValueDependent())
589 Deps |= ExprDependence::ValueInstantiation;
590 }
591
592 // - it names a static data member that is a dependent member of the
593 // current instantiation and is not initialized in a member-declarator,
594 if (Var->isStaticDataMember() &&
595 Var->getDeclContext()->isDependentContext() &&
596 !Var->getFirstDecl()->hasInit()) {
597 const VarDecl *First = Var->getFirstDecl();
598 TypeSourceInfo *TInfo = First->getTypeSourceInfo();
599 if (TInfo->getType()->isIncompleteArrayType()) {
600 Deps |= ExprDependence::TypeValueInstantiation;
601 } else if (!First->hasInit()) {
602 Deps |= ExprDependence::ValueInstantiation;
603 }
604 }
605
606 return Deps;
607 }
608
609 // - it names a static member function that is a dependent member of the
610 // current instantiation
611 //
612 // FIXME: It's unclear that the restriction to static members here has any
613 // effect: any use of a non-static member function name requires either
614 // forming a pointer-to-member or providing an object parameter, either of
615 // which makes the overall expression value-dependent.
616 if (auto *MD = dyn_cast<CXXMethodDecl>(Decl)) {
617 if (MD->isStatic() && Decl->getDeclContext()->isDependentContext())
618 Deps |= ExprDependence::ValueInstantiation;
619 }
620
621 return Deps;
622}
623
625 // RecoveryExpr is
626 // - always value-dependent, and therefore instantiation dependent
627 // - contains errors (ExprDependence::Error), by definition
628 // - type-dependent if we don't know the type (fallback to an opaque
629 // dependent type), or the type is known and dependent, or it has
630 // type-dependent subexpressions.
632 ExprDependence::ErrorDependent;
633 // FIXME: remove the type-dependent bit from subexpressions, if the
634 // RecoveryExpr has a non-dependent type.
635 for (auto *S : E->subExpressions())
636 D |= S->getDependence();
637 return D;
638}
639
644
648
650 auto D = E->getCallee()->getDependence();
651 if (E->getType()->isDependentType())
652 D |= ExprDependence::Type;
653 for (auto *A : ArrayRef(E->getArgs(), E->getNumArgs())) {
654 if (A)
655 D |= A->getDependence();
656 }
657 for (auto *A : PreArgs)
658 D |= A->getDependence();
659 return D;
660}
661
669
671 auto D = ExprDependence::None;
672 if (Name.isInstantiationDependent())
673 D |= ExprDependence::Instantiation;
675 D |= ExprDependence::UnexpandedPack;
676 return D;
677}
678
680 auto D = E->getBase()->getDependence();
682
684 ~NestedNameSpecifierDependence::Dependent);
685
686 for (const auto &A : E->template_arguments())
687 D |= toExprDependence(A.getArgument().getDependence());
688
689 auto *MemberDecl = E->getMemberDecl();
690 if (FieldDecl *FD = dyn_cast<FieldDecl>(MemberDecl)) {
691 DeclContext *DC = MemberDecl->getDeclContext();
692 // dyn_cast_or_null is used to handle objC variables which do not
693 // have a declaration context.
694 CXXRecordDecl *RD = dyn_cast_or_null<CXXRecordDecl>(DC);
695 if (RD && RD->isDependentContext() && RD->isCurrentInstantiation(DC)) {
696 if (!E->getType()->isDependentType())
698 }
699
700 // Bitfield with value-dependent width is type-dependent.
701 if (FD && FD->isBitField() && FD->getBitWidth()->isValueDependent()) {
702 D |= ExprDependence::Type;
703 }
704 }
705 return D;
706}
707
709 auto D = ExprDependence::None;
710 for (auto *A : E->inits())
711 D |= A->getDependence();
712 return D;
713}
714
717 for (auto *C : ArrayRef(E->getSubExprs(), E->getNumSubExprs()))
718 D |= C->getDependence();
719 return D;
720}
721
723 bool ContainsUnexpandedPack) {
724 auto D = ContainsUnexpandedPack ? ExprDependence::UnexpandedPack
725 : ExprDependence::None;
726 for (auto *AE : E->getAssocExprs())
727 D |= AE->getDependence() & ExprDependence::Error;
728
729 if (E->isExprPredicate())
730 D |= E->getControllingExpr()->getDependence() & ExprDependence::Error;
731 else
734
735 if (E->isResultDependent())
736 return D | ExprDependence::TypeValueInstantiation;
737 return D | (E->getResultExpr()->getDependence() &
738 ~ExprDependence::UnexpandedPack);
739}
740
742 auto Deps = E->getInit()->getDependence();
743 for (const auto &D : E->designators()) {
744 auto DesignatorDeps = ExprDependence::None;
745 if (D.isArrayDesignator())
746 DesignatorDeps |= E->getArrayIndex(D)->getDependence();
747 else if (D.isArrayRangeDesignator())
748 DesignatorDeps |= E->getArrayRangeStart(D)->getDependence() |
750 Deps |= DesignatorDeps;
751 if (DesignatorDeps & ExprDependence::TypeValue)
752 Deps |= ExprDependence::TypeValueInstantiation;
753 }
754 return Deps;
755}
756
758 auto D = O->getSyntacticForm()->getDependence();
759 for (auto *E : O->semantics())
760 D |= E->getDependence();
761 return D;
762}
763
765 auto D = ExprDependence::None;
766 for (auto *E : ArrayRef(A->getSubExprs(), A->getNumSubExprs()))
767 D |= E->getDependence();
768 return D;
769}
770
775 auto Size = E->getArraySize();
776 if (Size && *Size)
777 D |= turnTypeToValueDependence((*Size)->getDependence());
778 if (auto *I = E->getInitializer())
779 D |= turnTypeToValueDependence(I->getDependence());
780 for (auto *A : E->placement_arguments())
781 D |= turnTypeToValueDependence(A->getDependence());
782 return D;
783}
784
786 auto D = E->getBase()->getDependence();
787 if (auto *TSI = E->getDestroyedTypeInfo())
788 D |= toExprDependenceAsWritten(TSI->getType()->getDependence());
789 if (auto *ST = E->getScopeTypeInfo())
791 toExprDependenceAsWritten(ST->getType()->getDependence()));
793 ~NestedNameSpecifierDependence::Dependent);
794 return D;
795}
796
799 bool KnownInstantiationDependent,
800 bool KnownContainsUnexpandedParameterPack) {
801 auto Deps = ExprDependence::None;
802 if (KnownDependent)
803 Deps |= ExprDependence::TypeValue;
804 if (KnownInstantiationDependent)
805 Deps |= ExprDependence::Instantiation;
806 if (KnownContainsUnexpandedParameterPack)
807 Deps |= ExprDependence::UnexpandedPack;
808 Deps |= getDependenceInExpr(E->getNameInfo());
810 ~NestedNameSpecifierDependence::Dependent);
811 for (auto *D : E->decls()) {
812 if (D->getDeclContext()->isDependentContext() ||
814 Deps |= ExprDependence::TypeValueInstantiation;
815 }
816 // If we have explicit template arguments, check for dependent
817 // template arguments and whether they contain any unexpanded pack
818 // expansions.
819 for (const auto &A : E->template_arguments())
820 Deps |= toExprDependence(A.getArgument().getDependence());
821 return Deps;
822}
823
825 auto D = ExprDependence::TypeValue;
828 for (const auto &A : E->template_arguments())
829 D |= toExprDependence(A.getArgument().getDependence());
830 return D;
831}
832
836 for (auto *A : E->arguments())
837 D |= A->getDependence() & ~ExprDependence::Type;
838 return D;
839}
840
847
851
855
857 bool ContainsUnexpandedParameterPack) {
859 if (ContainsUnexpandedParameterPack)
860 D |= ExprDependence::UnexpandedPack;
861 return D;
862}
863
865 auto D = ExprDependence::ValueInstantiation;
868 for (auto *A : E->arguments())
869 D |= A->getDependence() &
870 (ExprDependence::UnexpandedPack | ExprDependence::Error);
871 return D;
872}
873
875 auto D = ExprDependence::TypeValueInstantiation;
876 if (!E->isImplicitAccess())
877 D |= E->getBase()->getDependence();
880 for (const auto &A : E->template_arguments())
881 D |= toExprDependence(A.getArgument().getDependence());
882 return D;
883}
884
888
890 auto D = ExprDependence::TypeValueInstantiation;
891 for (const auto *C : {E->getLHS(), E->getRHS()}) {
892 if (C)
893 D |= C->getDependence() & ~ExprDependence::UnexpandedPack;
894 }
895 return D;
896}
897
899 auto D = ExprDependence::None;
900 for (const auto *A : E->getInitExprs())
901 D |= A->getDependence();
902 return D;
903}
904
906 auto D = ExprDependence::None;
907 for (const auto *A : E->getArgs())
908 D |= toExprDependenceAsWritten(A->getType()->getDependence()) &
910 return D;
911}
912
914 bool ValueDependent) {
915 auto TA = TemplateArgumentDependence::None;
916 const auto InterestingDeps = TemplateArgumentDependence::Instantiation |
917 TemplateArgumentDependence::UnexpandedPack;
918 for (const TemplateArgumentLoc &ArgLoc :
920 TA |= ArgLoc.getArgument().getDependence() & InterestingDeps;
921 if (TA == InterestingDeps)
922 break;
923 }
924
926 ValueDependent ? ExprDependence::Value : ExprDependence::None;
927 auto Res = D | toExprDependence(TA);
928 if(!ValueDependent && E->getSatisfaction().ContainsErrors)
929 Res |= ExprDependence::Error;
930 return Res;
931}
932
934 auto D = ExprDependence::None;
935 Expr **Elements = E->getElements();
936 for (unsigned I = 0, N = E->getNumElements(); I != N; ++I)
937 D |= turnTypeToValueDependence(Elements[I]->getDependence());
938 return D;
939}
940
942 auto Deps = ExprDependence::None;
943 for (unsigned I = 0, N = E->getNumElements(); I < N; ++I) {
944 auto KV = E->getKeyValueElement(I);
945 auto KVDeps = turnTypeToValueDependence(KV.Key->getDependence() |
946 KV.Value->getDependence());
947 if (KV.EllipsisLoc.isValid())
948 KVDeps &= ~ExprDependence::UnexpandedPack;
949 Deps |= KVDeps;
950 }
951 return Deps;
952}
953
955 auto D = ExprDependence::None;
956 if (auto *R = E->getInstanceReceiver())
957 D |= R->getDependence();
958 else
960 for (auto *A : E->arguments())
961 D |= A->getDependence();
962 return D;
963}
964
966 // This represents a simple asterisk as typed, so cannot be dependent in any
967 // way.
968 return ExprDependence::None;
969}
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:226
const LangOptions & getLangOpts() const
Definition ASTContext.h:951
Represents a loop initializing the elements of an array.
Definition Expr.h:5971
OpaqueValueExpr * getCommonExpr() const
Get the common subexpression shared by all initializations (the source array).
Definition Expr.h:5986
Expr * getSubExpr() const
Get the initializer to use for each array element.
Definition Expr.h:5991
This class represents BOTH the OpenMP Array Section and OpenACC 'subarray', with a boolean differenti...
Definition Expr.h:7218
Expr * getBase()
Get base of the array section.
Definition Expr.h:7296
Expr * getLength()
Get length of array section.
Definition Expr.h:7306
bool isOMPArraySection() const
Definition Expr.h:7292
Expr * getStride()
Get stride of array section.
Definition Expr.h:7310
Expr * getLowerBound()
Get lower bound of array section.
Definition Expr.h:7300
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
Definition Expr.h:2724
Expr * getLHS()
An array access can be written A[4] or 4[A] (both are equivalent).
Definition Expr.h:2753
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent.
Definition ExprCXX.h:2997
QualType getQueriedType() const
Definition ExprCXX.h:3041
Expr * getDimensionExpression() const
Definition ExprCXX.h:3047
AsTypeExpr - Clang builtin function __builtin_astype [OpenCL 6.2.4.2] This AST node provides support ...
Definition Expr.h:6732
Expr * getSrcExpr() const
getSrcExpr - Return the Expr to be converted.
Definition Expr.h:6751
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load,...
Definition Expr.h:6927
Expr ** getSubExprs()
Definition Expr.h:7002
static unsigned getNumSubExprs(AtomicOp Op)
Determine the number of arguments the specified atomic builtin should have.
Definition Expr.cpp:5250
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
Definition Expr.h:4456
Expr * getFalseExpr() const
getFalseExpr - Return the subexpression which will be evaluated if the condition evaluates to false; ...
Definition Expr.h:4510
Expr * getCommon() const
getCommon - Return the common expression, written to the left of the condition.
Definition Expr.h:4491
A builtin binary operation expression such as "x + y" or "x <= y".
Definition Expr.h:4041
Expr * getLHS() const
Definition Expr.h:4091
Expr * getRHS() const
Definition Expr.h:4093
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Definition Expr.h:6671
const BlockDecl * getBlockDecl() const
Definition Expr.h:6683
Represents binding an expression to a temporary.
Definition ExprCXX.h:1494
const Expr * getSubExpr() const
Definition ExprCXX.h:1516
Represents a call to a C++ constructor.
Definition ExprCXX.h:1549
arg_range arguments()
Definition ExprCXX.h:1673
A default argument (C++ [dcl.fct.default]).
Definition ExprCXX.h:1271
A use of a default initializer in a constructor or in aggregate initialization.
Definition ExprCXX.h:1378
Expr * getExpr()
Get the initialization expression that will be used.
Definition ExprCXX.cpp:1105
Represents a delete expression for memory deallocation and destructor calls, e.g.
Definition ExprCXX.h:2627
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition ExprCXX.h:3871
NestedNameSpecifier getQualifier() const
Retrieve the nested-name-specifier that qualifies the member name.
Definition ExprCXX.h:3978
const DeclarationNameInfo & getMemberNameInfo() const
Retrieve the name of the member that this expression refers to.
Definition ExprCXX.h:4004
Expr * getBase() const
Retrieve the base object of this member expressions, e.g., the x in x.m.
Definition ExprCXX.h:3961
bool isImplicitAccess() const
True if this is an implicit access, i.e.
Definition ExprCXX.h:3953
ArrayRef< TemplateArgumentLoc > template_arguments() const
Definition ExprCXX.h:4072
Represents a folding of a pack over an operator.
Definition ExprCXX.h:5033
Expr * getRHS() const
Definition ExprCXX.h:5059
Expr * getLHS() const
Definition ExprCXX.h:5058
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)".
Definition ExprCXX.h:2356
llvm::iterator_range< arg_iterator > placement_arguments()
Definition ExprCXX.h:2573
QualType getAllocatedType() const
Definition ExprCXX.h:2435
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:2470
TypeSourceInfo * getAllocatedTypeSourceInfo() const
Definition ExprCXX.h:2439
Expr * getInitializer()
The initializer of this new-expression.
Definition ExprCXX.h:2534
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
Definition ExprCXX.h:4310
Expr * getOperand() const
Definition ExprCXX.h:4327
Represents a list-initialization with parenthesis.
Definition ExprCXX.h:5142
MutableArrayRef< Expr * > getInitExprs()
Definition ExprCXX.h:5182
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
Definition ExprCXX.h:2746
TypeSourceInfo * getDestroyedTypeInfo() const
Retrieve the source location information for the type being destroyed.
Definition ExprCXX.h:2840
TypeSourceInfo * getScopeTypeInfo() const
Retrieve the scope type in a qualified pseudo-destructor expression.
Definition ExprCXX.h:2824
NestedNameSpecifier getQualifier() const
If the member name was qualified, retrieves the nested-name-specifier that precedes the member name.
Definition ExprCXX.h:2804
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:287
Expr * getSemanticForm()
Get an equivalent semantic form for this expression.
Definition ExprCXX.h:305
An expression "T()" which creates an rvalue of a non-class type T.
Definition ExprCXX.h:2197
TypeSourceInfo * getTypeSourceInfo() const
Definition ExprCXX.h:2216
Implicit construction of a std::initializer_list<T> object from an array temporary within list-initia...
Definition ExprCXX.h:801
Represents a C++ functional cast expression that builds a temporary object.
Definition ExprCXX.h:1900
TypeSourceInfo * getTypeSourceInfo() const
Definition ExprCXX.h:1929
Represents the this expression in C++.
Definition ExprCXX.h:1155
bool isCapturedByCopyInLambdaWithExplicitObjectParameter() const
Definition ExprCXX.h:1181
A C++ throw-expression (C++ [except.throw]).
Definition ExprCXX.h:1209
const Expr * getSubExpr() const
Definition ExprCXX.h:1229
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
Definition ExprCXX.h:849
bool isTypeOperand() const
Definition ExprCXX.h:885
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
Definition ExprCXX.h:892
Expr * getExprOperand() const
Definition ExprCXX.h:896
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
Definition ExprCXX.h:3745
QualType getTypeAsWritten() const
Retrieve the type that is being constructed, as specified in the source code.
Definition ExprCXX.h:3779
A Microsoft C++ __uuidof expression, which gets the _GUID that corresponds to the supplied type or ex...
Definition ExprCXX.h:1069
Expr * getExprOperand() const
Definition ExprCXX.h:1110
bool isTypeOperand() const
Definition ExprCXX.h:1099
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
Definition ExprCXX.h:1106
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition Expr.h:2946
Expr * getCallee()
Definition Expr.h:3093
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
Definition Expr.h:3137
Expr ** getArgs()
Retrieve the call arguments.
Definition Expr.h:3140
Expr * getSubExpr()
Definition Expr.h:3729
ChooseExpr - GNU builtin-in function __builtin_choose_expr.
Definition Expr.h:4851
Expr * getLHS() const
Definition Expr.h:4893
bool isConditionDependent() const
Definition Expr.h:4881
bool isConditionTrue() const
isConditionTrue - Return whether the condition is true (i.e.
Definition Expr.h:4874
Expr * getRHS() const
Definition Expr.h:4895
Expr * getCond() const
Definition Expr.h:4891
CompoundLiteralExpr - [C99 6.5.2.5].
Definition Expr.h:3608
const Expr * getInitializer() const
Definition Expr.h:3636
TypeSourceInfo * getTypeSourceInfo() const
Definition Expr.h:3646
Stmt * body_back()
Definition Stmt.h:1800
Represents the specialization of a concept - evaluates to a prvalue of type bool.
const ASTTemplateArgumentListInfo * getTemplateArgsAsWritten() const
const ASTConstraintSatisfaction & getSatisfaction() const
Get elaborated satisfaction info about the template arguments' satisfaction of the named concept.
ConditionalOperator - The ?
Definition Expr.h:4394
Expr * getLHS() const
Definition Expr.h:4428
Expr * getCond() const
getCond - Return the expression representing the condition for the ?
Definition Expr.h:4417
Expr * getRHS() const
Definition Expr.h:4429
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
Definition Expr.h:4722
TypeSourceInfo * getTypeSourceInfo() const
getTypeSourceInfo - Return the destination type.
Definition Expr.h:4815
Expr * getSrcExpr() const
getSrcExpr - Return the Expr to be converted.
Definition Expr.h:4812
Represents an expression that might suspend coroutine execution; either a co_await or co_yield expres...
Definition ExprCXX.h:5256
Expr * getResumeExpr() const
Definition ExprCXX.h:5320
Expr * getCommonExpr() const
Definition ExprCXX.h:5305
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Definition DeclBase.h:1449
bool isDependentContext() const
Determines whether this context is dependent on a template parameter.
A reference to a declared variable, function, enum, etc.
Definition Expr.h:1273
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition Expr.h:1448
NestedNameSpecifier getQualifier() const
If the name was qualified, retrieves the nested-name-specifier that precedes the name.
Definition Expr.h:1374
bool isCapturedByCopyInLambdaWithExplicitObjectParameter() const
Definition Expr.h:1489
ValueDecl * getDecl()
Definition Expr.h:1341
const TemplateArgumentLoc * getTemplateArgs() const
Retrieve the template arguments provided as part of this template-id.
Definition Expr.h:1440
Decl - This represents one declaration (or definition), e.g.
Definition DeclBase.h:86
bool isParameterPack() const
Whether this declaration is a parameter pack.
Definition DeclBase.cpp:266
llvm::iterator_range< specific_attr_iterator< T > > specific_attrs() const
Definition DeclBase.h:559
DeclContext * getDeclContext()
Definition DeclBase.h:448
Represents a 'co_await' expression while the type of the promise is dependent.
Definition ExprCXX.h:5402
Expr * getOperand() const
Definition ExprCXX.h:5425
A qualified reference to a name whose declaration cannot yet be resolved.
Definition ExprCXX.h:3511
ArrayRef< TemplateArgumentLoc > template_arguments() const
Definition ExprCXX.h:3619
NestedNameSpecifier getQualifier() const
Retrieve the nested-name-specifier that qualifies this declaration.
Definition ExprCXX.h:3563
const DeclarationNameInfo & getNameInfo() const
Retrieve the name that this expression refers to.
Definition ExprCXX.h:3547
Represents a C99 designated initializer expression.
Definition Expr.h:5554
Expr * getArrayRangeEnd(const Designator &D) const
Definition Expr.cpp:4877
Expr * getArrayRangeStart(const Designator &D) const
Definition Expr.cpp:4872
MutableArrayRef< Designator > designators()
Definition Expr.h:5787
Expr * getArrayIndex(const Designator &D) const
Definition Expr.cpp:4867
Expr * getInit() const
Retrieve the initializer value.
Definition Expr.h:5822
const Expr * getBase() const
Definition Expr.h:6580
ExplicitCastExpr - An explicit cast written in the source code.
Definition Expr.h:3931
This represents one expression.
Definition Expr.h:112
bool isTypeDependent() const
Determines whether the type of this expression depends on.
Definition Expr.h:194
Expr * IgnoreParens() LLVM_READONLY
Skip past any parentheses which might surround this expression until reaching a fixed point.
Definition Expr.cpp:3086
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:223
QualType getType() const
Definition Expr.h:144
ExprDependence getDependence() const
Definition Expr.h:164
An expression trait intrinsic.
Definition ExprCXX.h:3070
Expr * getQueriedExpression() const
Definition ExprCXX.h:3109
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
Definition Expr.h:6609
Represents a member of a struct/union/class.
Definition Decl.h:3160
FullExpr - Represents a "full-expression" node.
Definition Expr.h:1052
const Expr * getSubExpr() const
Definition Expr.h:1065
Represents a C11 generic selection.
Definition Expr.h:6181
TypeSourceInfo * getControllingType()
Return the controlling type of this generic selection expression.
Definition Expr.h:6458
ArrayRef< Expr * > getAssocExprs() const
Definition Expr.h:6478
bool isExprPredicate() const
Whether this generic selection uses an expression as its controlling argument.
Definition Expr.h:6439
Expr * getResultExpr()
Return the result expression of this controlling expression.
Definition Expr.h:6467
bool isResultDependent() const
Whether this generic selection is result-dependent.
Definition Expr.h:6435
Expr * getControllingExpr()
Return the controlling expression of this generic selection expression.
Definition Expr.h:6446
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition Expr.h:3856
Represents an implicitly-generated value initialization of an object of a given type.
Definition Expr.h:6060
Describes an C or C++ initializer list.
Definition Expr.h:5302
ArrayRef< Expr * > inits()
Definition Expr.h:5352
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
Definition ExprCXX.h:1969
A member reference to an MSPropertyDecl.
Definition ExprCXX.h:937
Expr * getBaseExpr() const
Definition ExprCXX.h:989
MS property subscript expression.
Definition ExprCXX.h:1007
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
Definition ExprCXX.h:4921
Expr * getSubExpr() const
Retrieve the temporary-generating subexpression whose value will be materialized into a glvalue.
Definition ExprCXX.h:4938
MatrixSingleSubscriptExpr - Matrix single subscript expression for the MatrixType extension when you ...
Definition Expr.h:2798
MatrixSubscriptExpr - Matrix subscript expression for the MatrixType extension.
Definition Expr.h:2868
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Definition Expr.h:3367
ArrayRef< TemplateArgumentLoc > template_arguments() const
Definition Expr.h:3539
NestedNameSpecifier getQualifier() const
If the member name was qualified, retrieves the nested-name-specifier that precedes the member name.
Definition Expr.h:3478
ValueDecl * getMemberDecl() const
Retrieve the member declaration to which this expression refers.
Definition Expr.h:3450
Expr * getBase() const
Definition Expr.h:3444
DeclarationNameInfo getMemberNameInfo() const
Retrieve the member declaration name info.
Definition Expr.h:3544
NestedNameSpecifierDependence getDependence() const
Represents a place-holder for an object not to be initialized by anything.
Definition Expr.h:5880
An explicit cast in C or a C-style cast in C++, which uses the syntax ([s1][s2]......
Definition ExprOpenMP.h:24
Expr * getBase()
Fetches base expression of array shaping expression.
Definition ExprOpenMP.h:90
ArrayRef< Expr * > getDimensions() const
Fetches the dimensions for array shaping expression.
Definition ExprOpenMP.h:80
OpenMP 5.0 [2.1.6 Iterators] Iterators are identifiers that expand to multiple values in the clause o...
Definition ExprOpenMP.h:151
IteratorRange getIteratorRange(unsigned I)
Gets the iterator range for the given iterator.
Definition Expr.cpp:5535
unsigned numOfIterators() const
Returns number of iterator definitions.
Definition ExprOpenMP.h:275
Decl * getIteratorDecl(unsigned I)
Gets the iterator declaration for the given iterator.
Definition Expr.cpp:5531
ObjCArrayLiteral - used for objective-c array containers; as in: @["Hello", NSApp,...
Definition ExprObjC.h:192
Expr ** getElements()
Retrieve elements of array of literals.
Definition ExprObjC.h:221
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c array literal.
Definition ExprObjC.h:227
ObjCBoxedExpr - used for generalized expression boxing.
Definition ExprObjC.h:128
ObjCDictionaryLiteral - AST node to represent objective-c dictionary literals; as in:"name" : NSUserN...
Definition ExprObjC.h:307
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c dictionary literal.
Definition ExprObjC.h:358
ObjCDictionaryElement getKeyValueElement(unsigned Index) const
Definition ExprObjC.h:360
ObjCEncodeExpr, used for @encode in Objective-C.
Definition ExprObjC.h:407
QualType getEncodedType() const
Definition ExprObjC.h:426
ObjCIndirectCopyRestoreExpr - Represents the passing of a function argument by indirect copy-restore ...
Definition ExprObjC.h:1579
ObjCIsaExpr - Represent X->isa and X.isa when X is an ObjC 'id' type.
Definition ExprObjC.h:1495
Expr * getBase() const
Definition ExprObjC.h:1520
ObjCIvarRefExpr - A reference to an ObjC instance variable.
Definition ExprObjC.h:546
const Expr * getBase() const
Definition ExprObjC.h:580
An expression that sends a message to the given Objective-C object or class.
Definition ExprObjC.h:937
Expr * getInstanceReceiver()
Returns the object expression (receiver) for an instance message, or null for a message that is not a...
Definition ExprObjC.h:1265
llvm::iterator_range< arg_iterator > arguments()
Definition ExprObjC.h:1466
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
Definition ExprObjC.h:614
const Expr * getBase() const
Definition ExprObjC.h:752
bool isObjectReceiver() const
Definition ExprObjC.h:767
QualType getSuperReceiverType() const
Definition ExprObjC.h:759
bool isClassReceiver() const
Definition ExprObjC.h:769
bool isSuperReceiver() const
Definition ExprObjC.h:768
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
Definition ExprObjC.h:836
Expr * getKeyExpr() const
Definition ExprObjC.h:878
Expr * getBaseExpr() const
Definition ExprObjC.h:875
OffsetOfExpr - [C99 7.17] - This represents an expression of the form offsetof(record-type,...
Definition Expr.h:2530
Expr * getIndexExpr(unsigned Idx)
Definition Expr.h:2589
TypeSourceInfo * getTypeSourceInfo() const
Definition Expr.h:2570
unsigned getNumExpressions() const
Definition Expr.h:2601
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class.
Definition Expr.h:1181
Expr * getSourceExpr() const
The source expression of an opaque value expression is the expression which originally generated the ...
Definition Expr.h:1231
This expression type represents an asterisk in an OpenACC Size-Expr, used in the 'tile' and 'gang' cl...
Definition Expr.h:2093
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr.
Definition ExprCXX.h:3129
NestedNameSpecifier getQualifier() const
Fetches the nested-name qualifier, if one was given.
Definition ExprCXX.h:3245
const DeclarationNameInfo & getNameInfo() const
Gets the full name info.
Definition ExprCXX.h:3236
llvm::iterator_range< decls_iterator > decls() const
Definition ExprCXX.h:3228
ArrayRef< TemplateArgumentLoc > template_arguments() const
Definition ExprCXX.h:3338
Represents a C++11 pack expansion that produces a sequence of expressions.
Definition ExprCXX.h:4364
Expr * getPattern()
Retrieve the pattern of the pack expansion.
Definition ExprCXX.h:4393
Expr * getIndexExpr() const
Definition ExprCXX.h:4629
ArrayRef< Expr * > getExpressions() const
Return the trailing expressions, regardless of the expansion.
Definition ExprCXX.h:4647
Expr * getPackIdExpression() const
Definition ExprCXX.h:4625
bool isFullySubstituted() const
Definition ExprCXX.h:4603
UnsignedOrNone getSelectedIndex() const
Definition ExprCXX.h:4631
ParenExpr - This represents a parenthesized expression, e.g.
Definition Expr.h:2185
const Expr * getSubExpr() const
Definition Expr.h:2202
ArrayRef< Expr * > exprs()
Definition Expr.h:6126
[C99 6.4.2.2] - A predefined identifier such as func.
Definition Expr.h:2008
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
Definition Expr.h:6803
ArrayRef< Expr * > semantics()
Definition Expr.h:6875
Expr * getSyntacticForm()
Return the syntactic form of this expression, i.e.
Definition Expr.h:6840
A (possibly-)qualified type.
Definition TypeBase.h:937
Frontend produces RecoveryExprs on semantic errors that prevent creating other well-formed expression...
Definition Expr.h:7502
ArrayRef< Expr * > subExpressions()
Definition Expr.h:7509
TypeSourceInfo * getTypeSourceInfo()
Definition Expr.h:2146
ShuffleVectorExpr - clang-specific builtin-in function __builtin_shufflevector.
Definition Expr.h:4646
Expr ** getSubExprs()
Retrieve the array of expressions.
Definition Expr.h:4682
unsigned getNumSubExprs() const
getNumSubExprs - Return the size of the SubExprs array.
Definition Expr.h:4679
StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).
Definition Expr.h:4598
CompoundStmt * getSubStmt()
Definition Expr.h:4615
Represents a reference to a non-type template parameter that has been substituted with a template arg...
Definition ExprCXX.h:4665
Location wrapper for a TemplateArgument.
A container of type source information.
Definition TypeBase.h:8359
QualType getType() const
Return the type wrapped by this type source info.
Definition TypeBase.h:8370
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
Definition ExprCXX.h:2897
ArrayRef< TypeSourceInfo * > getArgs() const
Retrieve the argument types.
Definition ExprCXX.h:2968
The base class of the type hierarchy.
Definition TypeBase.h:1839
bool isIncompleteArrayType() const
Definition TypeBase.h:8732
bool isInstantiationDependentType() const
Determine whether this type is an instantiation-dependent type, meaning that the type involves a temp...
Definition TypeBase.h:2798
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
Definition TypeBase.h:2790
TypeDependence getDependence() const
Definition TypeBase.h:2779
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand.
Definition Expr.h:2628
QualType getArgumentType() const
Definition Expr.h:2671
UnaryExprOrTypeTrait getKind() const
Definition Expr.h:2660
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
Definition Expr.h:2247
Expr * getSubExpr() const
Definition Expr.h:2288
Opcode getOpcode() const
Definition Expr.h:2283
Represents a call to the builtin function __builtin_va_arg.
Definition Expr.h:4960
TypeSourceInfo * getWrittenTypeInfo() const
Definition Expr.h:4984
const Expr * getSubExpr() const
Definition Expr.h:4976
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Definition Decl.h:712
const Expr * getExprStmt() const
Definition Stmt.cpp:420
Represents a variable declaration or definition.
Definition Decl.h:926
The JSON file list parser is used to communicate input to InstallAPI.
bool isa(CodeGen::Address addr)
Definition Address.h:330
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.
ExprDependenceScope::ExprDependence ExprDependence
ExprDependence turnTypeToValueDependence(ExprDependence D)
ExprDependence toExprDependenceAsWritten(TypeDependence D)
ExprDependence computeDependence(FullExpr *E)
Expr * Cond
};
ExprDependence turnValueToTypeDependence(ExprDependence D)
@ Result
The result type of a method or function.
Definition TypeBase.h:905
ExprDependence toExprDependenceForImpliedType(TypeDependence D)
U cast(CodeGen::Address addr)
Definition Address.h:327
ArrayRef< TemplateArgumentLoc > arguments() const
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspon...
bool isInstantiationDependent() const
Determine whether this name involves a template parameter.
bool containsUnexpandedParameterPack() const
Determine whether this name contains an unexpanded parameter pack.
EvalResult is a struct with detailed info about an evaluated expression.
Definition Expr.h:648
Iterator range representation begin:end[:step].
Definition ExprOpenMP.h:154