clang 22.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
260 bool ContainsUnexpandedParameterPack) {
263 D |= ExprDependence::Instantiation;
264 if (ContainsUnexpandedParameterPack)
265 D |= ExprDependence::UnexpandedPack;
266 return D;
267}
268
270 // FIXME: AsTypeExpr doesn't store the type as written. Assume the expression
271 // type has identical sugar for now, so is a type-as-written.
274 if (!E->getType()->isDependentType())
276 return D;
277}
278
282
288
290 auto D = ExprDependence::None;
291 if (E->isTypeOperand())
294 else
296 // typeid is never type-dependent (C++ [temp.dep.expr]p4)
297 return D & ~ExprDependence::Type;
298}
299
303
307
315
317 // 'this' is type-dependent if the class type of the enclosing
318 // member function is dependent (C++ [temp.dep.expr]p2)
320
321 // If a lambda with an explicit object parameter captures '*this', then
322 // 'this' now refers to the captured copy of lambda, and if the lambda
323 // is type-dependent, so is the object and thus 'this'.
324 //
325 // Note: The standard does not mention this case explicitly, but we need
326 // to do this so we can mark NSDM accesses as dependent.
328 D |= ExprDependence::Type;
329
330 assert(!(D & ExprDependence::UnexpandedPack));
331 return D;
332}
333
335 auto *Op = E->getSubExpr();
336 if (!Op)
337 return ExprDependence::None;
338 return Op->getDependence() & ~ExprDependence::TypeValue;
339}
340
344
347 if (auto *TSI = E->getTypeSourceInfo())
348 D |= toExprDependenceAsWritten(TSI->getType()->getDependence());
349 return D;
350}
351
355
362
364 // Never type-dependent.
366 // Value-dependent if the argument is type-dependent.
368 D |= ExprDependence::Value;
369 return D;
370}
371
373 auto D = E->getOperand()->getDependence() & ~ExprDependence::TypeValue;
374 if (CT == CT_Dependent)
375 D |= ExprDependence::ValueInstantiation;
376 return D;
377}
378
380 return (E->getPattern()->getDependence() & ~ExprDependence::UnexpandedPack) |
381 ExprDependence::TypeValueInstantiation;
382}
383
385
387 ~ExprDependence::UnexpandedPack;
388
390 if (D & ExprDependence::TypeValueInstantiation)
391 D |= E->getIndexExpr()->getDependence() | PatternDep |
392 ExprDependence::Instantiation;
393
394 ArrayRef<Expr *> Exprs = E->getExpressions();
395 if (Exprs.empty() || !E->isFullySubstituted())
396 D |= PatternDep | ExprDependence::Instantiation;
397 else if (!E->getIndexExpr()->isInstantiationDependent()) {
398 UnsignedOrNone Index = E->getSelectedIndex();
399 assert(Index && *Index < Exprs.size() && "pack index out of bound");
400 D |= Exprs[*Index]->getDependence();
401 }
402 return D;
403}
404
408
410 if (auto *Resume = E->getResumeExpr())
411 return (Resume->getDependence() &
412 (ExprDependence::TypeValue | ExprDependence::Error)) |
413 (E->getCommonExpr()->getDependence() & ~ExprDependence::TypeValue);
414 return E->getCommonExpr()->getDependence() |
415 ExprDependence::TypeValueInstantiation;
416}
417
419 return E->getOperand()->getDependence() |
420 ExprDependence::TypeValueInstantiation;
421}
422
426
430
434
436 if (E->isObjectReceiver())
438 if (E->isSuperReceiver())
441 ~ExprDependence::TypeValue;
442 assert(E->isClassReceiver());
443 return ExprDependence::None;
444}
445
449
454
458
460 auto D = E->getBase()->getDependence();
461 if (auto *LB = E->getLowerBound())
462 D |= LB->getDependence();
463 if (auto *Len = E->getLength())
464 D |= Len->getDependence();
465
466 if (E->isOMPArraySection()) {
467 if (auto *Stride = E->getStride())
468 D |= Stride->getDependence();
469 }
470 return D;
471}
472
474 auto D = E->getBase()->getDependence();
475 for (Expr *Dim: E->getDimensions())
476 if (Dim)
477 D |= turnValueToTypeDependence(Dim->getDependence());
478 return D;
479}
480
483 for (unsigned I = 0, End = E->numOfIterators(); I < End; ++I) {
484 if (auto *DD = cast_or_null<DeclaratorDecl>(E->getIteratorDecl(I))) {
485 // If the type is omitted, it's 'int', and is not dependent in any way.
486 if (auto *TSI = DD->getTypeSourceInfo()) {
487 D |= toExprDependenceAsWritten(TSI->getType()->getDependence());
488 }
489 }
491 if (Expr *BE = IR.Begin)
492 D |= BE->getDependence();
493 if (Expr *EE = IR.End)
494 D |= EE->getDependence();
495 if (Expr *SE = IR.Step)
496 D |= SE->getDependence();
497 }
498 return D;
499}
500
501/// Compute the type-, value-, and instantiation-dependence of a
502/// declaration reference
503/// based on the declaration being referenced.
505 auto Deps = ExprDependence::None;
506
508 ~NestedNameSpecifierDependence::Dependent);
509
510 if (auto *FirstArg = E->getTemplateArgs()) {
511 unsigned NumArgs = E->getNumTemplateArgs();
512 for (auto *Arg = FirstArg, *End = FirstArg + NumArgs; Arg < End; ++Arg)
513 Deps |= toExprDependence(Arg->getArgument().getDependence());
514 }
515
516 auto *Decl = E->getDecl();
517 auto Type = E->getType();
518
519 if (Decl->isParameterPack())
520 Deps |= ExprDependence::UnexpandedPack;
522 ExprDependence::Error;
523
524 // C++ [temp.dep.expr]p3:
525 // An id-expression is type-dependent if it contains:
526
527 // - an identifier associated by name lookup with one or more declarations
528 // declared with a dependent type
529 // - an identifier associated by name lookup with an entity captured by
530 // copy ([expr.prim.lambda.capture])
531 // in a lambda-expression that has an explicit object parameter whose
532 // type is dependent ([dcl.fct]),
533 //
534 // [The "or more" case is not modeled as a DeclRefExpr. There are a bunch
535 // more bullets here that we handle by treating the declaration as having a
536 // dependent type if they involve a placeholder type that can't be deduced.]
537 if (Type->isDependentType())
538 Deps |= ExprDependence::TypeValueInstantiation;
540 Deps |= ExprDependence::Instantiation;
541
542 // - an identifier associated by name lookup with an entity captured by
543 // copy ([expr.prim.lambda.capture])
545 Deps |= ExprDependence::Type;
546
547 // - a conversion-function-id that specifies a dependent type
548 if (Decl->getDeclName().getNameKind() ==
550 QualType T = Decl->getDeclName().getCXXNameType();
551 if (T->isDependentType())
552 return Deps | ExprDependence::TypeValueInstantiation;
553
554 if (T->isInstantiationDependentType())
555 Deps |= ExprDependence::Instantiation;
556 }
557
558 // - a template-id that is dependent,
559 // - a nested-name-specifier or a qualified-id that names a member of an
560 // unknown specialization
561 // [These are not modeled as DeclRefExprs.]
562
563 // or if it names a dependent member of the current instantiation that is a
564 // static data member of type "array of unknown bound of T" for some T
565 // [handled below].
566
567 // C++ [temp.dep.constexpr]p2:
568 // An id-expression is value-dependent if:
569
570 // - it is type-dependent [handled above]
571
572 // - it is the name of a non-type template parameter,
574 return Deps | ExprDependence::ValueInstantiation;
575
576 // - it names a potentially-constant variable that is initialized with an
577 // expression that is value-dependent
578 if (const auto *Var = dyn_cast<VarDecl>(Decl)) {
579 if (const Expr *Init = Var->getAnyInitializer()) {
580 if (Init->containsErrors())
581 Deps |= ExprDependence::Error;
582
583 if (Var->mightBeUsableInConstantExpressions(Ctx) &&
584 Init->isValueDependent())
585 Deps |= ExprDependence::ValueInstantiation;
586 }
587
588 // - it names a static data member that is a dependent member of the
589 // current instantiation and is not initialized in a member-declarator,
590 if (Var->isStaticDataMember() &&
591 Var->getDeclContext()->isDependentContext() &&
592 !Var->getFirstDecl()->hasInit()) {
593 const VarDecl *First = Var->getFirstDecl();
594 TypeSourceInfo *TInfo = First->getTypeSourceInfo();
595 if (TInfo->getType()->isIncompleteArrayType()) {
596 Deps |= ExprDependence::TypeValueInstantiation;
597 } else if (!First->hasInit()) {
598 Deps |= ExprDependence::ValueInstantiation;
599 }
600 }
601
602 return Deps;
603 }
604
605 // - it names a static member function that is a dependent member of the
606 // current instantiation
607 //
608 // FIXME: It's unclear that the restriction to static members here has any
609 // effect: any use of a non-static member function name requires either
610 // forming a pointer-to-member or providing an object parameter, either of
611 // which makes the overall expression value-dependent.
612 if (auto *MD = dyn_cast<CXXMethodDecl>(Decl)) {
613 if (MD->isStatic() && Decl->getDeclContext()->isDependentContext())
614 Deps |= ExprDependence::ValueInstantiation;
615 }
616
617 return Deps;
618}
619
621 // RecoveryExpr is
622 // - always value-dependent, and therefore instantiation dependent
623 // - contains errors (ExprDependence::Error), by definition
624 // - type-dependent if we don't know the type (fallback to an opaque
625 // dependent type), or the type is known and dependent, or it has
626 // type-dependent subexpressions.
628 ExprDependence::ErrorDependent;
629 // FIXME: remove the type-dependent bit from subexpressions, if the
630 // RecoveryExpr has a non-dependent type.
631 for (auto *S : E->subExpressions())
632 D |= S->getDependence();
633 return D;
634}
635
640
644
646 auto D = E->getCallee()->getDependence();
647 if (E->getType()->isDependentType())
648 D |= ExprDependence::Type;
649 for (auto *A : ArrayRef(E->getArgs(), E->getNumArgs())) {
650 if (A)
651 D |= A->getDependence();
652 }
653 for (auto *A : PreArgs)
654 D |= A->getDependence();
655 return D;
656}
657
665
667 auto D = ExprDependence::None;
668 if (Name.isInstantiationDependent())
669 D |= ExprDependence::Instantiation;
671 D |= ExprDependence::UnexpandedPack;
672 return D;
673}
674
676 auto D = E->getBase()->getDependence();
678
680 ~NestedNameSpecifierDependence::Dependent);
681
682 for (const auto &A : E->template_arguments())
683 D |= toExprDependence(A.getArgument().getDependence());
684
685 auto *MemberDecl = E->getMemberDecl();
686 if (FieldDecl *FD = dyn_cast<FieldDecl>(MemberDecl)) {
687 DeclContext *DC = MemberDecl->getDeclContext();
688 // dyn_cast_or_null is used to handle objC variables which do not
689 // have a declaration context.
690 CXXRecordDecl *RD = dyn_cast_or_null<CXXRecordDecl>(DC);
691 if (RD && RD->isDependentContext() && RD->isCurrentInstantiation(DC)) {
692 if (!E->getType()->isDependentType())
694 }
695
696 // Bitfield with value-dependent width is type-dependent.
697 if (FD && FD->isBitField() && FD->getBitWidth()->isValueDependent()) {
698 D |= ExprDependence::Type;
699 }
700 }
701 return D;
702}
703
705 auto D = ExprDependence::None;
706 for (auto *A : E->inits())
707 D |= A->getDependence();
708 return D;
709}
710
713 for (auto *C : ArrayRef(E->getSubExprs(), E->getNumSubExprs()))
714 D |= C->getDependence();
715 return D;
716}
717
719 bool ContainsUnexpandedPack) {
720 auto D = ContainsUnexpandedPack ? ExprDependence::UnexpandedPack
721 : ExprDependence::None;
722 for (auto *AE : E->getAssocExprs())
723 D |= AE->getDependence() & ExprDependence::Error;
724
725 if (E->isExprPredicate())
726 D |= E->getControllingExpr()->getDependence() & ExprDependence::Error;
727 else
730
731 if (E->isResultDependent())
732 return D | ExprDependence::TypeValueInstantiation;
733 return D | (E->getResultExpr()->getDependence() &
734 ~ExprDependence::UnexpandedPack);
735}
736
738 auto Deps = E->getInit()->getDependence();
739 for (const auto &D : E->designators()) {
740 auto DesignatorDeps = ExprDependence::None;
741 if (D.isArrayDesignator())
742 DesignatorDeps |= E->getArrayIndex(D)->getDependence();
743 else if (D.isArrayRangeDesignator())
744 DesignatorDeps |= E->getArrayRangeStart(D)->getDependence() |
746 Deps |= DesignatorDeps;
747 if (DesignatorDeps & ExprDependence::TypeValue)
748 Deps |= ExprDependence::TypeValueInstantiation;
749 }
750 return Deps;
751}
752
754 auto D = O->getSyntacticForm()->getDependence();
755 for (auto *E : O->semantics())
756 D |= E->getDependence();
757 return D;
758}
759
761 auto D = ExprDependence::None;
762 for (auto *E : ArrayRef(A->getSubExprs(), A->getNumSubExprs()))
763 D |= E->getDependence();
764 return D;
765}
766
771 auto Size = E->getArraySize();
772 if (Size && *Size)
773 D |= turnTypeToValueDependence((*Size)->getDependence());
774 if (auto *I = E->getInitializer())
775 D |= turnTypeToValueDependence(I->getDependence());
776 for (auto *A : E->placement_arguments())
777 D |= turnTypeToValueDependence(A->getDependence());
778 return D;
779}
780
782 auto D = E->getBase()->getDependence();
783 if (auto *TSI = E->getDestroyedTypeInfo())
784 D |= toExprDependenceAsWritten(TSI->getType()->getDependence());
785 if (auto *ST = E->getScopeTypeInfo())
787 toExprDependenceAsWritten(ST->getType()->getDependence()));
789 ~NestedNameSpecifierDependence::Dependent);
790 return D;
791}
792
795 bool KnownInstantiationDependent,
796 bool KnownContainsUnexpandedParameterPack) {
797 auto Deps = ExprDependence::None;
798 if (KnownDependent)
799 Deps |= ExprDependence::TypeValue;
800 if (KnownInstantiationDependent)
801 Deps |= ExprDependence::Instantiation;
802 if (KnownContainsUnexpandedParameterPack)
803 Deps |= ExprDependence::UnexpandedPack;
804 Deps |= getDependenceInExpr(E->getNameInfo());
806 ~NestedNameSpecifierDependence::Dependent);
807 for (auto *D : E->decls()) {
808 if (D->getDeclContext()->isDependentContext() ||
810 Deps |= ExprDependence::TypeValueInstantiation;
811 }
812 // If we have explicit template arguments, check for dependent
813 // template arguments and whether they contain any unexpanded pack
814 // expansions.
815 for (const auto &A : E->template_arguments())
816 Deps |= toExprDependence(A.getArgument().getDependence());
817 return Deps;
818}
819
821 auto D = ExprDependence::TypeValue;
824 for (const auto &A : E->template_arguments())
825 D |= toExprDependence(A.getArgument().getDependence());
826 return D;
827}
828
832 for (auto *A : E->arguments())
833 D |= A->getDependence() & ~ExprDependence::Type;
834 return D;
835}
836
843
847
851
853 bool ContainsUnexpandedParameterPack) {
855 if (ContainsUnexpandedParameterPack)
856 D |= ExprDependence::UnexpandedPack;
857 return D;
858}
859
861 auto D = ExprDependence::ValueInstantiation;
864 for (auto *A : E->arguments())
865 D |= A->getDependence() &
866 (ExprDependence::UnexpandedPack | ExprDependence::Error);
867 return D;
868}
869
871 auto D = ExprDependence::TypeValueInstantiation;
872 if (!E->isImplicitAccess())
873 D |= E->getBase()->getDependence();
876 for (const auto &A : E->template_arguments())
877 D |= toExprDependence(A.getArgument().getDependence());
878 return D;
879}
880
884
886 auto D = ExprDependence::TypeValueInstantiation;
887 for (const auto *C : {E->getLHS(), E->getRHS()}) {
888 if (C)
889 D |= C->getDependence() & ~ExprDependence::UnexpandedPack;
890 }
891 return D;
892}
893
895 auto D = ExprDependence::None;
896 for (const auto *A : E->getInitExprs())
897 D |= A->getDependence();
898 return D;
899}
900
902 auto D = ExprDependence::None;
903 for (const auto *A : E->getArgs())
904 D |= toExprDependenceAsWritten(A->getType()->getDependence()) &
906 return D;
907}
908
910 bool ValueDependent) {
911 auto TA = TemplateArgumentDependence::None;
912 const auto InterestingDeps = TemplateArgumentDependence::Instantiation |
913 TemplateArgumentDependence::UnexpandedPack;
914 for (const TemplateArgumentLoc &ArgLoc :
916 TA |= ArgLoc.getArgument().getDependence() & InterestingDeps;
917 if (TA == InterestingDeps)
918 break;
919 }
920
922 ValueDependent ? ExprDependence::Value : ExprDependence::None;
923 auto Res = D | toExprDependence(TA);
924 if(!ValueDependent && E->getSatisfaction().ContainsErrors)
925 Res |= ExprDependence::Error;
926 return Res;
927}
928
930 auto D = ExprDependence::None;
931 Expr **Elements = E->getElements();
932 for (unsigned I = 0, N = E->getNumElements(); I != N; ++I)
933 D |= turnTypeToValueDependence(Elements[I]->getDependence());
934 return D;
935}
936
938 auto Deps = ExprDependence::None;
939 for (unsigned I = 0, N = E->getNumElements(); I < N; ++I) {
940 auto KV = E->getKeyValueElement(I);
941 auto KVDeps = turnTypeToValueDependence(KV.Key->getDependence() |
942 KV.Value->getDependence());
943 if (KV.EllipsisLoc.isValid())
944 KVDeps &= ~ExprDependence::UnexpandedPack;
945 Deps |= KVDeps;
946 }
947 return Deps;
948}
949
951 auto D = ExprDependence::None;
952 if (auto *R = E->getInstanceReceiver())
953 D |= R->getDependence();
954 else
956 for (auto *A : E->arguments())
957 D |= A->getDependence();
958 return D;
959}
960
962 // This represents a simple asterisk as typed, so cannot be dependent in any
963 // way.
964 return ExprDependence::None;
965}
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:220
const LangOptions & getLangOpts() const
Definition ASTContext.h:944
Represents a loop initializing the elements of an array.
Definition Expr.h:5968
OpaqueValueExpr * getCommonExpr() const
Get the common subexpression shared by all initializations (the source array).
Definition Expr.h:5983
Expr * getSubExpr() const
Get the initializer to use for each array element.
Definition Expr.h:5988
This class represents BOTH the OpenMP Array Section and OpenACC 'subarray', with a boolean differenti...
Definition Expr.h:7171
Expr * getBase()
Get base of the array section.
Definition Expr.h:7249
Expr * getLength()
Get length of array section.
Definition Expr.h:7259
bool isOMPArraySection() const
Definition Expr.h:7245
Expr * getStride()
Get stride of array section.
Definition Expr.h:7263
Expr * getLowerBound()
Get lower bound of array section.
Definition Expr.h:7253
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
Definition Expr.h:2721
Expr * getLHS()
An array access can be written A[4] or 4[A] (both are equivalent).
Definition Expr.h:2750
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent.
Definition ExprCXX.h:2996
QualType getQueriedType() const
Definition ExprCXX.h:3040
Expr * getDimensionExpression() const
Definition ExprCXX.h:3046
AsTypeExpr - Clang builtin function __builtin_astype [OpenCL 6.2.4.2] This AST node provides support ...
Definition Expr.h:6685
Expr * getSrcExpr() const
getSrcExpr - Return the Expr to be converted.
Definition Expr.h:6704
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load,...
Definition Expr.h:6880
Expr ** getSubExprs()
Definition Expr.h:6955
static unsigned getNumSubExprs(AtomicOp Op)
Determine the number of arguments the specified atomic builtin should have.
Definition Expr.cpp:5156
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
Definition Expr.h:4453
Expr * getFalseExpr() const
getFalseExpr - Return the subexpression which will be evaluated if the condition evaluates to false; ...
Definition Expr.h:4507
Expr * getCommon() const
getCommon - Return the common expression, written to the left of the condition.
Definition Expr.h:4488
A builtin binary operation expression such as "x + y" or "x <= y".
Definition Expr.h:4038
Expr * getLHS() const
Definition Expr.h:4088
Expr * getRHS() const
Definition Expr.h:4090
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Definition Expr.h:6624
const BlockDecl * getBlockDecl() const
Definition Expr.h:6636
Represents binding an expression to a temporary.
Definition ExprCXX.h:1493
const Expr * getSubExpr() const
Definition ExprCXX.h:1515
Represents a call to a C++ constructor.
Definition ExprCXX.h:1548
arg_range arguments()
Definition ExprCXX.h:1672
A default argument (C++ [dcl.fct.default]).
Definition ExprCXX.h:1270
A use of a default initializer in a constructor or in aggregate initialization.
Definition ExprCXX.h:1377
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:2626
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition ExprCXX.h:3870
NestedNameSpecifier getQualifier() const
Retrieve the nested-name-specifier that qualifies the member name.
Definition ExprCXX.h:3977
const DeclarationNameInfo & getMemberNameInfo() const
Retrieve the name of the member that this expression refers to.
Definition ExprCXX.h:4003
Expr * getBase() const
Retrieve the base object of this member expressions, e.g., the x in x.m.
Definition ExprCXX.h:3960
bool isImplicitAccess() const
True if this is an implicit access, i.e.
Definition ExprCXX.h:3952
ArrayRef< TemplateArgumentLoc > template_arguments() const
Definition ExprCXX.h:4071
Represents a folding of a pack over an operator.
Definition ExprCXX.h:5032
Expr * getRHS() const
Definition ExprCXX.h:5058
Expr * getLHS() const
Definition ExprCXX.h:5057
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)".
Definition ExprCXX.h:2355
llvm::iterator_range< arg_iterator > placement_arguments()
Definition ExprCXX.h:2572
QualType getAllocatedType() const
Definition ExprCXX.h:2434
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:2469
TypeSourceInfo * getAllocatedTypeSourceInfo() const
Definition ExprCXX.h:2438
Expr * getInitializer()
The initializer of this new-expression.
Definition ExprCXX.h:2533
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
Definition ExprCXX.h:4309
Expr * getOperand() const
Definition ExprCXX.h:4326
Represents a list-initialization with parenthesis.
Definition ExprCXX.h:5141
MutableArrayRef< Expr * > getInitExprs()
Definition ExprCXX.h:5181
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
Definition ExprCXX.h:2745
TypeSourceInfo * getDestroyedTypeInfo() const
Retrieve the source location information for the type being destroyed.
Definition ExprCXX.h:2839
TypeSourceInfo * getScopeTypeInfo() const
Retrieve the scope type in a qualified pseudo-destructor expression.
Definition ExprCXX.h:2823
NestedNameSpecifier getQualifier() const
If the member name was qualified, retrieves the nested-name-specifier that precedes the member name.
Definition ExprCXX.h:2803
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:286
Expr * getSemanticForm()
Get an equivalent semantic form for this expression.
Definition ExprCXX.h:304
An expression "T()" which creates an rvalue of a non-class type T.
Definition ExprCXX.h:2196
TypeSourceInfo * getTypeSourceInfo() const
Definition ExprCXX.h:2215
Implicit construction of a std::initializer_list<T> object from an array temporary within list-initia...
Definition ExprCXX.h:800
Represents a C++ functional cast expression that builds a temporary object.
Definition ExprCXX.h:1899
TypeSourceInfo * getTypeSourceInfo() const
Definition ExprCXX.h:1928
Represents the this expression in C++.
Definition ExprCXX.h:1154
bool isCapturedByCopyInLambdaWithExplicitObjectParameter() const
Definition ExprCXX.h:1180
A C++ throw-expression (C++ [except.throw]).
Definition ExprCXX.h:1208
const Expr * getSubExpr() const
Definition ExprCXX.h:1228
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
Definition ExprCXX.h:848
bool isTypeOperand() const
Definition ExprCXX.h:884
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
Definition ExprCXX.h:891
Expr * getExprOperand() const
Definition ExprCXX.h:895
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
Definition ExprCXX.h:3744
QualType getTypeAsWritten() const
Retrieve the type that is being constructed, as specified in the source code.
Definition ExprCXX.h:3778
A Microsoft C++ __uuidof expression, which gets the _GUID that corresponds to the supplied type or ex...
Definition ExprCXX.h:1068
Expr * getExprOperand() const
Definition ExprCXX.h:1109
bool isTypeOperand() const
Definition ExprCXX.h:1098
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
Definition ExprCXX.h:1105
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition Expr.h:2943
Expr * getCallee()
Definition Expr.h:3090
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
Definition Expr.h:3134
Expr ** getArgs()
Retrieve the call arguments.
Definition Expr.h:3137
Expr * getSubExpr()
Definition Expr.h:3726
ChooseExpr - GNU builtin-in function __builtin_choose_expr.
Definition Expr.h:4848
Expr * getLHS() const
Definition Expr.h:4890
bool isConditionDependent() const
Definition Expr.h:4878
bool isConditionTrue() const
isConditionTrue - Return whether the condition is true (i.e.
Definition Expr.h:4871
Expr * getRHS() const
Definition Expr.h:4892
Expr * getCond() const
Definition Expr.h:4888
CompoundLiteralExpr - [C99 6.5.2.5].
Definition Expr.h:3605
const Expr * getInitializer() const
Definition Expr.h:3633
TypeSourceInfo * getTypeSourceInfo() const
Definition Expr.h:3643
Stmt * body_back()
Definition Stmt.h:1799
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:4391
Expr * getLHS() const
Definition Expr.h:4425
Expr * getCond() const
getCond - Return the expression representing the condition for the ?
Definition Expr.h:4414
Expr * getRHS() const
Definition Expr.h:4426
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
Definition Expr.h:4719
TypeSourceInfo * getTypeSourceInfo() const
getTypeSourceInfo - Return the destination type.
Definition Expr.h:4812
Expr * getSrcExpr() const
getSrcExpr - Return the Expr to be converted.
Definition Expr.h:4809
Represents an expression that might suspend coroutine execution; either a co_await or co_yield expres...
Definition ExprCXX.h:5255
Expr * getResumeExpr() const
Definition ExprCXX.h:5319
Expr * getCommonExpr() const
Definition ExprCXX.h:5304
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:1270
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition Expr.h:1445
NestedNameSpecifier getQualifier() const
If the name was qualified, retrieves the nested-name-specifier that precedes the name.
Definition Expr.h:1371
bool isCapturedByCopyInLambdaWithExplicitObjectParameter() const
Definition Expr.h:1486
ValueDecl * getDecl()
Definition Expr.h:1338
const TemplateArgumentLoc * getTemplateArgs() const
Retrieve the template arguments provided as part of this template-id.
Definition Expr.h:1437
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:5401
Expr * getOperand() const
Definition ExprCXX.h:5424
A qualified reference to a name whose declaration cannot yet be resolved.
Definition ExprCXX.h:3510
ArrayRef< TemplateArgumentLoc > template_arguments() const
Definition ExprCXX.h:3618
NestedNameSpecifier getQualifier() const
Retrieve the nested-name-specifier that qualifies this declaration.
Definition ExprCXX.h:3562
const DeclarationNameInfo & getNameInfo() const
Retrieve the name that this expression refers to.
Definition ExprCXX.h:3546
Represents a C99 designated initializer expression.
Definition Expr.h:5551
Expr * getArrayRangeEnd(const Designator &D) const
Definition Expr.cpp:4783
Expr * getArrayRangeStart(const Designator &D) const
Definition Expr.cpp:4778
MutableArrayRef< Designator > designators()
Definition Expr.h:5784
Expr * getArrayIndex(const Designator &D) const
Definition Expr.cpp:4773
Expr * getInit() const
Retrieve the initializer value.
Definition Expr.h:5819
ExplicitCastExpr - An explicit cast written in the source code.
Definition Expr.h:3928
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:3085
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:3069
Expr * getQueriedExpression() const
Definition ExprCXX.h:3108
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
Definition Expr.h:6564
const Expr * getBase() const
Definition Expr.h:6581
Represents a member of a struct/union/class.
Definition Decl.h:3160
FullExpr - Represents a "full-expression" node.
Definition Expr.h:1049
const Expr * getSubExpr() const
Definition Expr.h:1062
Represents a C11 generic selection.
Definition Expr.h:6178
TypeSourceInfo * getControllingType()
Return the controlling type of this generic selection expression.
Definition Expr.h:6453
ArrayRef< Expr * > getAssocExprs() const
Definition Expr.h:6473
bool isExprPredicate() const
Whether this generic selection uses an expression as its controlling argument.
Definition Expr.h:6434
Expr * getResultExpr()
Return the result expression of this controlling expression.
Definition Expr.h:6462
bool isResultDependent() const
Whether this generic selection is result-dependent.
Definition Expr.h:6430
Expr * getControllingExpr()
Return the controlling expression of this generic selection expression.
Definition Expr.h:6441
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition Expr.h:3853
Represents an implicitly-generated value initialization of an object of a given type.
Definition Expr.h:6057
Describes an C or C++ initializer list.
Definition Expr.h:5299
ArrayRef< Expr * > inits()
Definition Expr.h:5349
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
Definition ExprCXX.h:1968
A member reference to an MSPropertyDecl.
Definition ExprCXX.h:936
Expr * getBaseExpr() const
Definition ExprCXX.h:988
MS property subscript expression.
Definition ExprCXX.h:1006
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
Definition ExprCXX.h:4920
Expr * getSubExpr() const
Retrieve the temporary-generating subexpression whose value will be materialized into a glvalue.
Definition ExprCXX.h:4937
MatrixSingleSubscriptExpr - Matrix single subscript expression for the MatrixType extension when you ...
Definition Expr.h:2795
MatrixSubscriptExpr - Matrix subscript expression for the MatrixType extension.
Definition Expr.h:2865
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Definition Expr.h:3364
ArrayRef< TemplateArgumentLoc > template_arguments() const
Definition Expr.h:3536
NestedNameSpecifier getQualifier() const
If the member name was qualified, retrieves the nested-name-specifier that precedes the member name.
Definition Expr.h:3475
ValueDecl * getMemberDecl() const
Retrieve the member declaration to which this expression refers.
Definition Expr.h:3447
Expr * getBase() const
Definition Expr.h:3441
DeclarationNameInfo getMemberNameInfo() const
Retrieve the member declaration name info.
Definition Expr.h:3541
NestedNameSpecifierDependence getDependence() const
Represents a place-holder for an object not to be initialized by anything.
Definition Expr.h:5877
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:5439
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:5435
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:2527
Expr * getIndexExpr(unsigned Idx)
Definition Expr.h:2586
TypeSourceInfo * getTypeSourceInfo() const
Definition Expr.h:2567
unsigned getNumExpressions() const
Definition Expr.h:2598
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class.
Definition Expr.h:1178
Expr * getSourceExpr() const
The source expression of an opaque value expression is the expression which originally generated the ...
Definition Expr.h:1228
This expression type represents an asterisk in an OpenACC Size-Expr, used in the 'tile' and 'gang' cl...
Definition Expr.h:2090
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr.
Definition ExprCXX.h:3128
NestedNameSpecifier getQualifier() const
Fetches the nested-name qualifier, if one was given.
Definition ExprCXX.h:3244
const DeclarationNameInfo & getNameInfo() const
Gets the full name info.
Definition ExprCXX.h:3235
llvm::iterator_range< decls_iterator > decls() const
Definition ExprCXX.h:3227
ArrayRef< TemplateArgumentLoc > template_arguments() const
Definition ExprCXX.h:3337
Represents a C++11 pack expansion that produces a sequence of expressions.
Definition ExprCXX.h:4363
Expr * getPattern()
Retrieve the pattern of the pack expansion.
Definition ExprCXX.h:4392
Expr * getIndexExpr() const
Definition ExprCXX.h:4628
ArrayRef< Expr * > getExpressions() const
Return the trailing expressions, regardless of the expansion.
Definition ExprCXX.h:4646
Expr * getPackIdExpression() const
Definition ExprCXX.h:4624
bool isFullySubstituted() const
Definition ExprCXX.h:4602
UnsignedOrNone getSelectedIndex() const
Definition ExprCXX.h:4630
ParenExpr - This represents a parenthesized expression, e.g.
Definition Expr.h:2182
const Expr * getSubExpr() const
Definition Expr.h:2199
ArrayRef< Expr * > exprs()
Definition Expr.h:6123
[C99 6.4.2.2] - A predefined identifier such as func.
Definition Expr.h:2005
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
Definition Expr.h:6756
ArrayRef< Expr * > semantics()
Definition Expr.h:6828
Expr * getSyntacticForm()
Return the syntactic form of this expression, i.e.
Definition Expr.h:6793
A (possibly-)qualified type.
Definition TypeBase.h:937
Frontend produces RecoveryExprs on semantic errors that prevent creating other well-formed expression...
Definition Expr.h:7455
ArrayRef< Expr * > subExpressions()
Definition Expr.h:7462
TypeSourceInfo * getTypeSourceInfo()
Definition Expr.h:2143
ShuffleVectorExpr - clang-specific builtin-in function __builtin_shufflevector.
Definition Expr.h:4643
Expr ** getSubExprs()
Retrieve the array of expressions.
Definition Expr.h:4679
unsigned getNumSubExprs() const
getNumSubExprs - Return the size of the SubExprs array.
Definition Expr.h:4676
StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).
Definition Expr.h:4595
CompoundStmt * getSubStmt()
Definition Expr.h:4612
Represents a reference to a non-type template parameter that has been substituted with a template arg...
Definition ExprCXX.h:4664
Location wrapper for a TemplateArgument.
A container of type source information.
Definition TypeBase.h:8264
QualType getType() const
Return the type wrapped by this type source info.
Definition TypeBase.h:8275
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
Definition ExprCXX.h:2896
ArrayRef< TypeSourceInfo * > getArgs() const
Retrieve the argument types.
Definition ExprCXX.h:2967
The base class of the type hierarchy.
Definition TypeBase.h:1833
bool isIncompleteArrayType() const
Definition TypeBase.h:8637
bool isInstantiationDependentType() const
Determine whether this type is an instantiation-dependent type, meaning that the type involves a temp...
Definition TypeBase.h:2791
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
Definition TypeBase.h:2783
TypeDependence getDependence() const
Definition TypeBase.h:2772
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand.
Definition Expr.h:2625
QualType getArgumentType() const
Definition Expr.h:2668
UnaryExprOrTypeTrait getKind() const
Definition Expr.h:2657
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
Definition Expr.h:2244
Expr * getSubExpr() const
Definition Expr.h:2285
Opcode getOpcode() const
Definition Expr.h:2280
Represents a call to the builtin function __builtin_va_arg.
Definition Expr.h:4957
TypeSourceInfo * getWrittenTypeInfo() const
Definition Expr.h:4981
const Expr * getSubExpr() const
Definition Expr.h:4973
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:415
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
const FunctionProtoType * T
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:645
Iterator range representation begin:end[:step].
Definition ExprOpenMP.h:154