clang  14.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 
29  auto D = toExprDependence(E->getType()->getDependence());
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) {
43  E->getSubExpr()->getDependence();
44 
45  // C++ [temp.dep.constexpr]p5:
46  // An expression of the form & qualified-id where the qualified-id names a
47  // dependent member of the current instantiation is value-dependent. An
48  // expression of the form & cast-expression is also value-dependent if
49  // evaluating cast-expression as a core constant expression succeeds and
50  // the result of the evaluation refers to a templated entity that is an
51  // object with static or thread storage duration or a member function.
52  //
53  // What this amounts to is: constant-evaluate the operand and check whether it
54  // refers to a templated entity other than a variable with local storage.
55  if (Ctx.getLangOpts().CPlusPlus && E->getOpcode() == UO_AddrOf &&
56  !(Dep & ExprDependence::Value)) {
57  Expr::EvalResult Result;
59  Result.Diag = &Diag;
60  // FIXME: This doesn't enforce the C++98 constant expression rules.
61  if (E->getSubExpr()->EvaluateAsConstantExpr(Result, Ctx) && Diag.empty() &&
62  Result.Val.isLValue()) {
63  auto *VD = Result.Val.getLValueBase().dyn_cast<const ValueDecl *>();
64  if (VD && VD->isTemplated()) {
65  auto *VarD = dyn_cast<VarDecl>(VD);
66  if (!VarD || !VarD->hasLocalStorage())
67  Dep |= ExprDependence::Value;
68  }
69  }
70  }
71 
72  return Dep;
73 }
74 
76  // Never type-dependent (C++ [temp.dep.expr]p3).
77  // Value-dependent if the argument is type-dependent.
78  if (E->isArgumentType())
81 
82  auto ArgDeps = E->getArgumentExpr()->getDependence();
83  auto Deps = ArgDeps & ~ExprDependence::TypeValue;
84  // Value-dependent if the argument is type-dependent.
85  if (ArgDeps & ExprDependence::Type)
86  Deps |= ExprDependence::Value;
87  // Check to see if we are in the situation where alignof(decl) should be
88  // dependent because decl's alignment is dependent.
89  auto ExprKind = E->getKind();
90  if (ExprKind != UETT_AlignOf && ExprKind != UETT_PreferredAlignOf)
91  return Deps;
92  if ((Deps & ExprDependence::Value) && (Deps & ExprDependence::Instantiation))
93  return Deps;
94 
95  auto *NoParens = E->getArgumentExpr()->IgnoreParens();
96  const ValueDecl *D = nullptr;
97  if (const auto *DRE = dyn_cast<DeclRefExpr>(NoParens))
98  D = DRE->getDecl();
99  else if (const auto *ME = dyn_cast<MemberExpr>(NoParens))
100  D = ME->getMemberDecl();
101  if (!D)
102  return Deps;
103  for (const auto *I : D->specific_attrs<AlignedAttr>()) {
104  if (I->isAlignmentErrorDependent())
105  Deps |= ExprDependence::Error;
106  if (I->isAlignmentDependent())
107  Deps |= ExprDependence::ValueInstantiation;
108  }
109  return Deps;
110 }
111 
113  return E->getLHS()->getDependence() | E->getRHS()->getDependence();
114 }
115 
117  return E->getBase()->getDependence() | E->getRowIdx()->getDependence() |
118  (E->getColumnIdx() ? E->getColumnIdx()->getDependence()
120 }
121 
125 }
126 
128  // Cast expressions are type-dependent if the type is
129  // dependent (C++ [temp.dep.expr]p3).
130  // Cast expressions are value-dependent if the type is
131  // dependent or if the subexpression is value-dependent.
132  auto D = toExprDependence(E->getType()->getDependence());
133  if (E->getStmtClass() == Stmt::ImplicitCastExprClass) {
134  // An implicit cast expression doesn't (lexically) contain an
135  // unexpanded pack, even if its target type does.
136  D &= ~ExprDependence::UnexpandedPack;
137  }
138  if (auto *S = E->getSubExpr())
139  D |= S->getDependence() & ~ExprDependence::Type;
140  return D;
141 }
142 
144  return E->getLHS()->getDependence() | E->getRHS()->getDependence();
145 }
146 
148  // The type of the conditional operator depends on the type of the conditional
149  // to support the GCC vector conditional extension. Additionally,
150  // [temp.dep.expr] does specify state that this should be dependent on ALL sub
151  // expressions.
152  return E->getCond()->getDependence() | E->getLHS()->getDependence() |
153  E->getRHS()->getDependence();
154 }
155 
157  return E->getCommon()->getDependence() | E->getFalseExpr()->getDependence();
158 }
159 
160 ExprDependence clang::computeDependence(StmtExpr *E, unsigned TemplateDepth) {
161  auto D = toExprDependence(E->getType()->getDependence());
162  // Propagate dependence of the result.
163  if (const auto *CompoundExprResult =
164  dyn_cast_or_null<ValueStmt>(E->getSubStmt()->getStmtExprResult()))
165  if (const Expr *ResultExpr = CompoundExprResult->getExprStmt())
166  D |= ResultExpr->getDependence();
167  // Note: we treat a statement-expression in a dependent context as always
168  // being value- and instantiation-dependent. This matches the behavior of
169  // lambda-expressions and GCC.
170  if (TemplateDepth)
171  D |= ExprDependence::ValueInstantiation;
172  // A param pack cannot be expanded over stmtexpr boundaries.
173  return D & ~ExprDependence::UnexpandedPack;
174 }
175 
177  auto D = toExprDependence(E->getType()->getDependence()) |
178  E->getSrcExpr()->getDependence();
179  if (!E->getType()->isDependentType())
180  D &= ~ExprDependence::Type;
181  return D;
182 }
183 
185  if (E->isConditionDependent())
186  return ExprDependence::TypeValueInstantiation |
187  E->getCond()->getDependence() | E->getLHS()->getDependence() |
188  E->getRHS()->getDependence();
189 
190  auto Cond = E->getCond()->getDependence();
191  auto Active = E->getLHS()->getDependence();
192  auto Inactive = E->getRHS()->getDependence();
193  if (!E->isConditionTrue())
194  std::swap(Active, Inactive);
195  // Take type- and value- dependency from the active branch. Propagate all
196  // other flags from all branches.
197  return (Active & ExprDependence::TypeValue) |
198  ((Cond | Active | Inactive) & ~ExprDependence::TypeValue);
199 }
200 
202  auto D = ExprDependence::None;
203  for (auto *E : P->exprs())
204  D |= E->getDependence();
205  return D;
206 }
207 
209  auto D =
212  return D & ~ExprDependence::Value;
213 }
214 
216  return toExprDependence(E->getType()->getDependence()) &
217  (ExprDependence::Instantiation | ExprDependence::Error);
218 }
219 
221  auto D = E->getCommonExpr()->getDependence() |
222  E->getSubExpr()->getDependence() | ExprDependence::Instantiation;
224  D &= ~ExprDependence::Instantiation;
225  return turnTypeToValueDependence(D);
226 }
227 
229  return toExprDependence(E->getType()->getDependence()) &
230  ExprDependence::Instantiation;
231 }
232 
234  return E->getBase()->getDependence();
235 }
236 
238  auto D = toExprDependence(E->getType()->getDependence());
239  if (E->getBlockDecl()->isDependentContext())
240  D |= ExprDependence::Instantiation;
241  return D & ~ExprDependence::UnexpandedPack;
242 }
243 
245  auto D = toExprDependence(E->getType()->getDependence()) |
246  E->getSrcExpr()->getDependence();
247  if (!E->getType()->isDependentType())
248  D &= ~ExprDependence::Type;
249  return D;
250 }
251 
253  return E->getSemanticForm()->getDependence();
254 }
255 
258  D |= toExprDependence(E->getType()->getDependence()) &
260  return D;
261 }
262 
264  auto D = ExprDependence::None;
265  if (E->isTypeOperand())
266  D = toExprDependence(
268  else
270  // typeid is never type-dependent (C++ [temp.dep.expr]p4)
271  return D & ~ExprDependence::Type;
272 }
273 
276 }
277 
279  return E->getIdx()->getDependence();
280 }
281 
283  if (E->isTypeOperand())
286 
288 }
289 
291  // 'this' is type-dependent if the class type of the enclosing
292  // member function is dependent (C++ [temp.dep.expr]p2)
293  auto D = toExprDependence(E->getType()->getDependence());
294  assert(!(D & ExprDependence::UnexpandedPack));
295  return D;
296 }
297 
299  auto *Op = E->getSubExpr();
300  if (!Op)
301  return ExprDependence::None;
302  return Op->getDependence() & ~ExprDependence::TypeValue;
303 }
304 
306  return E->getSubExpr()->getDependence();
307 }
308 
310  return toExprDependence(E->getType()->getDependence()) &
311  ~ExprDependence::TypeValue;
312 }
313 
316 }
317 
320  if (auto *Dim = E->getDimensionExpression())
321  D |= Dim->getDependence();
322  return turnTypeToValueDependence(D);
323 }
324 
326  // Never type-dependent.
328  // Value-dependent if the argument is type-dependent.
331  return D;
332 }
333 
335  auto D = E->getOperand()->getDependence() & ~ExprDependence::TypeValue;
336  if (CT == CT_Dependent)
337  D |= ExprDependence::ValueInstantiation;
338  return D;
339 }
340 
342  return (E->getPattern()->getDependence() & ~ExprDependence::UnexpandedPack) |
343  ExprDependence::TypeValueInstantiation;
344 }
345 
347  return E->getReplacement()->getDependence();
348 }
349 
351  if (auto *Resume = E->getResumeExpr())
352  return (Resume->getDependence() &
353  (ExprDependence::TypeValue | ExprDependence::Error)) |
354  (E->getCommonExpr()->getDependence() & ~ExprDependence::TypeValue);
355  return E->getCommonExpr()->getDependence() |
356  ExprDependence::TypeValueInstantiation;
357 }
358 
360  return E->getOperand()->getDependence() |
361  ExprDependence::TypeValueInstantiation;
362 }
363 
365  return E->getSubExpr()->getDependence();
366 }
367 
370 }
371 
374 }
375 
377  if (E->isObjectReceiver())
378  return E->getBase()->getDependence() & ~ExprDependence::Type;
379  if (E->isSuperReceiver())
381  ~ExprDependence::TypeValue;
382  assert(E->isClassReceiver());
383  return ExprDependence::None;
384 }
385 
387  return E->getBaseExpr()->getDependence() | E->getKeyExpr()->getDependence();
388 }
389 
391  return E->getBase()->getDependence() & ~ExprDependence::Type &
392  ~ExprDependence::UnexpandedPack;
393 }
394 
396  return E->getSubExpr()->getDependence();
397 }
398 
400  auto D = E->getBase()->getDependence();
401  if (auto *LB = E->getLowerBound())
402  D |= LB->getDependence();
403  if (auto *Len = E->getLength())
404  D |= Len->getDependence();
405  return D;
406 }
407 
409  auto D = E->getBase()->getDependence() |
411  for (Expr *Dim: E->getDimensions())
412  if (Dim)
413  D |= Dim->getDependence();
414  return D;
415 }
416 
418  auto D = toExprDependence(E->getType()->getDependence());
419  for (unsigned I = 0, End = E->numOfIterators(); I < End; ++I) {
420  if (auto *VD = cast_or_null<ValueDecl>(E->getIteratorDecl(I)))
421  D |= toExprDependence(VD->getType()->getDependence());
423  if (Expr *BE = IR.Begin)
424  D |= BE->getDependence();
425  if (Expr *EE = IR.End)
426  D |= EE->getDependence();
427  if (Expr *SE = IR.Step)
428  D |= SE->getDependence();
429  }
430  return D;
431 }
432 
433 /// Compute the type-, value-, and instantiation-dependence of a
434 /// declaration reference
435 /// based on the declaration being referenced.
437  auto Deps = ExprDependence::None;
438 
439  if (auto *NNS = E->getQualifier())
440  Deps |= toExprDependence(NNS->getDependence() &
441  ~NestedNameSpecifierDependence::Dependent);
442 
443  if (auto *FirstArg = E->getTemplateArgs()) {
444  unsigned NumArgs = E->getNumTemplateArgs();
445  for (auto *Arg = FirstArg, *End = FirstArg + NumArgs; Arg < End; ++Arg)
446  Deps |= toExprDependence(Arg->getArgument().getDependence());
447  }
448 
449  auto *Decl = E->getDecl();
450  auto Type = E->getType();
451 
452  if (Decl->isParameterPack())
453  Deps |= ExprDependence::UnexpandedPack;
455 
456  // C++ [temp.dep.expr]p3:
457  // An id-expression is type-dependent if it contains:
458 
459  // - an identifier associated by name lookup with one or more declarations
460  // declared with a dependent type
461  //
462  // [The "or more" case is not modeled as a DeclRefExpr. There are a bunch
463  // more bullets here that we handle by treating the declaration as having a
464  // dependent type if they involve a placeholder type that can't be deduced.]
465  if (Type->isDependentType())
466  return Deps | ExprDependence::TypeValueInstantiation;
468  Deps |= ExprDependence::Instantiation;
469 
470  // - a conversion-function-id that specifies a dependent type
471  if (Decl->getDeclName().getNameKind() ==
473  QualType T = Decl->getDeclName().getCXXNameType();
474  if (T->isDependentType())
475  return Deps | ExprDependence::TypeValueInstantiation;
476 
478  Deps |= ExprDependence::Instantiation;
479  }
480 
481  // - a template-id that is dependent,
482  // - a nested-name-specifier or a qualified-id that names a member of an
483  // unknown specialization
484  // [These are not modeled as DeclRefExprs.]
485 
486  // or if it names a dependent member of the current instantiation that is a
487  // static data member of type "array of unknown bound of T" for some T
488  // [handled below].
489 
490  // C++ [temp.dep.constexpr]p2:
491  // An id-expression is value-dependent if:
492 
493  // - it is type-dependent [handled above]
494 
495  // - it is the name of a non-type template parameter,
496  if (isa<NonTypeTemplateParmDecl>(Decl))
497  return Deps | ExprDependence::ValueInstantiation;
498 
499  // - it names a potentially-constant variable that is initialized with an
500  // expression that is value-dependent
501  if (const auto *Var = dyn_cast<VarDecl>(Decl)) {
502  if (Var->mightBeUsableInConstantExpressions(Ctx)) {
503  if (const Expr *Init = Var->getAnyInitializer()) {
504  if (Init->isValueDependent())
505  Deps |= ExprDependence::ValueInstantiation;
506  if (Init->containsErrors())
507  Deps |= ExprDependence::Error;
508  }
509  }
510 
511  // - it names a static data member that is a dependent member of the
512  // current instantiation and is not initialized in a member-declarator,
513  if (Var->isStaticDataMember() &&
514  Var->getDeclContext()->isDependentContext() &&
515  !Var->getFirstDecl()->hasInit()) {
516  const VarDecl *First = Var->getFirstDecl();
517  TypeSourceInfo *TInfo = First->getTypeSourceInfo();
518  if (TInfo->getType()->isIncompleteArrayType()) {
519  Deps |= ExprDependence::TypeValueInstantiation;
520  } else if (!First->hasInit()) {
521  Deps |= ExprDependence::ValueInstantiation;
522  }
523  }
524 
525  return Deps;
526  }
527 
528  // - it names a static member function that is a dependent member of the
529  // current instantiation
530  //
531  // FIXME: It's unclear that the restriction to static members here has any
532  // effect: any use of a non-static member function name requires either
533  // forming a pointer-to-member or providing an object parameter, either of
534  // which makes the overall expression value-dependent.
535  if (auto *MD = dyn_cast<CXXMethodDecl>(Decl)) {
536  if (MD->isStatic() && Decl->getDeclContext()->isDependentContext())
537  Deps |= ExprDependence::ValueInstantiation;
538  }
539 
540  return Deps;
541 }
542 
544  // RecoveryExpr is
545  // - always value-dependent, and therefore instantiation dependent
546  // - contains errors (ExprDependence::Error), by definition
547  // - type-dependent if we don't know the type (fallback to an opaque
548  // dependent type), or the type is known and dependent, or it has
549  // type-dependent subexpressions.
550  auto D = toExprDependence(E->getType()->getDependence()) |
551  ExprDependence::ErrorDependent;
552  // FIXME: remove the type-dependent bit from subexpressions, if the
553  // RecoveryExpr has a non-dependent type.
554  for (auto *S : E->subExpressions())
555  D |= S->getDependence();
556  return D;
557 }
558 
561 }
562 
564  return toExprDependence(E->getType()->getDependence()) &
565  ~ExprDependence::UnexpandedPack;
566 }
567 
569  llvm::ArrayRef<Expr *> PreArgs) {
570  auto D = E->getCallee()->getDependence();
571  for (auto *A : llvm::makeArrayRef(E->getArgs(), E->getNumArgs())) {
572  if (A)
573  D |= A->getDependence();
574  }
575  for (auto *A : PreArgs)
576  D |= A->getDependence();
577  return D;
578 }
579 
581  auto D = turnTypeToValueDependence(
583  for (unsigned I = 0, N = E->getNumExpressions(); I < N; ++I)
585  return D;
586 }
587 
589  auto *MemberDecl = E->getMemberDecl();
590  auto D = E->getBase()->getDependence();
591  if (FieldDecl *FD = dyn_cast<FieldDecl>(MemberDecl)) {
592  DeclContext *DC = MemberDecl->getDeclContext();
593  // dyn_cast_or_null is used to handle objC variables which do not
594  // have a declaration context.
595  CXXRecordDecl *RD = dyn_cast_or_null<CXXRecordDecl>(DC);
596  if (RD && RD->isDependentContext() && RD->isCurrentInstantiation(DC)) {
597  if (!E->getType()->isDependentType())
598  D &= ~ExprDependence::Type;
599  }
600 
601  // Bitfield with value-dependent width is type-dependent.
602  if (FD && FD->isBitField() && FD->getBitWidth()->isValueDependent()) {
604  }
605  }
606  // FIXME: move remaining dependence computation from MemberExpr::Create()
607  return D;
608 }
609 
611  auto D = ExprDependence::None;
612  for (auto *A : E->inits())
613  D |= A->getDependence();
614  return D;
615 }
616 
618  auto D = toExprDependence(E->getType()->getDependence());
619  for (auto *C : llvm::makeArrayRef(E->getSubExprs(), E->getNumSubExprs()))
620  D |= C->getDependence();
621  return D;
622 }
623 
625  bool ContainsUnexpandedPack) {
626  auto D = ContainsUnexpandedPack ? ExprDependence::UnexpandedPack
628  for (auto *AE : E->getAssocExprs())
629  D |= AE->getDependence() & ExprDependence::Error;
631 
632  if (E->isResultDependent())
633  return D | ExprDependence::TypeValueInstantiation;
634  return D | (E->getResultExpr()->getDependence() &
635  ~ExprDependence::UnexpandedPack);
636 }
637 
639  auto Deps = E->getInit()->getDependence();
640  for (auto D : E->designators()) {
641  auto DesignatorDeps = ExprDependence::None;
642  if (D.isArrayDesignator())
643  DesignatorDeps |= E->getArrayIndex(D)->getDependence();
644  else if (D.isArrayRangeDesignator())
645  DesignatorDeps |= E->getArrayRangeStart(D)->getDependence() |
647  Deps |= DesignatorDeps;
648  if (DesignatorDeps & ExprDependence::TypeValue)
649  Deps |= ExprDependence::TypeValueInstantiation;
650  }
651  return Deps;
652 }
653 
655  auto D = O->getSyntacticForm()->getDependence();
656  for (auto *E : O->semantics())
657  D |= E->getDependence();
658  return D;
659 }
660 
662  auto D = ExprDependence::None;
663  for (auto *E : llvm::makeArrayRef(A->getSubExprs(), A->getNumSubExprs()))
664  D |= E->getDependence();
665  return D;
666 }
667 
669  auto D = toExprDependence(E->getType()->getDependence());
670  auto Size = E->getArraySize();
671  if (Size.hasValue() && *Size)
672  D |= turnTypeToValueDependence((*Size)->getDependence());
673  if (auto *I = E->getInitializer())
674  D |= turnTypeToValueDependence(I->getDependence());
675  for (auto *A : E->placement_arguments())
676  D |= turnTypeToValueDependence(A->getDependence());
677  return D;
678 }
679 
681  auto D = E->getBase()->getDependence();
682  if (!E->getDestroyedType().isNull())
684  if (auto *ST = E->getScopeTypeInfo())
686  toExprDependence(ST->getType()->getDependence()));
687  if (auto *Q = E->getQualifier())
688  D |= toExprDependence(Q->getDependence() &
689  ~NestedNameSpecifierDependence::Dependent);
690  return D;
691 }
692 
694  auto D = ExprDependence::None;
695  if (Name.isInstantiationDependent())
696  D |= ExprDependence::Instantiation;
697  if (Name.containsUnexpandedParameterPack())
698  D |= ExprDependence::UnexpandedPack;
699  return D;
700 }
701 
703 clang::computeDependence(OverloadExpr *E, bool KnownDependent,
704  bool KnownInstantiationDependent,
705  bool KnownContainsUnexpandedParameterPack) {
706  auto Deps = ExprDependence::None;
707  if (KnownDependent)
708  Deps |= ExprDependence::TypeValue;
709  if (KnownInstantiationDependent)
710  Deps |= ExprDependence::Instantiation;
711  if (KnownContainsUnexpandedParameterPack)
712  Deps |= ExprDependence::UnexpandedPack;
713  Deps |= getDependenceInExpr(E->getNameInfo());
714  if (auto *Q = E->getQualifier())
715  Deps |= toExprDependence(Q->getDependence() &
716  ~NestedNameSpecifierDependence::Dependent);
717  for (auto *D : E->decls()) {
718  if (D->getDeclContext()->isDependentContext() ||
719  isa<UnresolvedUsingValueDecl>(D))
720  Deps |= ExprDependence::TypeValueInstantiation;
721  }
722  // If we have explicit template arguments, check for dependent
723  // template arguments and whether they contain any unexpanded pack
724  // expansions.
725  for (auto A : E->template_arguments())
726  Deps |= toExprDependence(A.getArgument().getDependence());
727  return Deps;
728 }
729 
731  auto D = ExprDependence::TypeValue;
732  D |= getDependenceInExpr(E->getNameInfo());
733  if (auto *Q = E->getQualifier())
734  D |= toExprDependence(Q->getDependence());
735  for (auto A : E->template_arguments())
736  D |= toExprDependence(A.getArgument().getDependence());
737  return D;
738 }
739 
741  auto D = toExprDependence(E->getType()->getDependence());
742  for (auto *A : E->arguments())
743  D |= A->getDependence() & ~ExprDependence::Type;
744  return D;
745 }
746 
748  return E->getExpr()->getDependence();
749 }
750 
752  return E->getExpr()->getDependence();
753 }
754 
756  bool ContainsUnexpandedParameterPack) {
757  auto D = toExprDependence(E->getType()->getDependence());
758  if (ContainsUnexpandedParameterPack)
759  D |= ExprDependence::UnexpandedPack;
760  return D;
761 }
762 
764  auto D = ExprDependence::ValueInstantiation;
765  D |= toExprDependence(E->getType()->getDependence());
766  for (auto *A : E->arguments())
767  D |= A->getDependence() &
768  (ExprDependence::UnexpandedPack | ExprDependence::Error);
769  return D;
770 }
771 
773  auto D = ExprDependence::TypeValueInstantiation;
774  if (!E->isImplicitAccess())
775  D |= E->getBase()->getDependence();
776  if (auto *Q = E->getQualifier())
777  D |= toExprDependence(Q->getDependence());
779  for (auto A : E->template_arguments())
780  D |= toExprDependence(A.getArgument().getDependence());
781  return D;
782 }
783 
785  return E->getSubExpr()->getDependence();
786 }
787 
789  auto D = ExprDependence::TypeValueInstantiation;
790  for (const auto *C : {E->getLHS(), E->getRHS()}) {
791  if (C)
792  D |= C->getDependence() & ~ExprDependence::UnexpandedPack;
793  }
794  return D;
795 }
796 
798  auto D = ExprDependence::None;
799  for (const auto *A : E->getArgs())
800  D |=
801  toExprDependence(A->getType()->getDependence()) & ~ExprDependence::Type;
802  return D;
803 }
804 
806  bool ValueDependent) {
808  const auto InterestingDeps = TemplateArgumentDependence::Instantiation |
809  TemplateArgumentDependence::UnexpandedPack;
810  for (const TemplateArgumentLoc &ArgLoc :
812  TA |= ArgLoc.getArgument().getDependence() & InterestingDeps;
813  if (TA == InterestingDeps)
814  break;
815  }
816 
817  ExprDependence D =
818  ValueDependent ? ExprDependence::Value : ExprDependence::None;
819  return D | toExprDependence(TA);
820 }
821 
823  auto D = ExprDependence::None;
824  Expr **Elements = E->getElements();
825  for (unsigned I = 0, N = E->getNumElements(); I != N; ++I)
826  D |= turnTypeToValueDependence(Elements[I]->getDependence());
827  return D;
828 }
829 
831  auto Deps = ExprDependence::None;
832  for (unsigned I = 0, N = E->getNumElements(); I < N; ++I) {
833  auto KV = E->getKeyValueElement(I);
834  auto KVDeps = turnTypeToValueDependence(KV.Key->getDependence() |
835  KV.Value->getDependence());
836  if (KV.EllipsisLoc.isValid())
837  KVDeps &= ~ExprDependence::UnexpandedPack;
838  Deps |= KVDeps;
839  }
840  return Deps;
841 }
842 
844  auto D = ExprDependence::None;
845  if (auto *R = E->getInstanceReceiver())
846  D |= R->getDependence();
847  else
848  D |= toExprDependence(E->getType()->getDependence());
849  for (auto *A : E->arguments())
850  D |= A->getDependence();
851  return D;
852 }
clang::CXXPseudoDestructorExpr::getDestroyedType
QualType getDestroyedType() const
Retrieve the type being destroyed.
Definition: ExprCXX.cpp:334
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:4080
clang::ExpressionTraitExpr
An expression trait intrinsic.
Definition: ExprCXX.h:2823
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:2717
clang::SubstNonTypeTemplateParmExpr
Represents a reference to a non-type template parameter that has been substituted with a template arg...
Definition: ExprCXX.h:4245
clang::Expr::getDependence
ExprDependence getDependence() const
Definition: Expr.h:155
clang::VAArgExpr::getWrittenTypeInfo
TypeSourceInfo * getWrittenTypeInfo() const
Definition: Expr.h:4653
clang::CompoundStmt::getStmtExprResult
Stmt * getStmtExprResult()
Definition: Stmt.h:1491
clang::AtomicExpr
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load,...
Definition: Expr.h:6229
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:2753
clang::CXXUnresolvedConstructExpr::arguments
arg_range arguments()
Definition: ExprCXX.h:3493
clang::ObjCBoxedExpr
ObjCBoxedExpr - used for generalized expression boxing.
Definition: ExprObjC.h:128
clang::AsTypeExpr
AsTypeExpr - Clang builtin function __builtin_astype [OpenCL 6.2.4.2] This AST node provides support ...
Definition: Expr.h:6026
clang::OffsetOfExpr
OffsetOfExpr - [C99 7.17] - This represents an expression of the form offsetof(record-type,...
Definition: Expr.h:2438
clang::CXXPseudoDestructorExpr
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
Definition: ExprCXX.h:2517
clang::TypeSourceInfo::getType
QualType getType() const
Return the type wrapped by this type source info.
Definition: Type.h:6406
clang::VAArgExpr::getSubExpr
const Expr * getSubExpr() const
Definition: Expr.h:4645
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:2743
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:4238
clang::DeclContext
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Definition: DeclBase.h:1347
clang::OffsetOfExpr::getIndexExpr
Expr * getIndexExpr(unsigned Idx)
Definition: Expr.h:2501
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:1316
clang::ConditionalOperator::getLHS
Expr * getLHS() const
Definition: Expr.h:4175
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:78
DependenceFlags.h
clang::DesignatedInitExpr
Represents a C99 designated initializer expression.
Definition: Expr.h:5024
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:4894
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:4479
clang::AsTypeExpr::getSrcExpr
Expr * getSrcExpr() const
getSrcExpr - Return the Expr to be converted.
Definition: Expr.h:6045
clang::ParenListExpr
Definition: Expr.h:5532
clang::CastExpr::getSubExpr
Expr * getSubExpr()
Definition: Expr.h:3524
clang::NoInitExpr
Represents a place-holder for an object not to be initialized by anything.
Definition: Expr.h:5325
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:673
Attr.h
clang::CompoundLiteralExpr::getTypeSourceInfo
TypeSourceInfo * getTypeSourceInfo() const
Definition: Expr.h:3436
clang::TypeTraitExpr
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
Definition: ExprCXX.h:2665
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:2835
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:6412
clang::StmtExpr::getSubStmt
CompoundStmt * getSubStmt()
Definition: Expr.h:4362
clang::InitListExpr
Describes an C or C++ initializer list.
Definition: Expr.h:4786
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:4724
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:231
clang::UnaryOperator
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
Definition: Expr.h:2157
clang::OffsetOfExpr::getNumExpressions
unsigned getNumExpressions() const
Definition: Expr.h:2516
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:5416
clang::UnaryExprOrTypeTraitExpr::getArgumentExpr
Expr * getArgumentExpr()
Definition: Expr.h:2593
clang::GenericSelectionExpr::getControllingExpr
Expr * getControllingExpr()
Return the controlling expression of this generic selection expression.
Definition: Expr.h:5804
clang::AtomicExpr::getSubExprs
Expr ** getSubExprs()
Definition: Expr.h:6296
clang::ShuffleVectorExpr::getSubExprs
Expr ** getSubExprs()
Retrieve the array of expressions.
Definition: Expr.h:4430
clang::DesignatedInitExpr::getArrayRangeEnd
Expr * getArrayRangeEnd(const Designator &D) const
Definition: Expr.cpp:4374
clang::DependentScopeDeclRefExpr::getQualifier
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies this declaration.
Definition: ExprCXX.h:3247
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:641
clang::OpaqueValueExpr
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class.
Definition: Expr.h:1129
clang::CXXPseudoDestructorExpr::getScopeTypeInfo
TypeSourceInfo * getScopeTypeInfo() const
Retrieve the scope type in a qualified pseudo-destructor expression.
Definition: ExprCXX.h:2594
clang::Type
The base class of the type hierarchy.
Definition: Type.h:1490
clang::CXXFoldExpr
Represents a folding of a pack over an operator.
Definition: ExprCXX.h:4574
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:4141
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:998
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::DependentScopeDeclRefExpr::template_arguments
ArrayRef< TemplateArgumentLoc > template_arguments() const
Definition: ExprCXX.h:3303
clang::DependentCoawaitExpr::getOperand
Expr * getOperand() const
Definition: ExprCXX.h:4823
ExprConcepts.h
clang::CallExpr::getCallee
Expr * getCallee()
Definition: Expr.h:2945
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:2543
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:2986
clang::ConvertVectorExpr
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
Definition: Expr.h:4461
clang::MSPropertySubscriptExpr
MS property subscript expression.
Definition: ExprCXX.h:994
clang::ChooseExpr::isConditionDependent
bool isConditionDependent() const
Definition: Expr.h:4550
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:4800
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:529
clang::OverloadExpr::decls
llvm::iterator_range< decls_iterator > decls() const
Definition: ExprCXX.h:2978
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:117
clang::ParenExpr::getSubExpr
const Expr * getSubExpr() const
Definition: Expr.h:2121
clang::BinaryOperator
A builtin binary operation expression such as "x + y" or "x <= y".
Definition: Expr.h:3803
ExceptionSpecificationType.h
clang::CXXNewExpr::getInitializer
Expr * getInitializer()
The initializer of this new-expression.
Definition: ExprCXX.h:2314
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:2976
clang::SubstNonTypeTemplateParmExpr::getReplacement
Expr * getReplacement() const
Definition: ExprCXX.h:4277
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:3759
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:5977
clang::MatrixSubscriptExpr::getRowIdx
Expr * getRowIdx()
Definition: Expr.h:2747
clang::CXXFoldExpr::getLHS
Expr * getLHS() const
Definition: ExprCXX.h:4608
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:4462
clang::ASTContext
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:212
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:2480
clang::CXXUuidofExpr::getExprOperand
Expr * getExprOperand() const
Definition: ExprCXX.h:1097
clang::turnTypeToValueDependence
ExprDependence turnTypeToValueDependence(ExprDependence D)
Definition: DependenceFlags.h:243
clang::PseudoObjectExpr
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
Definition: Expr.h:6095
clang::OMPIteratorExpr::getIteratorDecl
Decl * getIteratorDecl(unsigned I)
Gets the iterator declaration for the given iterator.
Definition: Expr.cpp:4890
clang::ConditionalOperator::getRHS
Expr * getRHS() const
Definition: Expr.h:4176
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:14818
clang::DeclRefExpr::getNumTemplateArgs
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition: Expr.h:1390
clang::BinaryConditionalOperator
BinaryConditionalOperator - The GNU extension to the conditional operator which allows the middle ope...
Definition: Expr.h:4203
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:2574
clang::ArrayTypeTraitExpr::getQueriedType
QualType getQueriedType() const
Definition: ExprCXX.h:2794
clang::ValueStmt::getExprStmt
const Expr * getExprStmt() const
Definition: Stmt.cpp:395
clang::DeclRefExpr::getDecl
ValueDecl * getDecl()
Definition: Expr.h:1289
clang::TemplateArgumentLoc
Location wrapper for a TemplateArgument.
Definition: TemplateBase.h:458
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:606
clang::ImplicitValueInitExpr
Represents an implicitly-generated value initialization of an object of a given type.
Definition: Expr.h:5505
clang::OpaqueValueExpr::getSourceExpr
Expr * getSourceExpr() const
The source expression of an opaque value expression is the expression which originally generated the ...
Definition: Expr.h:1179
clang::VarDecl
Represents a variable declaration or definition.
Definition: Decl.h:876
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:4427
clang::TypeTraitExpr::getArgs
ArrayRef< TypeSourceInfo * > getArgs() const
Retrieve the argument types.
Definition: ExprCXX.h:2723
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:3046
clang::CXXDefaultArgExpr
A default argument (C++ [dcl.fct.default]).
Definition: ExprCXX.h:1241
clang::InitListExpr::inits
ArrayRef< Expr * > inits()
Definition: Expr.h:4826
clang::PackExpansionExpr
Represents a C++11 pack expansion that produces a sequence of expressions.
Definition: ExprCXX.h:4051
clang::ArraySubscriptExpr::getLHS
Expr * getLHS()
An array access can be written A[4] or 4[A] (both are equivalent).
Definition: Expr.h:2668
clang::computeDependence
ExprDependence computeDependence(FullExpr *E)
Definition: ComputeDependence.cpp:24
clang::ArraySubscriptExpr::getRHS
Expr * getRHS()
Definition: Expr.h:2672
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:3245
clang::ChooseExpr
ChooseExpr - GNU builtin-in function __builtin_choose_expr.
Definition: Expr.h:4520
clang::CXXFoldExpr::getRHS
Expr * getRHS() const
Definition: ExprCXX.h:4609
clang::ExpressionTraitExpr::getQueriedExpression
Expr * getQueriedExpression() const
Definition: ExprCXX.h:2860
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:5801
clang::FullExpr::getSubExpr
const Expr * getSubExpr() const
Definition: Expr.h:1011
clang::DeclarationName::CXXConversionFunctionName
@ CXXConversionFunctionName
Definition: DeclarationName.h:208
clang::CompoundLiteralExpr
CompoundLiteralExpr - [C99 6.5.2.5].
Definition: Expr.h:3403
clang::ObjCDictionaryLiteral::getKeyValueElement
ObjCDictionaryElement getKeyValueElement(unsigned Index) const
Definition: ExprObjC.h:362
clang::DesignatedInitExpr::designators
llvm::MutableArrayRef< Designator > designators()
Definition: Expr.h:5230
clang::UnaryExprOrTypeTraitExpr::isArgumentType
bool isArgumentType() const
Definition: Expr.h:2585
clang::MemberExpr::getBase
Expr * getBase() const
Definition: Expr.h:3239
clang::CXXDependentScopeMemberExpr::getBase
Expr * getBase() const
Retrieve the base object of this member expressions, e.g., the x in x.m.
Definition: ExprCXX.h:3648
clang::CXXRecordDecl
Represents a C++ struct/union/class.
Definition: DeclCXX.h:255
clang::ObjCPropertyRefExpr::isClassReceiver
bool isClassReceiver() const
Definition: ExprObjC.h:773
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:2174
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:2182
clang::ExtVectorElementExpr::getBase
const Expr * getBase() const
Definition: Expr.h:5922
clang::UnaryExprOrTypeTraitExpr::getArgumentType
QualType getArgumentType() const
Definition: Expr.h:2586
clang::PseudoObjectExpr::getSyntacticForm
Expr * getSyntacticForm()
Return the syntactic form of this expression, i.e.
Definition: Expr.h:6139
clang::Stmt::getStmtClass
StmtClass getStmtClass() const
Definition: Stmt.h:1163
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:3691
clang::PseudoObjectExpr::semantics
llvm::iterator_range< semantics_iterator > semantics()
Definition: Expr.h:6176
clang::ValueDecl
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Definition: Decl.h:676
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:3852
clang::ParenExpr
ParenExpr - This represents a parethesized expression, e.g.
Definition: Expr.h:2106
clang::CallExpr::getNumArgs
unsigned getNumArgs() const
getNumArgs - Return the number of actual arguments to this call.
Definition: Expr.h:2973
clang::Type::isIncompleteArrayType
bool isIncompleteArrayType() const
Definition: Type.h:6746
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:2398
clang::QualType::isNull
bool isNull() const
Return true if this QualType doesn't point to a type yet.
Definition: Type.h:738
clang::BlockExpr
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Definition: Expr.h:5965
llvm::ArrayRef
Definition: LLVM.h:34
clang::StmtExpr
StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).
Definition: Expr.h:4345
Value
Value
Definition: UninitializedValues.cpp:102
clang::Decl
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:89
clang::CXXTypeidExpr::isTypeOperand
bool isTypeOperand() const
Definition: ExprCXX.h:875
clang::CoroutineSuspendExpr::getResumeExpr
Expr * getResumeExpr() const
Definition: ExprCXX.h:4739
clang::ArraySubscriptExpr
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
Definition: Expr.h:2639
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:3191
clang::ConvertVectorExpr::getSrcExpr
Expr * getSrcExpr() const
getSrcExpr - Return the Expr to be converted.
Definition: Expr.h:4481
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:5436
clang::OverloadExpr
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr.
Definition: ExprCXX.h:2880
clang::GenericSelectionExpr::getAssocExprs
ArrayRef< Expr * > getAssocExprs() const
Definition: Expr.h:5822
clang::CXXDependentScopeMemberExpr
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition: ExprCXX.h:3550
clang::ChooseExpr::getCond
Expr * getCond() const
Definition: Expr.h:4560
clang::CXXDependentScopeMemberExpr::isImplicitAccess
bool isImplicitAccess() const
True if this is an implicit access, i.e.
Definition: ExprCXX.h:3640
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:3997
clang::CXXUnresolvedConstructExpr
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
Definition: ExprCXX.h:3428
clang::BinaryConditionalOperator::getFalseExpr
Expr * getFalseExpr() const
getFalseExpr - Return the subexpression which will be evaluated if the condnition evaluates to false;...
Definition: Expr.h:4257
clang::ChooseExpr::getLHS
Expr * getLHS() const
Definition: Expr.h:4562
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:5905
DeclarationName.h
clang::PredefinedExpr
[C99 6.4.2.2] - A predefined identifier such as func.
Definition: Expr.h:1953
clang::CXXDependentScopeMemberExpr::getQualifier
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the member name.
Definition: ExprCXX.h:3665
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:2575
getDependenceInExpr
static ExprDependence getDependenceInExpr(DeclarationNameInfo Name)
Definition: ComputeDependence.cpp:693
clang::CompoundLiteralExpr::getInitializer
const Expr * getInitializer() const
Definition: Expr.h:3426
clang::Decl::isParameterPack
bool isParameterPack() const
Whether this declaration is a parameter pack.
Definition: DeclBase.cpp:211
clang::ChooseExpr::isConditionTrue
bool isConditionTrue() const
isConditionTrue - Return whether the condition is true (i.e.
Definition: Expr.h:4543
clang::UnaryOperator::getSubExpr
Expr * getSubExpr() const
Definition: Expr.h:2204
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:2915
clang
Definition: CalledOnceCheck.h:17
clang::UnaryOperator::getOpcode
Opcode getOpcode() const
Definition: Expr.h:2199
clang::BinaryOperator::getRHS
Expr * getRHS() const
Definition: Expr.h:3854
clang::MatrixSubscriptExpr::getColumnIdx
Expr * getColumnIdx()
Definition: Expr.h:2751
clang::GenericSelectionExpr::getResultExpr
Expr * getResultExpr()
Return the result expression of this controlling expression.
Definition: Expr.h:5813
clang::ConditionalOperator::getCond
Expr * getCond() const
Definition: Expr.h:4164
clang::CXXNewExpr::placement_arguments
llvm::iterator_range< arg_iterator > placement_arguments()
Definition: ExprCXX.h:2344
clang::GenericSelectionExpr
Represents a C11 generic selection.
Definition: Expr.h:5623
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:4564
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:6395
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:2995
clang::DeclContext::isDependentContext
bool isDependentContext() const
Determines whether this context is dependent on a template parameter.
Definition: DeclBase.cpp:1142
clang::CXXPseudoDestructorExpr::getBase
Expr * getBase() const
Definition: ExprCXX.h:2560
clang::CXXDeleteExpr::getArgument
Expr * getArgument()
Definition: ExprCXX.h:2439
clang::RecoveryExpr::subExpressions
ArrayRef< Expr * > subExpressions()
Definition: Expr.h:6420
clang::DependentScopeDeclRefExpr::getNameInfo
const DeclarationNameInfo & getNameInfo() const
Retrieve the name that this expression refers to.
Definition: ExprCXX.h:3231
clang::SYCLUniqueStableNameExpr::getTypeSourceInfo
TypeSourceInfo * getTypeSourceInfo()
Definition: Expr.h:2067
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:5265
clang::VAArgExpr
Represents a call to the builtin function __builtin_va_arg.
Definition: Expr.h:4629
clang::MemberExpr
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Definition: Expr.h:3162
clang::DeclRefExpr::getTemplateArgs
const TemplateArgumentLoc * getTemplateArgs() const
Retrieve the template arguments provided as part of this template-id.
Definition: Expr.h:1382
clang::Type::getDependence
TypeDependence getDependence() const
Definition: Type.h:2163
clang::AtomicExpr::getNumSubExprs
static unsigned getNumSubExprs(AtomicOp Op)
Determine the number of arguments the specified atomic builtin should have.
Definition: Expr.cpp:4678
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()
Definition: ExprCXX.h:2264
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:758
clang::ObjCBoxedExpr::getSubExpr
Expr * getSubExpr()
Definition: ExprObjC.h:144
clang::CastExpr
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition: Expr.h:3473
clang::ArrayTypeTraitExpr::getDimensionExpression
Expr * getDimensionExpression() const
Definition: ExprCXX.h:2800
clang::DeclRefExpr
A reference to a declared variable, function, enum, etc.
Definition: Expr.h:1217
clang::CXXNoexceptExpr::getOperand
Expr * getOperand() const
Definition: ExprCXX.h:4014
clang::CallExpr
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition: Expr.h:2795
clang::ShuffleVectorExpr
ShuffleVectorExpr - clang-specific builtin-in function __builtin_shufflevector.
Definition: Expr.h:4393
clang::DesignatedInitExpr::getArrayRangeStart
Expr * getArrayRangeStart(const Designator &D) const
Definition: Expr.cpp:4368
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:765
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:5431
clang::CoroutineSuspendExpr
Represents an expression that might suspend coroutine execution; either a co_await or co_yield expres...
Definition: ExprCXX.h:4679
clang::DesignatedInitExpr::getArrayIndex
Expr * getArrayIndex(const Designator &D) const
Definition: Expr.cpp:4363
clang::Decl::getDeclContext
DeclContext * getDeclContext()
Definition: DeclBase.h:439
clang::SYCLUniqueStableNameExpr
Definition: Expr.h:2050
Type
MatchType Type
Definition: ASTMatchFinder.cpp:70