clang  16.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"
16 #include "clang/AST/ExprConcepts.h"
17 #include "clang/AST/ExprObjC.h"
18 #include "clang/AST/ExprOpenMP.h"
20 #include "llvm/ADT/ArrayRef.h"
21 
22 using namespace clang;
23 
25  return E->getSubExpr()->getDependence();
26 }
27 
30  if (auto *S = E->getSourceExpr())
31  D |= S->getDependence();
32  assert(!(D & ExprDependence::UnexpandedPack));
33  return D;
34 }
35 
37  return E->getSubExpr()->getDependence();
38 }
39 
41  const ASTContext &Ctx) {
42  ExprDependence Dep =
43  // FIXME: Do we need to look at the type?
45  E->getSubExpr()->getDependence();
46 
47  // C++ [temp.dep.constexpr]p5:
48  // An expression of the form & qualified-id where the qualified-id names a
49  // dependent member of the current instantiation is value-dependent. An
50  // expression of the form & cast-expression is also value-dependent if
51  // evaluating cast-expression as a core constant expression succeeds and
52  // the result of the evaluation refers to a templated entity that is an
53  // object with static or thread storage duration or a member function.
54  //
55  // What this amounts to is: constant-evaluate the operand and check whether it
56  // refers to a templated entity other than a variable with local storage.
57  if (Ctx.getLangOpts().CPlusPlus && E->getOpcode() == UO_AddrOf &&
58  !(Dep & ExprDependence::Value)) {
59  Expr::EvalResult Result;
61  Result.Diag = &Diag;
62  // FIXME: This doesn't enforce the C++98 constant expression rules.
63  if (E->getSubExpr()->EvaluateAsConstantExpr(Result, Ctx) && Diag.empty() &&
64  Result.Val.isLValue()) {
65  auto *VD = Result.Val.getLValueBase().dyn_cast<const ValueDecl *>();
66  if (VD && VD->isTemplated()) {
67  auto *VarD = dyn_cast<VarDecl>(VD);
68  if (!VarD || !VarD->hasLocalStorage())
69  Dep |= ExprDependence::Value;
70  }
71  }
72  }
73 
74  return Dep;
75 }
76 
78  // Never type-dependent (C++ [temp.dep.expr]p3).
79  // Value-dependent if the argument is type-dependent.
80  if (E->isArgumentType())
83 
84  auto ArgDeps = E->getArgumentExpr()->getDependence();
85  auto Deps = ArgDeps & ~ExprDependence::TypeValue;
86  // Value-dependent if the argument is type-dependent.
87  if (ArgDeps & ExprDependence::Type)
88  Deps |= ExprDependence::Value;
89  // Check to see if we are in the situation where alignof(decl) should be
90  // dependent because decl's alignment is dependent.
91  auto ExprKind = E->getKind();
92  if (ExprKind != UETT_AlignOf && ExprKind != UETT_PreferredAlignOf)
93  return Deps;
94  if ((Deps & ExprDependence::Value) && (Deps & ExprDependence::Instantiation))
95  return Deps;
96 
97  auto *NoParens = E->getArgumentExpr()->IgnoreParens();
98  const ValueDecl *D = nullptr;
99  if (const auto *DRE = dyn_cast<DeclRefExpr>(NoParens))
100  D = DRE->getDecl();
101  else if (const auto *ME = dyn_cast<MemberExpr>(NoParens))
102  D = ME->getMemberDecl();
103  if (!D)
104  return Deps;
105  for (const auto *I : D->specific_attrs<AlignedAttr>()) {
106  if (I->isAlignmentErrorDependent())
107  Deps |= ExprDependence::Error;
108  if (I->isAlignmentDependent())
109  Deps |= ExprDependence::ValueInstantiation;
110  }
111  return Deps;
112 }
113 
115  return E->getLHS()->getDependence() | E->getRHS()->getDependence();
116 }
117 
119  return E->getBase()->getDependence() | E->getRowIdx()->getDependence() |
120  (E->getColumnIdx() ? E->getColumnIdx()->getDependence()
122 }
123 
129 }
130 
132  // We model implicit conversions as combining the dependence of their
133  // subexpression, apart from its type, with the semantic portion of the
134  // target type.
135  ExprDependence D =
137  if (auto *S = E->getSubExpr())
138  D |= S->getDependence() & ~ExprDependence::Type;
139  return D;
140 }
141 
143  // Cast expressions are type-dependent if the type is
144  // dependent (C++ [temp.dep.expr]p3).
145  // Cast expressions are value-dependent if the type is
146  // dependent or if the subexpression is value-dependent.
147  //
148  // Note that we also need to consider the dependence of the actual type here,
149  // because when the type as written is a deduced type, that type is not
150  // dependent, but it may be deduced as a dependent type.
151  ExprDependence D =
153  cast<ExplicitCastExpr>(E)->getTypeAsWritten()->getDependence()) |
155  if (auto *S = E->getSubExpr())
156  D |= S->getDependence() & ~ExprDependence::Type;
157  return D;
158 }
159 
161  return E->getLHS()->getDependence() | E->getRHS()->getDependence();
162 }
163 
165  // The type of the conditional operator depends on the type of the conditional
166  // to support the GCC vector conditional extension. Additionally,
167  // [temp.dep.expr] does specify state that this should be dependent on ALL sub
168  // expressions.
169  return E->getCond()->getDependence() | E->getLHS()->getDependence() |
170  E->getRHS()->getDependence();
171 }
172 
174  return E->getCommon()->getDependence() | E->getFalseExpr()->getDependence();
175 }
176 
177 ExprDependence clang::computeDependence(StmtExpr *E, unsigned TemplateDepth) {
179  // Propagate dependence of the result.
180  if (const auto *CompoundExprResult =
181  dyn_cast_or_null<ValueStmt>(E->getSubStmt()->getStmtExprResult()))
182  if (const Expr *ResultExpr = CompoundExprResult->getExprStmt())
183  D |= ResultExpr->getDependence();
184  // Note: we treat a statement-expression in a dependent context as always
185  // being value- and instantiation-dependent. This matches the behavior of
186  // lambda-expressions and GCC.
187  if (TemplateDepth)
188  D |= ExprDependence::ValueInstantiation;
189  // A param pack cannot be expanded over stmtexpr boundaries.
190  return D & ~ExprDependence::UnexpandedPack;
191 }
192 
194  auto D = toExprDependenceAsWritten(
196  E->getSrcExpr()->getDependence();
197  if (!E->getType()->isDependentType())
198  D &= ~ExprDependence::Type;
199  return D;
200 }
201 
203  if (E->isConditionDependent())
204  return ExprDependence::TypeValueInstantiation |
205  E->getCond()->getDependence() | E->getLHS()->getDependence() |
206  E->getRHS()->getDependence();
207 
208  auto Cond = E->getCond()->getDependence();
209  auto Active = E->getLHS()->getDependence();
210  auto Inactive = E->getRHS()->getDependence();
211  if (!E->isConditionTrue())
212  std::swap(Active, Inactive);
213  // Take type- and value- dependency from the active branch. Propagate all
214  // other flags from all branches.
215  return (Active & ExprDependence::TypeValue) |
216  ((Cond | Active | Inactive) & ~ExprDependence::TypeValue);
217 }
218 
220  auto D = ExprDependence::None;
221  for (auto *E : P->exprs())
222  D |= E->getDependence();
223  return D;
224 }
225 
227  auto D = toExprDependenceAsWritten(
230  return D & ~ExprDependence::Value;
231 }
232 
235  (ExprDependence::Instantiation | ExprDependence::Error);
236 }
237 
239  auto D = E->getCommonExpr()->getDependence() |
240  E->getSubExpr()->getDependence() | ExprDependence::Instantiation;
242  D &= ~ExprDependence::Instantiation;
243  return turnTypeToValueDependence(D);
244 }
245 
248  ExprDependence::Instantiation;
249 }
250 
252  return E->getBase()->getDependence();
253 }
254 
257  if (E->getBlockDecl()->isDependentContext())
258  D |= ExprDependence::Instantiation;
259  return D;
260 }
261 
263  // FIXME: AsTypeExpr doesn't store the type as written. Assume the expression
264  // type has identical sugar for now, so is a type-as-written.
266  E->getSrcExpr()->getDependence();
267  if (!E->getType()->isDependentType())
268  D &= ~ExprDependence::Type;
269  return D;
270 }
271 
273  return E->getSemanticForm()->getDependence();
274 }
275 
279  return D;
280 }
281 
283  auto D = ExprDependence::None;
284  if (E->isTypeOperand())
287  else
289  // typeid is never type-dependent (C++ [temp.dep.expr]p4)
290  return D & ~ExprDependence::Type;
291 }
292 
295 }
296 
298  return E->getIdx()->getDependence();
299 }
300 
302  if (E->isTypeOperand())
305 
307 }
308 
310  // 'this' is type-dependent if the class type of the enclosing
311  // member function is dependent (C++ [temp.dep.expr]p2)
313  assert(!(D & ExprDependence::UnexpandedPack));
314  return D;
315 }
316 
318  auto *Op = E->getSubExpr();
319  if (!Op)
320  return ExprDependence::None;
321  return Op->getDependence() & ~ExprDependence::TypeValue;
322 }
323 
325  return E->getSubExpr()->getDependence();
326 }
327 
330  if (auto *TSI = E->getTypeSourceInfo())
331  D |= toExprDependenceAsWritten(TSI->getType()->getDependence());
332  return D;
333 }
334 
337 }
338 
341  if (auto *Dim = E->getDimensionExpression())
342  D |= Dim->getDependence();
343  return turnTypeToValueDependence(D);
344 }
345 
347  // Never type-dependent.
349  // Value-dependent if the argument is type-dependent.
352  return D;
353 }
354 
356  auto D = E->getOperand()->getDependence() & ~ExprDependence::TypeValue;
357  if (CT == CT_Dependent)
358  D |= ExprDependence::ValueInstantiation;
359  return D;
360 }
361 
363  return (E->getPattern()->getDependence() & ~ExprDependence::UnexpandedPack) |
364  ExprDependence::TypeValueInstantiation;
365 }
366 
368  return E->getReplacement()->getDependence();
369 }
370 
372  if (auto *Resume = E->getResumeExpr())
373  return (Resume->getDependence() &
374  (ExprDependence::TypeValue | ExprDependence::Error)) |
375  (E->getCommonExpr()->getDependence() & ~ExprDependence::TypeValue);
376  return E->getCommonExpr()->getDependence() |
377  ExprDependence::TypeValueInstantiation;
378 }
379 
381  return E->getOperand()->getDependence() |
382  ExprDependence::TypeValueInstantiation;
383 }
384 
386  return E->getSubExpr()->getDependence();
387 }
388 
391 }
392 
395 }
396 
398  if (E->isObjectReceiver())
399  return E->getBase()->getDependence() & ~ExprDependence::Type;
400  if (E->isSuperReceiver())
403  ~ExprDependence::TypeValue;
404  assert(E->isClassReceiver());
405  return ExprDependence::None;
406 }
407 
409  return E->getBaseExpr()->getDependence() | E->getKeyExpr()->getDependence();
410 }
411 
413  return E->getBase()->getDependence() & ~ExprDependence::Type &
414  ~ExprDependence::UnexpandedPack;
415 }
416 
418  return E->getSubExpr()->getDependence();
419 }
420 
422  auto D = E->getBase()->getDependence();
423  if (auto *LB = E->getLowerBound())
424  D |= LB->getDependence();
425  if (auto *Len = E->getLength())
426  D |= Len->getDependence();
427  return D;
428 }
429 
431  auto D = E->getBase()->getDependence();
432  for (Expr *Dim: E->getDimensions())
433  if (Dim)
434  D |= turnValueToTypeDependence(Dim->getDependence());
435  return D;
436 }
437 
440  for (unsigned I = 0, End = E->numOfIterators(); I < End; ++I) {
441  if (auto *DD = cast_or_null<DeclaratorDecl>(E->getIteratorDecl(I))) {
442  // If the type is omitted, it's 'int', and is not dependent in any way.
443  if (auto *TSI = DD->getTypeSourceInfo()) {
444  D |= toExprDependenceAsWritten(TSI->getType()->getDependence());
445  }
446  }
448  if (Expr *BE = IR.Begin)
449  D |= BE->getDependence();
450  if (Expr *EE = IR.End)
451  D |= EE->getDependence();
452  if (Expr *SE = IR.Step)
453  D |= SE->getDependence();
454  }
455  return D;
456 }
457 
458 /// Compute the type-, value-, and instantiation-dependence of a
459 /// declaration reference
460 /// based on the declaration being referenced.
462  auto Deps = ExprDependence::None;
463 
464  if (auto *NNS = E->getQualifier())
465  Deps |= toExprDependence(NNS->getDependence() &
466  ~NestedNameSpecifierDependence::Dependent);
467 
468  if (auto *FirstArg = E->getTemplateArgs()) {
469  unsigned NumArgs = E->getNumTemplateArgs();
470  for (auto *Arg = FirstArg, *End = FirstArg + NumArgs; Arg < End; ++Arg)
471  Deps |= toExprDependence(Arg->getArgument().getDependence());
472  }
473 
474  auto *Decl = E->getDecl();
475  auto Type = E->getType();
476 
477  if (Decl->isParameterPack())
478  Deps |= ExprDependence::UnexpandedPack;
481 
482  // C++ [temp.dep.expr]p3:
483  // An id-expression is type-dependent if it contains:
484 
485  // - an identifier associated by name lookup with one or more declarations
486  // declared with a dependent type
487  //
488  // [The "or more" case is not modeled as a DeclRefExpr. There are a bunch
489  // more bullets here that we handle by treating the declaration as having a
490  // dependent type if they involve a placeholder type that can't be deduced.]
491  if (Type->isDependentType())
492  return Deps | ExprDependence::TypeValueInstantiation;
494  Deps |= ExprDependence::Instantiation;
495 
496  // - a conversion-function-id that specifies a dependent type
497  if (Decl->getDeclName().getNameKind() ==
499  QualType T = Decl->getDeclName().getCXXNameType();
500  if (T->isDependentType())
501  return Deps | ExprDependence::TypeValueInstantiation;
502 
504  Deps |= ExprDependence::Instantiation;
505  }
506 
507  // - a template-id that is dependent,
508  // - a nested-name-specifier or a qualified-id that names a member of an
509  // unknown specialization
510  // [These are not modeled as DeclRefExprs.]
511 
512  // or if it names a dependent member of the current instantiation that is a
513  // static data member of type "array of unknown bound of T" for some T
514  // [handled below].
515 
516  // C++ [temp.dep.constexpr]p2:
517  // An id-expression is value-dependent if:
518 
519  // - it is type-dependent [handled above]
520 
521  // - it is the name of a non-type template parameter,
522  if (isa<NonTypeTemplateParmDecl>(Decl))
523  return Deps | ExprDependence::ValueInstantiation;
524 
525  // - it names a potentially-constant variable that is initialized with an
526  // expression that is value-dependent
527  if (const auto *Var = dyn_cast<VarDecl>(Decl)) {
528  if (Var->mightBeUsableInConstantExpressions(Ctx)) {
529  if (const Expr *Init = Var->getAnyInitializer()) {
530  if (Init->isValueDependent())
531  Deps |= ExprDependence::ValueInstantiation;
532  if (Init->containsErrors())
533  Deps |= ExprDependence::Error;
534  }
535  }
536 
537  // - it names a static data member that is a dependent member of the
538  // current instantiation and is not initialized in a member-declarator,
539  if (Var->isStaticDataMember() &&
540  Var->getDeclContext()->isDependentContext() &&
541  !Var->getFirstDecl()->hasInit()) {
542  const VarDecl *First = Var->getFirstDecl();
543  TypeSourceInfo *TInfo = First->getTypeSourceInfo();
544  if (TInfo->getType()->isIncompleteArrayType()) {
545  Deps |= ExprDependence::TypeValueInstantiation;
546  } else if (!First->hasInit()) {
547  Deps |= ExprDependence::ValueInstantiation;
548  }
549  }
550 
551  return Deps;
552  }
553 
554  // - it names a static member function that is a dependent member of the
555  // current instantiation
556  //
557  // FIXME: It's unclear that the restriction to static members here has any
558  // effect: any use of a non-static member function name requires either
559  // forming a pointer-to-member or providing an object parameter, either of
560  // which makes the overall expression value-dependent.
561  if (auto *MD = dyn_cast<CXXMethodDecl>(Decl)) {
562  if (MD->isStatic() && Decl->getDeclContext()->isDependentContext())
563  Deps |= ExprDependence::ValueInstantiation;
564  }
565 
566  return Deps;
567 }
568 
570  // RecoveryExpr is
571  // - always value-dependent, and therefore instantiation dependent
572  // - contains errors (ExprDependence::Error), by definition
573  // - type-dependent if we don't know the type (fallback to an opaque
574  // dependent type), or the type is known and dependent, or it has
575  // type-dependent subexpressions.
577  ExprDependence::ErrorDependent;
578  // FIXME: remove the type-dependent bit from subexpressions, if the
579  // RecoveryExpr has a non-dependent type.
580  for (auto *S : E->subExpressions())
581  D |= S->getDependence();
582  return D;
583 }
584 
588 }
589 
592 }
593 
595  llvm::ArrayRef<Expr *> PreArgs) {
596  auto D = E->getCallee()->getDependence();
597  for (auto *A : llvm::makeArrayRef(E->getArgs(), E->getNumArgs())) {
598  if (A)
599  D |= A->getDependence();
600  }
601  for (auto *A : PreArgs)
602  D |= A->getDependence();
603  return D;
604 }
605 
609  for (unsigned I = 0, N = E->getNumExpressions(); I < N; ++I)
611  return D;
612 }
613 
615  auto *MemberDecl = E->getMemberDecl();
616  auto D = E->getBase()->getDependence();
617  if (FieldDecl *FD = dyn_cast<FieldDecl>(MemberDecl)) {
618  DeclContext *DC = MemberDecl->getDeclContext();
619  // dyn_cast_or_null is used to handle objC variables which do not
620  // have a declaration context.
621  CXXRecordDecl *RD = dyn_cast_or_null<CXXRecordDecl>(DC);
622  if (RD && RD->isDependentContext() && RD->isCurrentInstantiation(DC)) {
623  if (!E->getType()->isDependentType())
624  D &= ~ExprDependence::Type;
625  }
626 
627  // Bitfield with value-dependent width is type-dependent.
628  if (FD && FD->isBitField() && FD->getBitWidth()->isValueDependent()) {
630  }
631  }
632  // FIXME: move remaining dependence computation from MemberExpr::Create()
633  return D;
634 }
635 
637  auto D = ExprDependence::None;
638  for (auto *A : E->inits())
639  D |= A->getDependence();
640  return D;
641 }
642 
645  for (auto *C : llvm::makeArrayRef(E->getSubExprs(), E->getNumSubExprs()))
646  D |= C->getDependence();
647  return D;
648 }
649 
651  bool ContainsUnexpandedPack) {
652  auto D = ContainsUnexpandedPack ? ExprDependence::UnexpandedPack
654  for (auto *AE : E->getAssocExprs())
655  D |= AE->getDependence() & ExprDependence::Error;
657 
658  if (E->isResultDependent())
659  return D | ExprDependence::TypeValueInstantiation;
660  return D | (E->getResultExpr()->getDependence() &
661  ~ExprDependence::UnexpandedPack);
662 }
663 
665  auto Deps = E->getInit()->getDependence();
666  for (auto D : E->designators()) {
667  auto DesignatorDeps = ExprDependence::None;
668  if (D.isArrayDesignator())
669  DesignatorDeps |= E->getArrayIndex(D)->getDependence();
670  else if (D.isArrayRangeDesignator())
671  DesignatorDeps |= E->getArrayRangeStart(D)->getDependence() |
673  Deps |= DesignatorDeps;
674  if (DesignatorDeps & ExprDependence::TypeValue)
675  Deps |= ExprDependence::TypeValueInstantiation;
676  }
677  return Deps;
678 }
679 
681  auto D = O->getSyntacticForm()->getDependence();
682  for (auto *E : O->semantics())
683  D |= E->getDependence();
684  return D;
685 }
686 
688  auto D = ExprDependence::None;
689  for (auto *E : llvm::makeArrayRef(A->getSubExprs(), A->getNumSubExprs()))
690  D |= E->getDependence();
691  return D;
692 }
693 
695  auto D = toExprDependenceAsWritten(
698  auto Size = E->getArraySize();
699  if (Size && *Size)
700  D |= turnTypeToValueDependence((*Size)->getDependence());
701  if (auto *I = E->getInitializer())
702  D |= turnTypeToValueDependence(I->getDependence());
703  for (auto *A : E->placement_arguments())
704  D |= turnTypeToValueDependence(A->getDependence());
705  return D;
706 }
707 
709  auto D = E->getBase()->getDependence();
710  if (auto *TSI = E->getDestroyedTypeInfo())
711  D |= toExprDependenceAsWritten(TSI->getType()->getDependence());
712  if (auto *ST = E->getScopeTypeInfo())
714  toExprDependenceAsWritten(ST->getType()->getDependence()));
715  if (auto *Q = E->getQualifier())
716  D |= toExprDependence(Q->getDependence() &
717  ~NestedNameSpecifierDependence::Dependent);
718  return D;
719 }
720 
722  auto D = ExprDependence::None;
723  if (Name.isInstantiationDependent())
724  D |= ExprDependence::Instantiation;
725  if (Name.containsUnexpandedParameterPack())
726  D |= ExprDependence::UnexpandedPack;
727  return D;
728 }
729 
731 clang::computeDependence(OverloadExpr *E, bool KnownDependent,
732  bool KnownInstantiationDependent,
733  bool KnownContainsUnexpandedParameterPack) {
734  auto Deps = ExprDependence::None;
735  if (KnownDependent)
736  Deps |= ExprDependence::TypeValue;
737  if (KnownInstantiationDependent)
738  Deps |= ExprDependence::Instantiation;
739  if (KnownContainsUnexpandedParameterPack)
740  Deps |= ExprDependence::UnexpandedPack;
741  Deps |= getDependenceInExpr(E->getNameInfo());
742  if (auto *Q = E->getQualifier())
743  Deps |= toExprDependence(Q->getDependence() &
744  ~NestedNameSpecifierDependence::Dependent);
745  for (auto *D : E->decls()) {
746  if (D->getDeclContext()->isDependentContext() ||
747  isa<UnresolvedUsingValueDecl>(D))
748  Deps |= ExprDependence::TypeValueInstantiation;
749  }
750  // If we have explicit template arguments, check for dependent
751  // template arguments and whether they contain any unexpanded pack
752  // expansions.
753  for (auto A : E->template_arguments())
754  Deps |= toExprDependence(A.getArgument().getDependence());
755  return Deps;
756 }
757 
759  auto D = ExprDependence::TypeValue;
760  D |= getDependenceInExpr(E->getNameInfo());
761  if (auto *Q = E->getQualifier())
762  D |= toExprDependence(Q->getDependence());
763  for (auto A : E->template_arguments())
764  D |= toExprDependence(A.getArgument().getDependence());
765  return D;
766 }
767 
769  ExprDependence D =
771  for (auto *A : E->arguments())
772  D |= A->getDependence() & ~ExprDependence::Type;
773  return D;
774 }
775 
777  CXXConstructExpr *BaseE = E;
780  computeDependence(BaseE);
781 }
782 
784  return E->getExpr()->getDependence();
785 }
786 
788  return E->getExpr()->getDependence();
789 }
790 
792  bool ContainsUnexpandedParameterPack) {
794  if (ContainsUnexpandedParameterPack)
795  D |= ExprDependence::UnexpandedPack;
796  return D;
797 }
798 
800  auto D = ExprDependence::ValueInstantiation;
803  for (auto *A : E->arguments())
804  D |= A->getDependence() &
805  (ExprDependence::UnexpandedPack | ExprDependence::Error);
806  return D;
807 }
808 
810  auto D = ExprDependence::TypeValueInstantiation;
811  if (!E->isImplicitAccess())
812  D |= E->getBase()->getDependence();
813  if (auto *Q = E->getQualifier())
814  D |= toExprDependence(Q->getDependence());
816  for (auto A : E->template_arguments())
817  D |= toExprDependence(A.getArgument().getDependence());
818  return D;
819 }
820 
822  return E->getSubExpr()->getDependence();
823 }
824 
826  auto D = ExprDependence::TypeValueInstantiation;
827  for (const auto *C : {E->getLHS(), E->getRHS()}) {
828  if (C)
829  D |= C->getDependence() & ~ExprDependence::UnexpandedPack;
830  }
831  return D;
832 }
833 
835  auto D = ExprDependence::None;
836  for (const auto *A : E->getArgs())
837  D |= toExprDependenceAsWritten(A->getType()->getDependence()) &
839  return D;
840 }
841 
843  bool ValueDependent) {
845  const auto InterestingDeps = TemplateArgumentDependence::Instantiation |
846  TemplateArgumentDependence::UnexpandedPack;
847  for (const TemplateArgumentLoc &ArgLoc :
849  TA |= ArgLoc.getArgument().getDependence() & InterestingDeps;
850  if (TA == InterestingDeps)
851  break;
852  }
853 
854  ExprDependence D =
855  ValueDependent ? ExprDependence::Value : ExprDependence::None;
856  auto Res = D | toExprDependence(TA);
857  if(!ValueDependent && E->getSatisfaction().ContainsErrors)
858  Res |= ExprDependence::Error;
859  return Res;
860 }
861 
863  auto D = ExprDependence::None;
864  Expr **Elements = E->getElements();
865  for (unsigned I = 0, N = E->getNumElements(); I != N; ++I)
866  D |= turnTypeToValueDependence(Elements[I]->getDependence());
867  return D;
868 }
869 
871  auto Deps = ExprDependence::None;
872  for (unsigned I = 0, N = E->getNumElements(); I < N; ++I) {
873  auto KV = E->getKeyValueElement(I);
874  auto KVDeps = turnTypeToValueDependence(KV.Key->getDependence() |
875  KV.Value->getDependence());
876  if (KV.EllipsisLoc.isValid())
877  KVDeps &= ~ExprDependence::UnexpandedPack;
878  Deps |= KVDeps;
879  }
880  return Deps;
881 }
882 
884  auto D = ExprDependence::None;
885  if (auto *R = E->getInstanceReceiver())
886  D |= R->getDependence();
887  else
889  for (auto *A : E->arguments())
890  D |= A->getDependence();
891  return D;
892 }
clang::OMPIteratorExpr::numOfIterators
unsigned numOfIterators() const
Returns number of iterator definitions.
Definition: ExprOpenMP.h:399
clang::ObjCPropertyRefExpr::getBase
const Expr * getBase() const
Definition: ExprObjC.h:752
clang::PackExpansionExpr::getPattern
Expr * getPattern()
Retrieve the pattern of the pack expansion.
Definition: ExprCXX.h:4097
clang::ExpressionTraitExpr
An expression trait intrinsic.
Definition: ExprCXX.h:2840
clang::OMPIteratorExpr
OpenMP 5.0 [2.1.6 Iterators] Iterators are identifiers that expand to multiple values in the clause o...
Definition: ExprOpenMP.h:272
clang::MatrixSubscriptExpr
MatrixSubscriptExpr - Matrix subscript expression for the MatrixType extension.
Definition: Expr.h:2731
clang::SubstNonTypeTemplateParmExpr
Represents a reference to a non-type template parameter that has been substituted with a template arg...
Definition: ExprCXX.h:4262
clang::Expr::getDependence
ExprDependence getDependence() const
Definition: Expr.h:155
clang::VAArgExpr::getWrittenTypeInfo
TypeSourceInfo * getWrittenTypeInfo() const
Definition: Expr.h:4661
clang::CompoundStmt::getStmtExprResult
Stmt * getStmtExprResult()
Definition: Stmt.h:1523
clang::AtomicExpr
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load,...
Definition: Expr.h:6238
clang::ObjCPropertyRefExpr::isObjectReceiver
bool isObjectReceiver() const
Definition: ExprObjC.h:771
clang::ArrayTypeTraitExpr
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent.
Definition: ExprCXX.h:2770
clang::CXXUnresolvedConstructExpr::arguments
arg_range arguments()
Definition: ExprCXX.h:3510
clang::ObjCBoxedExpr
ObjCBoxedExpr - used for generalized expression boxing.
Definition: ExprObjC.h:128
clang::ASTConstraintSatisfaction::ContainsErrors
bool ContainsErrors
Definition: ASTConcept.h:82
clang::AsTypeExpr
AsTypeExpr - Clang builtin function __builtin_astype [OpenCL 6.2.4.2] This AST node provides support ...
Definition: Expr.h:6035
clang::OffsetOfExpr
OffsetOfExpr - [C99 7.17] - This represents an expression of the form offsetof(record-type,...
Definition: Expr.h:2452
clang::CXXPseudoDestructorExpr
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
Definition: ExprCXX.h:2534
clang::TypeSourceInfo::getType
QualType getType() const
Return the type wrapped by this type source info.
Definition: Type.h:6657
clang::VAArgExpr::getSubExpr
const Expr * getSubExpr() const
Definition: Expr.h:4653
clang::CXXScalarValueInitExpr::getTypeSourceInfo
TypeSourceInfo * getTypeSourceInfo() const
Definition: ExprCXX.h:2112
clang::ObjCDictionaryLiteral::getNumElements
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c dictionary literal.
Definition: ExprObjC.h:360
clang::MatrixSubscriptExpr::getBase
Expr * getBase()
Definition: Expr.h:2757
clang::CXXDefaultArgExpr::getExpr
const Expr * getExpr() const
Definition: ExprCXX.h:1280
Error
llvm::Error Error
Definition: ByteCodeEmitter.cpp:20
clang::BinaryConditionalOperator::getCommon
Expr * getCommon() const
getCommon - Return the common expression, written to the left of the condition.
Definition: Expr.h:4246
clang::DeclContext
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Definition: DeclBase.h:1389
clang::OffsetOfExpr::getIndexExpr
Expr * getIndexExpr(unsigned Idx)
Definition: Expr.h:2515
clang::ObjCArrayLiteral::getNumElements
unsigned getNumElements() const
getNumElements - Return number of elements of objective-c array literal.
Definition: ExprObjC.h:229
clang::DeclRefExpr::getQualifier
NestedNameSpecifier * getQualifier() const
If the name was qualified, retrieves the nested-name-specifier that precedes the name.
Definition: Expr.h:1330
clang::ConditionalOperator::getLHS
Expr * getLHS() const
Definition: Expr.h:4183
Diag
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.
Definition: LiteralSupport.cpp:79
DependenceFlags.h
clang::DesignatedInitExpr
Represents a C99 designated initializer expression.
Definition: Expr.h:5033
llvm::SmallVector
Definition: LLVM.h:38
clang::MSPropertyRefExpr::getBaseExpr
Expr * getBaseExpr() const
Definition: ExprCXX.h:976
clang::OMPIteratorExpr::getIteratorRange
IteratorRange getIteratorRange(unsigned I)
Gets the iterator range for the given iterator.
Definition: Expr.cpp:5014
clang::MSPropertyRefExpr
A member reference to an MSPropertyDecl.
Definition: ExprCXX.h:923
clang::MaterializeTemporaryExpr::getSubExpr
Expr * getSubExpr() const
Retrieve the temporary-generating subexpression whose value will be materialized into a glvalue.
Definition: ExprCXX.h:4496
clang::AsTypeExpr::getSrcExpr
Expr * getSrcExpr() const
getSrcExpr - Return the Expr to be converted.
Definition: Expr.h:6054
clang::ParenListExpr
Definition: Expr.h:5541
clang::CastExpr::getSubExpr
Expr * getSubExpr()
Definition: Expr.h:3529
clang::NoInitExpr
Represents a place-holder for an object not to be initialized by anything.
Definition: Expr.h:5334
clang::CXXRewrittenBinaryOperator::getSemanticForm
Expr * getSemanticForm()
Get an equivalent semantic form for this expression.
Definition: ExprCXX.h:302
clang::CXXBindTemporaryExpr::getSubExpr
const Expr * getSubExpr() const
Definition: ExprCXX.h:1434
clang::QualType
A (possibly-)qualified type.
Definition: Type.h:737
Attr.h
clang::CompoundLiteralExpr::getTypeSourceInfo
TypeSourceInfo * getTypeSourceInfo() const
Definition: Expr.h:3442
clang::TypeTraitExpr
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
Definition: ExprCXX.h:2682
clang::CXXTypeidExpr
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
Definition: ExprCXX.h:839
clang::FieldDecl
Represents a member of a struct/union/class.
Definition: Decl.h:2903
DeclCXX.h
clang::ObjCMessageExpr::arguments
llvm::iterator_range< arg_iterator > arguments()
Definition: ExprObjC.h:1453
clang::CXXNewExpr
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)".
Definition: ExprCXX.h:2139
clang::RecoveryExpr
Frontend produces RecoveryExprs on semantic errors that prevent creating other well-formed expression...
Definition: Expr.h:6425
clang::StmtExpr::getSubStmt
CompoundStmt * getSubStmt()
Definition: Expr.h:4370
clang::InitListExpr
Describes an C or C++ initializer list.
Definition: Expr.h:4795
clang::ObjCMessageExpr::getInstanceReceiver
Expr * getInstanceReceiver()
Returns the object expression (receiver) for an instance message, or null for a message that is not a...
Definition: ExprObjC.h:1250
clang::CoroutineSuspendExpr::getCommonExpr
Expr * getCommonExpr() const
Definition: ExprCXX.h:4742
clang::ComparisonCategoryType::First
@ First
clang::toExprDependence
ExprDependence toExprDependence(TemplateArgumentDependence TA)
Computes dependencies of a reference with the name having template arguments with TA dependencies.
Definition: DependenceFlags.h:247
clang::UnaryOperator
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
Definition: Expr.h:2171
clang::OffsetOfExpr::getNumExpressions
unsigned getNumExpressions() const
Definition: Expr.h:2530
clang::ObjCPropertyRefExpr::isSuperReceiver
bool isSuperReceiver() const
Definition: ExprObjC.h:772
ExprOpenMP.h
clang::ArrayInitLoopExpr
Represents a loop initializing the elements of an array.
Definition: Expr.h:5425
clang::UnaryExprOrTypeTraitExpr::getArgumentExpr
Expr * getArgumentExpr()
Definition: Expr.h:2607
clang::GenericSelectionExpr::getControllingExpr
Expr * getControllingExpr()
Return the controlling expression of this generic selection expression.
Definition: Expr.h:5813
clang::AtomicExpr::getSubExprs
Expr ** getSubExprs()
Definition: Expr.h:6305
clang::CXXNewExpr::getAllocatedType
QualType getAllocatedType() const
Definition: ExprCXX.h:2232
clang::ShuffleVectorExpr::getSubExprs
Expr ** getSubExprs()
Retrieve the array of expressions.
Definition: Expr.h:4438
clang::DesignatedInitExpr::getArrayRangeEnd
Expr * getArrayRangeEnd(const Designator &D) const
Definition: Expr.cpp:4483
clang::DependentScopeDeclRefExpr::getQualifier
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies this declaration.
Definition: ExprCXX.h:3264
clang::CXXTypeidExpr::getExprOperand
Expr * getExprOperand() const
Definition: ExprCXX.h:886
End
SourceLocation End
Definition: USRLocFinder.cpp:167
clang::ExprDependenceScope::ExprDependence
ExprDependence
Definition: DependenceFlags.h:17
clang::ASTTemplateArgumentListInfo::arguments
llvm::ArrayRef< TemplateArgumentLoc > arguments() const
Definition: TemplateBase.h:643
clang::OpaqueValueExpr
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class.
Definition: Expr.h:1143
clang::CXXPseudoDestructorExpr::getScopeTypeInfo
TypeSourceInfo * getScopeTypeInfo() const
Retrieve the scope type in a qualified pseudo-destructor expression.
Definition: ExprCXX.h:2611
clang::Type
The base class of the type hierarchy.
Definition: Type.h:1565
clang::CXXFoldExpr
Represents a folding of a pack over an operator.
Definition: ExprCXX.h:4591
clang::ObjCSubscriptRefExpr
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
Definition: ExprObjC.h:841
clang::ObjCIndirectCopyRestoreExpr
ObjCIndirectCopyRestoreExpr - Represents the passing of a function argument by indirect copy-restore ...
Definition: ExprObjC.h:1566
clang::ConditionalOperator
ConditionalOperator - The ?: ternary operator.
Definition: Expr.h:4149
clang::CXXUuidofExpr::getTypeOperandSourceInfo
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
Definition: ExprCXX.h:1093
clang::CXXThrowExpr
A C++ throw-expression (C++ [except.throw]).
Definition: ExprCXX.h:1181
clang::FullExpr
FullExpr - Represents a "full-expression" node.
Definition: Expr.h:1012
clang::ObjCArrayLiteral
ObjCArrayLiteral - used for objective-c array containers; as in: @["Hello", NSApp,...
Definition: ExprObjC.h:190
clang::ObjCPropertyRefExpr
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
Definition: ExprObjC.h:614
clang::CXXTemporaryObjectExpr
Represents a C++ functional cast expression that builds a temporary object.
Definition: ExprCXX.h:1797
clang::DependentScopeDeclRefExpr::template_arguments
ArrayRef< TemplateArgumentLoc > template_arguments() const
Definition: ExprCXX.h:3320
clang::DependentCoawaitExpr::getOperand
Expr * getOperand() const
Definition: ExprCXX.h:4844
ExprConcepts.h
clang::CallExpr::getCallee
Expr * getCallee()
Definition: Expr.h:2959
clang::ConceptReference::getTemplateArgsAsWritten
const ASTTemplateArgumentListInfo * getTemplateArgsAsWritten() const
Definition: ASTConcept.h:158
clang::UnaryExprOrTypeTraitExpr
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand.
Definition: Expr.h:2557
clang::Expr::isTypeDependent
bool isTypeDependent() const
Determines whether the type of this expression depends on.
Definition: Expr.h:185
clang::OverloadExpr::getNameInfo
const DeclarationNameInfo & getNameInfo() const
Gets the full name info.
Definition: ExprCXX.h:3003
clang::ConvertVectorExpr
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
Definition: Expr.h:4469
clang::MSPropertySubscriptExpr
MS property subscript expression.
Definition: ExprCXX.h:994
clang::ChooseExpr::isConditionDependent
bool isConditionDependent() const
Definition: Expr.h:4558
clang::CXXConstructExpr::arguments
arg_range arguments()
Definition: ExprCXX.h:1592
clang::CXXRewrittenBinaryOperator
A rewritten comparison expression that was originally written using operator syntax.
Definition: ExprCXX.h:284
clang::DependentCoawaitExpr
Represents a 'co_await' expression while the type of the promise is dependent.
Definition: ExprCXX.h:4821
clang::CXXBindTemporaryExpr
Represents binding an expression to a temporary.
Definition: ExprCXX.h:1412
clang::Decl::specific_attrs
llvm::iterator_range< specific_attr_iterator< T > > specific_attrs() const
Definition: DeclBase.h:542
clang::OverloadExpr::decls
llvm::iterator_range< decls_iterator > decls() const
Definition: ExprCXX.h:2995
clang::CXXRecordDecl::isCurrentInstantiation
bool isCurrentInstantiation(const DeclContext *CurContext) const
Determine whether this dependent class is a current instantiation, when viewed from within the given ...
Definition: CXXInheritance.cpp:116
clang::ParenExpr::getSubExpr
const Expr * getSubExpr() const
Definition: Expr.h:2135
clang::BinaryOperator
A builtin binary operation expression such as "x + y" or "x <= y".
Definition: Expr.h:3811
ExceptionSpecificationType.h
clang::CXXNewExpr::getInitializer
Expr * getInitializer()
The initializer of this new-expression.
Definition: ExprCXX.h:2331
clang::ConvertVectorExpr::getTypeSourceInfo
TypeSourceInfo * getTypeSourceInfo() const
getTypeSourceInfo - Return the destination type.
Definition: Expr.h:4492
clang::XRayInstrKind::None
constexpr XRayInstrMask None
Definition: XRayInstr.h:38
clang::LambdaExpr
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
Definition: ExprCXX.h:1865
clang::CanThrowResult
CanThrowResult
Possible results from evaluation of a noexcept expression.
Definition: ExceptionSpecificationType.h:54
clang::CallExpr::getArgs
Expr ** getArgs()
Retrieve the call arguments.
Definition: Expr.h:2990
clang::SubstNonTypeTemplateParmExpr::getReplacement
Expr * getReplacement() const
Definition: ExprCXX.h:4294
clang::MSPropertySubscriptExpr::getIdx
Expr * getIdx()
Definition: ExprCXX.h:1022
clang::ObjCSubscriptRefExpr::getKeyExpr
Expr * getKeyExpr() const
Definition: ExprObjC.h:883
clang::CXXDependentScopeMemberExpr::template_arguments
ArrayRef< TemplateArgumentLoc > template_arguments() const
Definition: ExprCXX.h:3776
clang::ObjCSubscriptRefExpr::getBaseExpr
Expr * getBaseExpr() const
Definition: ExprObjC.h:880
clang::CT_Dependent
@ CT_Dependent
Definition: ExceptionSpecificationType.h:56
clang::BlockExpr::getBlockDecl
const BlockDecl * getBlockDecl() const
Definition: Expr.h:5986
clang::MatrixSubscriptExpr::getRowIdx
Expr * getRowIdx()
Definition: Expr.h:2761
clang::CXXFoldExpr::getLHS
Expr * getLHS() const
Definition: ExprCXX.h:4625
clang::OMPIteratorExpr::IteratorRange::Begin
Expr * Begin
Definition: ExprOpenMP.h:279
clang::ConceptSpecializationExpr
Represents the specialization of a concept - evaluates to a prvalue of type bool.
Definition: ExprConcepts.h:40
clang::MaterializeTemporaryExpr
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
Definition: ExprCXX.h:4479
clang::ASTContext
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:209
clang::ObjCDictionaryLiteral
ObjCDictionaryLiteral - AST node to represent objective-c dictionary literals; as in:"name" : NSUserN...
Definition: ExprObjC.h:306
clang::OffsetOfExpr::getTypeSourceInfo
TypeSourceInfo * getTypeSourceInfo() const
Definition: Expr.h:2494
clang::CXXUuidofExpr::getExprOperand
Expr * getExprOperand() const
Definition: ExprCXX.h:1097
clang::turnTypeToValueDependence
ExprDependence turnTypeToValueDependence(ExprDependence D)
Definition: DependenceFlags.h:262
clang::PseudoObjectExpr
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
Definition: Expr.h:6104
clang::OMPIteratorExpr::getIteratorDecl
Decl * getIteratorDecl(unsigned I)
Gets the iterator declaration for the given iterator.
Definition: Expr.cpp:5010
clang::ConditionalOperator::getRHS
Expr * getRHS() const
Definition: Expr.h:4184
clang::Expr::EvaluateAsConstantExpr
bool EvaluateAsConstantExpr(EvalResult &Result, const ASTContext &Ctx, ConstantExprKind Kind=ConstantExprKind::Normal) const
Evaluate an expression that is required to be a constant expression.
Definition: ExprConstant.cpp:15155
clang::DeclRefExpr::getNumTemplateArgs
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition: Expr.h:1404
clang::BinaryConditionalOperator
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
Definition: Expr.h:4211
clang::CXXPseudoDestructorExpr::getQualifier
NestedNameSpecifier * getQualifier() const
If the member name was qualified, retrieves the nested-name-specifier that precedes the member name.
Definition: ExprCXX.h:2591
clang::ArrayTypeTraitExpr::getQueriedType
QualType getQueriedType() const
Definition: ExprCXX.h:2811
clang::ValueStmt::getExprStmt
const Expr * getExprStmt() const
Definition: Stmt.cpp:402
clang::DeclRefExpr::getDecl
ValueDecl * getDecl()
Definition: Expr.h:1303
clang::TemplateArgumentLoc
Location wrapper for a TemplateArgument.
Definition: TemplateBase.h:457
clang::CXXStdInitializerListExpr::getSubExpr
Expr * getSubExpr()
Definition: ExprCXX.h:807
Expr.h
clang::Expr::EvalResult
EvalResult is a struct with detailed info about an evaluated expression.
Definition: Expr.h:620
clang::ImplicitValueInitExpr
Represents an implicitly-generated value initialization of an object of a given type.
Definition: Expr.h:5514
clang::OpaqueValueExpr::getSourceExpr
Expr * getSourceExpr() const
The source expression of an opaque value expression is the expression which originally generated the ...
Definition: Expr.h:1193
clang::VarDecl
Represents a variable declaration or definition.
Definition: Decl.h:879
clang::OMPArraySectionExpr::getLowerBound
Expr * getLowerBound()
Get lower bound of array section.
Definition: ExprOpenMP.h:94
ComputeDependence.h
clang::ShuffleVectorExpr::getNumSubExprs
unsigned getNumSubExprs() const
getNumSubExprs - Return the size of the SubExprs array.
Definition: Expr.h:4435
clang::TypeTraitExpr::getArgs
ArrayRef< TypeSourceInfo * > getArgs() const
Retrieve the argument types.
Definition: ExprCXX.h:2740
ExprObjC.h
ExprCXX.h
clang::ObjCEncodeExpr
ObjCEncodeExpr, used for @encode in Objective-C.
Definition: ExprObjC.h:409
clang::OverloadExpr::template_arguments
ArrayRef< TemplateArgumentLoc > template_arguments() const
Definition: ExprCXX.h:3063
clang::CXXDefaultArgExpr
A default argument (C++ [dcl.fct.default]).
Definition: ExprCXX.h:1241
clang::InitListExpr::inits
ArrayRef< Expr * > inits()
Definition: Expr.h:4835
clang::PackExpansionExpr
Represents a C++11 pack expansion that produces a sequence of expressions.
Definition: ExprCXX.h:4068
clang::ArraySubscriptExpr::getLHS
Expr * getLHS()
An array access can be written A[4] or 4[A] (both are equivalent).
Definition: Expr.h:2682
clang::computeDependence
ExprDependence computeDependence(FullExpr *E)
Definition: ComputeDependence.cpp:24
clang::CXXNewExpr::getAllocatedTypeSourceInfo
TypeSourceInfo * getAllocatedTypeSourceInfo() const
Definition: ExprCXX.h:2236
clang::ArraySubscriptExpr::getRHS
Expr * getRHS()
Definition: Expr.h:2686
clang::ObjCMessageExpr
An expression that sends a message to the given Objective-C object or class.
Definition: ExprObjC.h:940
clang::MemberExpr::getMemberDecl
ValueDecl * getMemberDecl() const
Retrieve the member declaration to which this expression refers.
Definition: Expr.h:3251
clang::ChooseExpr
ChooseExpr - GNU builtin-in function __builtin_choose_expr.
Definition: Expr.h:4528
clang::CXXFoldExpr::getRHS
Expr * getRHS() const
Definition: ExprCXX.h:4626
clang::ExpressionTraitExpr::getQueriedExpression
Expr * getQueriedExpression() const
Definition: ExprCXX.h:2877
clang::OMPArraySectionExpr::getLength
Expr * getLength()
Get length of array section.
Definition: ExprOpenMP.h:102
clang::OMPArrayShapingExpr
An explicit cast in C or a C-style cast in C++, which uses the syntax ([s1][s2]......
Definition: ExprOpenMP.h:146
clang::GenericSelectionExpr::isResultDependent
bool isResultDependent() const
Whether this generic selection is result-dependent.
Definition: Expr.h:5810
clang::FullExpr::getSubExpr
const Expr * getSubExpr() const
Definition: Expr.h:1025
clang::DeclarationName::CXXConversionFunctionName
@ CXXConversionFunctionName
Definition: DeclarationName.h:214
clang::CompoundLiteralExpr
CompoundLiteralExpr - [C99 6.5.2.5].
Definition: Expr.h:3409
clang::ObjCDictionaryLiteral::getKeyValueElement
ObjCDictionaryElement getKeyValueElement(unsigned Index) const
Definition: ExprObjC.h:362
clang::DesignatedInitExpr::designators
llvm::MutableArrayRef< Designator > designators()
Definition: Expr.h:5239
clang::UnaryExprOrTypeTraitExpr::isArgumentType
bool isArgumentType() const
Definition: Expr.h:2599
clang::MemberExpr::getBase
Expr * getBase() const
Definition: Expr.h:3245
clang::CXXDependentScopeMemberExpr::getBase
Expr * getBase() const
Retrieve the base object of this member expressions, e.g., the x in x.m.
Definition: ExprCXX.h:3665
clang::CXXRecordDecl
Represents a C++ struct/union/class.
Definition: DeclCXX.h:254
clang::ObjCPropertyRefExpr::isClassReceiver
bool isClassReceiver() const
Definition: ExprObjC.h:773
clang::RISCV::TA
@ TA
Definition: RISCVVIntrinsicUtils.h:96
P
StringRef P
Definition: ASTMatchersInternal.cpp:563
clang::Type::isDependentType
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
Definition: Type.h:2298
clang::Type::isInstantiationDependentType
bool isInstantiationDependentType() const
Determine whether this type is an instantiation-dependent type, meaning that the type involves a temp...
Definition: Type.h:2306
clang::ExtVectorElementExpr::getBase
const Expr * getBase() const
Definition: Expr.h:5931
clang::UnaryExprOrTypeTraitExpr::getArgumentType
QualType getArgumentType() const
Definition: Expr.h:2600
clang::PseudoObjectExpr::getSyntacticForm
Expr * getSyntacticForm()
Return the syntactic form of this expression, i.e.
Definition: Expr.h:6148
clang::ObjCEncodeExpr::getEncodedType
QualType getEncodedType() const
Definition: ExprObjC.h:428
clang::OMPIteratorExpr::IteratorRange
Iterator range representation begin:end[:step].
Definition: ExprOpenMP.h:278
clang::OMPIteratorExpr::IteratorRange::Step
Expr * Step
Definition: ExprOpenMP.h:281
clang::CXXDependentScopeMemberExpr::getMemberNameInfo
const DeclarationNameInfo & getMemberNameInfo() const
Retrieve the name of the member that this expression refers to.
Definition: ExprCXX.h:3708
clang::PseudoObjectExpr::semantics
llvm::iterator_range< semantics_iterator > semantics()
Definition: Expr.h:6185
clang::ValueDecl
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Definition: Decl.h:674
clang::OMPArraySectionExpr::getBase
Expr * getBase()
An array section can be written only as Base[LowerBound:Length].
Definition: ExprOpenMP.h:85
clang::CXXDefaultInitExpr::getExpr
const Expr * getExpr() const
Get the initialization expression that will be used.
Definition: ExprCXX.h:1346
clang::BinaryOperator::getLHS
Expr * getLHS() const
Definition: Expr.h:3860
clang::ParenExpr
ParenExpr - This represents a parethesized expression, e.g.
Definition: Expr.h:2120
clang::CallExpr::getNumArgs
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
Definition: Expr.h:2987
clang::Type::isIncompleteArrayType
bool isIncompleteArrayType() const
Definition: Type.h:7010
clang::OMPArrayShapingExpr::getBase
Expr * getBase()
Fetches base expression of array shaping expression.
Definition: ExprOpenMP.h:214
clang::CXXDeleteExpr
Represents a delete expression for memory deallocation and destructor calls, e.g.
Definition: ExprCXX.h:2415
clang::BlockExpr
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Definition: Expr.h:5974
llvm::ArrayRef
Definition: LLVM.h:34
clang::StmtExpr
StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).
Definition: Expr.h:4353
Value
Value
Definition: UninitializedValues.cpp:102
clang::Decl
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:83
clang::CXXTypeidExpr::isTypeOperand
bool isTypeOperand() const
Definition: ExprCXX.h:875
clang::CoroutineSuspendExpr::getResumeExpr
Expr * getResumeExpr() const
Definition: ExprCXX.h:4757
clang::toExprDependenceForImpliedType
ExprDependence toExprDependenceForImpliedType(TypeDependence D)
Definition: DependenceFlags.h:250
clang::ArraySubscriptExpr
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
Definition: Expr.h:2653
clang::CXXUuidofExpr
A Microsoft C++ __uuidof expression, which gets the _GUID that corresponds to the supplied type or ex...
Definition: ExprCXX.h:1056
clang::DependentScopeDeclRefExpr
A qualified reference to a name whose declaration cannot yet be resolved.
Definition: ExprCXX.h:3208
clang::ConvertVectorExpr::getSrcExpr
Expr * getSrcExpr() const
getSrcExpr - Return the Expr to be converted.
Definition: Expr.h:4489
clang::CXXThrowExpr::getSubExpr
const Expr * getSubExpr() const
Definition: ExprCXX.h:1201
clang::ArrayInitLoopExpr::getSubExpr
Expr * getSubExpr() const
Get the initializer to use for each array element.
Definition: Expr.h:5445
clang::OverloadExpr
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr.
Definition: ExprCXX.h:2897
clang::GenericSelectionExpr::getAssocExprs
ArrayRef< Expr * > getAssocExprs() const
Definition: Expr.h:5831
clang::CXXDependentScopeMemberExpr
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition: ExprCXX.h:3567
clang::ChooseExpr::getCond
Expr * getCond() const
Definition: Expr.h:4568
clang::CXXDependentScopeMemberExpr::isImplicitAccess
bool isImplicitAccess() const
True if this is an implicit access, i.e.
Definition: ExprCXX.h:3657
clang::CXXTypeidExpr::getTypeOperandSourceInfo
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
Definition: ExprCXX.h:882
clang::CXXNoexceptExpr
Represents a C++11 noexcept expression (C++ [expr.unary.noexcept]).
Definition: ExprCXX.h:4014
clang::CXXUnresolvedConstructExpr
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
Definition: ExprCXX.h:3445
clang::CXXPseudoDestructorExpr::getDestroyedTypeInfo
TypeSourceInfo * getDestroyedTypeInfo() const
Retrieve the source location information for the type being destroyed.
Definition: ExprCXX.h:2627
clang::BinaryConditionalOperator::getFalseExpr
Expr * getFalseExpr() const
getFalseExpr - Return the subexpression which will be evaluated if the condnition evaluates to false;...
Definition: Expr.h:4265
clang::ChooseExpr::getLHS
Expr * getLHS() const
Definition: Expr.h:4570
clang::CXXThisExpr
Represents the this expression in C++.
Definition: ExprCXX.h:1142
clang::ExtVectorElementExpr
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
Definition: Expr.h:5914
DeclarationName.h
clang::PredefinedExpr
[C99 6.4.2.2] - A predefined identifier such as func.
Definition: Expr.h:1967
clang::CXXDependentScopeMemberExpr::getQualifier
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the member name.
Definition: ExprCXX.h:3682
clang::turnValueToTypeDependence
ExprDependence turnValueToTypeDependence(ExprDependence D)
Definition: DependenceFlags.h:267
clang::OMPArrayShapingExpr::getDimensions
ArrayRef< Expr * > getDimensions() const
Fetches the dimensions for array shaping expression.
Definition: ExprOpenMP.h:204
clang::UnaryExprOrTypeTraitExpr::getKind
UnaryExprOrTypeTrait getKind() const
Definition: Expr.h:2589
getDependenceInExpr
static ExprDependence getDependenceInExpr(DeclarationNameInfo Name)
Definition: ComputeDependence.cpp:721
clang::CompoundLiteralExpr::getInitializer
const Expr * getInitializer() const
Definition: Expr.h:3432
clang::Decl::isParameterPack
bool isParameterPack() const
Whether this declaration is a parameter pack.
Definition: DeclBase.cpp:220
clang::ChooseExpr::isConditionTrue
bool isConditionTrue() const
isConditionTrue - Return whether the condition is true (i.e.
Definition: Expr.h:4551
clang::UnaryOperator::getSubExpr
Expr * getSubExpr() const
Definition: Expr.h:2218
clang::OMPArraySectionExpr
OpenMP 5.0 [2.1.5, Array Sections].
Definition: ExprOpenMP.h:56
clang::Expr::IgnoreParens
Expr * IgnoreParens() LLVM_READONLY
Skip past any parentheses which might surround this expression until reaching a fixed point.
Definition: Expr.cpp:3020
clang
Definition: CalledOnceCheck.h:17
clang::ConceptSpecializationExpr::getSatisfaction
const ASTConstraintSatisfaction & getSatisfaction() const
Get elaborated satisfaction info about the template arguments' satisfaction of the named concept.
Definition: ExprConcepts.h:114
clang::UnaryOperator::getOpcode
Opcode getOpcode() const
Definition: Expr.h:2213
clang::BinaryOperator::getRHS
Expr * getRHS() const
Definition: Expr.h:3862
clang::CXXTemporaryObjectExpr::getTypeSourceInfo
TypeSourceInfo * getTypeSourceInfo() const
Definition: ExprCXX.h:1826
clang::MatrixSubscriptExpr::getColumnIdx
Expr * getColumnIdx()
Definition: Expr.h:2765
clang::GenericSelectionExpr::getResultExpr
Expr * getResultExpr()
Return the result expression of this controlling expression.
Definition: Expr.h:5822
clang::ConditionalOperator::getCond
Expr * getCond() const
Definition: Expr.h:4172
clang::CXXNewExpr::placement_arguments
llvm::iterator_range< arg_iterator > placement_arguments()
Definition: ExprCXX.h:2361
clang::GenericSelectionExpr
Represents a C11 generic selection.
Definition: Expr.h:5632
clang::CXXScalarValueInitExpr
An expression "T()" which creates a value-initialized rvalue of type T, which is a non-class type.
Definition: ExprCXX.h:2093
clang::ChooseExpr::getRHS
Expr * getRHS() const
Definition: Expr.h:4572
clang::ObjCIsaExpr
ObjCIsaExpr - Represent X->isa and X.isa when X is an ObjC 'id' type.
Definition: ExprObjC.h:1482
clang::Expr::getType
QualType getType() const
Definition: Expr.h:141
clang::TypeSourceInfo
A container of type source information.
Definition: Type.h:6646
clang::CXXUuidofExpr::isTypeOperand
bool isTypeOperand() const
Definition: ExprCXX.h:1086
clang::OverloadExpr::getQualifier
NestedNameSpecifier * getQualifier() const
Fetches the nested-name qualifier, if one was given.
Definition: ExprCXX.h:3012
clang::DeclContext::isDependentContext
bool isDependentContext() const
Determines whether this context is dependent on a template parameter.
Definition: DeclBase.cpp:1173
clang::CXXPseudoDestructorExpr::getBase
Expr * getBase() const
Definition: ExprCXX.h:2577
clang::CXXDeleteExpr::getArgument
Expr * getArgument()
Definition: ExprCXX.h:2456
clang::RecoveryExpr::subExpressions
ArrayRef< Expr * > subExpressions()
Definition: Expr.h:6433
clang::DependentScopeDeclRefExpr::getNameInfo
const DeclarationNameInfo & getNameInfo() const
Retrieve the name that this expression refers to.
Definition: ExprCXX.h:3248
clang::SYCLUniqueStableNameExpr::getTypeSourceInfo
TypeSourceInfo * getTypeSourceInfo()
Definition: Expr.h:2081
clang::ObjCArrayLiteral::getElements
Expr ** getElements()
Retrieve elements of array of literals.
Definition: ExprObjC.h:221
clang::DesignatedInitExpr::getInit
Expr * getInit() const
Retrieve the initializer value.
Definition: Expr.h:5274
clang::ImplicitCastExpr
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition: Expr.h:3623
clang::VAArgExpr
Represents a call to the builtin function __builtin_va_arg.
Definition: Expr.h:4637
clang::MemberExpr
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Definition: Expr.h:3168
clang::DeclRefExpr::getTemplateArgs
const TemplateArgumentLoc * getTemplateArgs() const
Retrieve the template arguments provided as part of this template-id.
Definition: Expr.h:1396
clang::Type::getDependence
TypeDependence getDependence() const
Definition: Type.h:2287
clang::AtomicExpr::getNumSubExprs
static unsigned getNumSubExprs(AtomicOp Op)
Determine the number of arguments the specified atomic builtin should have.
Definition: Expr.cpp:4787
clang::ObjCIvarRefExpr::getBase
const Expr * getBase() const
Definition: ExprObjC.h:580
clang::CXXStdInitializerListExpr
Implicit construction of a std::initializer_list<T> object from an array temporary within list-initia...
Definition: ExprCXX.h:791
clang::CXXNewExpr::getArraySize
Optional< Expr * > getArraySize()
This might return None even if isArray() returns true, since there might not be an array size express...
Definition: ExprCXX.h:2267
clang::toExprDependenceAsWritten
ExprDependence toExprDependenceAsWritten(TypeDependence D)
Definition: DependenceFlags.h:253
clang::Expr
This represents one expression.
Definition: Expr.h:109
clang::CXXDefaultInitExpr
A use of a default initializer in a constructor or in aggregate initialization.
Definition: ExprCXX.h:1318
clang::ObjCPropertyRefExpr::getSuperReceiverType
QualType getSuperReceiverType() const
Definition: ExprObjC.h:763
clang::OMPIteratorExpr::IteratorRange::End
Expr * End
Definition: ExprOpenMP.h:280
clang::DeclarationNameInfo
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
Definition: DeclarationName.h:767
clang::ObjCBoxedExpr::getSubExpr
Expr * getSubExpr()
Definition: ExprObjC.h:144
clang::ArrayTypeTraitExpr::getDimensionExpression
Expr * getDimensionExpression() const
Definition: ExprCXX.h:2817
clang::DeclRefExpr
A reference to a declared variable, function, enum, etc.
Definition: Expr.h:1231
clang::CXXNoexceptExpr::getOperand
Expr * getOperand() const
Definition: ExprCXX.h:4031
clang::CallExpr
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition: Expr.h:2809
clang::ShuffleVectorExpr
ShuffleVectorExpr - clang-specific builtin-in function __builtin_shufflevector.
Definition: Expr.h:4401
clang::DesignatedInitExpr::getArrayRangeStart
Expr * getArrayRangeStart(const Designator &D) const
Definition: Expr.cpp:4477
clang::ObjCIsaExpr::getBase
Expr * getBase() const
Definition: ExprObjC.h:1507
clang::CXXConstructExpr
Represents a call to a C++ constructor.
Definition: ExprCXX.h:1460
clang::ObjCIvarRefExpr
ObjCIvarRefExpr - A reference to an ObjC instance variable.
Definition: ExprObjC.h:548
clang::ASTContext::getLangOpts
const LangOptions & getLangOpts() const
Definition: ASTContext.h:791
clang::ObjCIndirectCopyRestoreExpr::getSubExpr
Expr * getSubExpr()
Definition: ExprObjC.h:1589
clang::ArrayInitLoopExpr::getCommonExpr
OpaqueValueExpr * getCommonExpr() const
Get the common subexpression shared by all initializations (the source array).
Definition: Expr.h:5440
clang::ExplicitCastExpr
ExplicitCastExpr - An explicit cast written in the source code.
Definition: Expr.h:3701
clang::CXXUnresolvedConstructExpr::getTypeAsWritten
QualType getTypeAsWritten() const
Retrieve the type that is being constructed, as specified in the source code.
Definition: ExprCXX.h:3481
clang::CoroutineSuspendExpr
Represents an expression that might suspend coroutine execution; either a co_await or co_yield expres...
Definition: ExprCXX.h:4696
clang::DesignatedInitExpr::getArrayIndex
Expr * getArrayIndex(const Designator &D) const
Definition: Expr.cpp:4472
clang::Decl::getDeclContext
DeclContext * getDeclContext()
Definition: DeclBase.h:441
clang::SYCLUniqueStableNameExpr
Definition: Expr.h:2064
Type
MatchType Type
Definition: ASTMatchFinder.cpp:71