Clang Project

clang_source_code/include/clang/AST/Expr.h
1//===--- Expr.h - Classes for representing expressions ----------*- C++ -*-===//
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//
9//  This file defines the Expr interface and subclasses.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_CLANG_AST_EXPR_H
14#define LLVM_CLANG_AST_EXPR_H
15
16#include "clang/AST/APValue.h"
17#include "clang/AST/ASTVector.h"
18#include "clang/AST/Decl.h"
19#include "clang/AST/DeclAccessPair.h"
20#include "clang/AST/OperationKinds.h"
21#include "clang/AST/Stmt.h"
22#include "clang/AST/TemplateBase.h"
23#include "clang/AST/Type.h"
24#include "clang/Basic/CharInfo.h"
25#include "clang/Basic/FixedPoint.h"
26#include "clang/Basic/LangOptions.h"
27#include "clang/Basic/SyncScope.h"
28#include "clang/Basic/TypeTraits.h"
29#include "llvm/ADT/APFloat.h"
30#include "llvm/ADT/APSInt.h"
31#include "llvm/ADT/iterator.h"
32#include "llvm/ADT/iterator_range.h"
33#include "llvm/ADT/SmallVector.h"
34#include "llvm/ADT/StringRef.h"
35#include "llvm/Support/AtomicOrdering.h"
36#include "llvm/Support/Compiler.h"
37#include "llvm/Support/TrailingObjects.h"
38
39namespace clang {
40  class APValue;
41  class ASTContext;
42  class BlockDecl;
43  class CXXBaseSpecifier;
44  class CXXMemberCallExpr;
45  class CXXOperatorCallExpr;
46  class CastExpr;
47  class Decl;
48  class IdentifierInfo;
49  class MaterializeTemporaryExpr;
50  class NamedDecl;
51  class ObjCPropertyRefExpr;
52  class OpaqueValueExpr;
53  class ParmVarDecl;
54  class StringLiteral;
55  class TargetInfo;
56  class ValueDecl;
57
58/// A simple array of base specifiers.
59typedef SmallVector<CXXBaseSpecifier*, 4CXXCastPath;
60
61/// An adjustment to be made to the temporary created when emitting a
62/// reference binding, which accesses a particular subobject of that temporary.
63struct SubobjectAdjustment {
64  enum {
65    DerivedToBaseAdjustment,
66    FieldAdjustment,
67    MemberPointerAdjustment
68  } Kind;
69
70  struct DTB {
71    const CastExpr *BasePath;
72    const CXXRecordDecl *DerivedClass;
73  };
74
75  struct P {
76    const MemberPointerType *MPT;
77    Expr *RHS;
78  };
79
80  union {
81    struct DTB DerivedToBase;
82    FieldDecl *Field;
83    struct P Ptr;
84  };
85
86  SubobjectAdjustment(const CastExpr *BasePath,
87                      const CXXRecordDecl *DerivedClass)
88    : Kind(DerivedToBaseAdjustment) {
89    DerivedToBase.BasePath = BasePath;
90    DerivedToBase.DerivedClass = DerivedClass;
91  }
92
93  SubobjectAdjustment(FieldDecl *Field)
94    : Kind(FieldAdjustment) {
95    this->Field = Field;
96  }
97
98  SubobjectAdjustment(const MemberPointerType *MPTExpr *RHS)
99    : Kind(MemberPointerAdjustment) {
100    this->Ptr.MPT = MPT;
101    this->Ptr.RHS = RHS;
102  }
103};
104
105/// This represents one expression.  Note that Expr's are subclasses of Stmt.
106/// This allows an expression to be transparently used any place a Stmt is
107/// required.
108class Expr : public ValueStmt {
109  QualType TR;
110
111protected:
112  Expr(StmtClass SCQualType TExprValueKind VKExprObjectKind OK,
113       bool TDbool VDbool IDbool ContainsUnexpandedParameterPack)
114    : ValueStmt(SC)
115  {
116    ExprBits.TypeDependent = TD;
117    ExprBits.ValueDependent = VD;
118    ExprBits.InstantiationDependent = ID;
119    ExprBits.ValueKind = VK;
120    ExprBits.ObjectKind = OK;
121     (0) . __assert_fail ("ExprBits.ObjectKind == OK && \"truncated kind\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 121, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(ExprBits.ObjectKind == OK && "truncated kind");
122    ExprBits.ContainsUnexpandedParameterPack = ContainsUnexpandedParameterPack;
123    setType(T);
124  }
125
126  /// Construct an empty expression.
127  explicit Expr(StmtClass SCEmptyShell) : ValueStmt(SC) { }
128
129public:
130  QualType getType() const { return TR; }
131  void setType(QualType t) {
132    // In C++, the type of an expression is always adjusted so that it
133    // will not have reference type (C++ [expr]p6). Use
134    // QualType::getNonReferenceType() to retrieve the non-reference
135    // type. Additionally, inspect Expr::isLvalue to determine whether
136    // an expression that is adjusted in this manner should be
137    // considered an lvalue.
138     (0) . __assert_fail ("(t.isNull() || !t->isReferenceType()) && \"Expressions can't have reference type\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 139, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert((t.isNull() || !t->isReferenceType()) &&
139 (0) . __assert_fail ("(t.isNull() || !t->isReferenceType()) && \"Expressions can't have reference type\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 139, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "Expressions can't have reference type");
140
141    TR = t;
142  }
143
144  /// isValueDependent - Determines whether this expression is
145  /// value-dependent (C++ [temp.dep.constexpr]). For example, the
146  /// array bound of "Chars" in the following example is
147  /// value-dependent.
148  /// @code
149  /// template<int Size, char (&Chars)[Size]> struct meta_string;
150  /// @endcode
151  bool isValueDependent() const { return ExprBits.ValueDependent; }
152
153  /// Set whether this expression is value-dependent or not.
154  void setValueDependent(bool VD) {
155    ExprBits.ValueDependent = VD;
156  }
157
158  /// isTypeDependent - Determines whether this expression is
159  /// type-dependent (C++ [temp.dep.expr]), which means that its type
160  /// could change from one template instantiation to the next. For
161  /// example, the expressions "x" and "x + y" are type-dependent in
162  /// the following code, but "y" is not type-dependent:
163  /// @code
164  /// template<typename T>
165  /// void add(T x, int y) {
166  ///   x + y;
167  /// }
168  /// @endcode
169  bool isTypeDependent() const { return ExprBits.TypeDependent; }
170
171  /// Set whether this expression is type-dependent or not.
172  void setTypeDependent(bool TD) {
173    ExprBits.TypeDependent = TD;
174  }
175
176  /// Whether this expression is instantiation-dependent, meaning that
177  /// it depends in some way on a template parameter, even if neither its type
178  /// nor (constant) value can change due to the template instantiation.
179  ///
180  /// In the following example, the expression \c sizeof(sizeof(T() + T())) is
181  /// instantiation-dependent (since it involves a template parameter \c T), but
182  /// is neither type- nor value-dependent, since the type of the inner
183  /// \c sizeof is known (\c std::size_t) and therefore the size of the outer
184  /// \c sizeof is known.
185  ///
186  /// \code
187  /// template<typename T>
188  /// void f(T x, T y) {
189  ///   sizeof(sizeof(T() + T());
190  /// }
191  /// \endcode
192  ///
193  bool isInstantiationDependent() const {
194    return ExprBits.InstantiationDependent;
195  }
196
197  /// Set whether this expression is instantiation-dependent or not.
198  void setInstantiationDependent(bool ID) {
199    ExprBits.InstantiationDependent = ID;
200  }
201
202  /// Whether this expression contains an unexpanded parameter
203  /// pack (for C++11 variadic templates).
204  ///
205  /// Given the following function template:
206  ///
207  /// \code
208  /// template<typename F, typename ...Types>
209  /// void forward(const F &f, Types &&...args) {
210  ///   f(static_cast<Types&&>(args)...);
211  /// }
212  /// \endcode
213  ///
214  /// The expressions \c args and \c static_cast<Types&&>(args) both
215  /// contain parameter packs.
216  bool containsUnexpandedParameterPack() const {
217    return ExprBits.ContainsUnexpandedParameterPack;
218  }
219
220  /// Set the bit that describes whether this expression
221  /// contains an unexpanded parameter pack.
222  void setContainsUnexpandedParameterPack(bool PP = true) {
223    ExprBits.ContainsUnexpandedParameterPack = PP;
224  }
225
226  /// getExprLoc - Return the preferred location for the arrow when diagnosing
227  /// a problem with a generic expression.
228  SourceLocation getExprLoc() const LLVM_READONLY;
229
230  /// isUnusedResultAWarning - Return true if this immediate expression should
231  /// be warned about if the result is unused.  If so, fill in expr, location,
232  /// and ranges with expr to warn on and source locations/ranges appropriate
233  /// for a warning.
234  bool isUnusedResultAWarning(const Expr *&WarnExprSourceLocation &Loc,
235                              SourceRange &R1SourceRange &R2,
236                              ASTContext &Ctxconst;
237
238  /// isLValue - True if this expression is an "l-value" according to
239  /// the rules of the current language.  C and C++ give somewhat
240  /// different rules for this concept, but in general, the result of
241  /// an l-value expression identifies a specific object whereas the
242  /// result of an r-value expression is a value detached from any
243  /// specific storage.
244  ///
245  /// C++11 divides the concept of "r-value" into pure r-values
246  /// ("pr-values") and so-called expiring values ("x-values"), which
247  /// identify specific objects that can be safely cannibalized for
248  /// their resources.  This is an unfortunate abuse of terminology on
249  /// the part of the C++ committee.  In Clang, when we say "r-value",
250  /// we generally mean a pr-value.
251  bool isLValue() const { return getValueKind() == VK_LValue; }
252  bool isRValue() const { return getValueKind() == VK_RValue; }
253  bool isXValue() const { return getValueKind() == VK_XValue; }
254  bool isGLValue() const { return getValueKind() != VK_RValue; }
255
256  enum LValueClassification {
257    LV_Valid,
258    LV_NotObjectType,
259    LV_IncompleteVoidType,
260    LV_DuplicateVectorComponents,
261    LV_InvalidExpression,
262    LV_InvalidMessageExpression,
263    LV_MemberFunction,
264    LV_SubObjCPropertySetting,
265    LV_ClassTemporary,
266    LV_ArrayTemporary
267  };
268  /// Reasons why an expression might not be an l-value.
269  LValueClassification ClassifyLValue(ASTContext &Ctxconst;
270
271  enum isModifiableLvalueResult {
272    MLV_Valid,
273    MLV_NotObjectType,
274    MLV_IncompleteVoidType,
275    MLV_DuplicateVectorComponents,
276    MLV_InvalidExpression,
277    MLV_LValueCast,           // Specialized form of MLV_InvalidExpression.
278    MLV_IncompleteType,
279    MLV_ConstQualified,
280    MLV_ConstQualifiedField,
281    MLV_ConstAddrSpace,
282    MLV_ArrayType,
283    MLV_NoSetterProperty,
284    MLV_MemberFunction,
285    MLV_SubObjCPropertySetting,
286    MLV_InvalidMessageExpression,
287    MLV_ClassTemporary,
288    MLV_ArrayTemporary
289  };
290  /// isModifiableLvalue - C99 6.3.2.1: an lvalue that does not have array type,
291  /// does not have an incomplete type, does not have a const-qualified type,
292  /// and if it is a structure or union, does not have any member (including,
293  /// recursively, any member or element of all contained aggregates or unions)
294  /// with a const-qualified type.
295  ///
296  /// \param Loc [in,out] - A source location which *may* be filled
297  /// in with the location of the expression making this a
298  /// non-modifiable lvalue, if specified.
299  isModifiableLvalueResult
300  isModifiableLvalue(ASTContext &CtxSourceLocation *Loc = nullptrconst;
301
302  /// The return type of classify(). Represents the C++11 expression
303  ///        taxonomy.
304  class Classification {
305  public:
306    /// The various classification results. Most of these mean prvalue.
307    enum Kinds {
308      CL_LValue,
309      CL_XValue,
310      CL_Function// Functions cannot be lvalues in C.
311      CL_Void// Void cannot be an lvalue in C.
312      CL_AddressableVoid// Void expression whose address can be taken in C.
313      CL_DuplicateVectorComponents// A vector shuffle with dupes.
314      CL_MemberFunction// An expression referring to a member function
315      CL_SubObjCPropertySetting,
316      CL_ClassTemporary// A temporary of class type, or subobject thereof.
317      CL_ArrayTemporary// A temporary of array type.
318      CL_ObjCMessageRValue// ObjC message is an rvalue
319      CL_PRValue // A prvalue for any other reason, of any other type
320    };
321    /// The results of modification testing.
322    enum ModifiableType {
323      CM_Untested// testModifiable was false.
324      CM_Modifiable,
325      CM_RValue// Not modifiable because it's an rvalue
326      CM_Function// Not modifiable because it's a function; C++ only
327      CM_LValueCast// Same as CM_RValue, but indicates GCC cast-as-lvalue ext
328      CM_NoSetterProperty,// Implicit assignment to ObjC property without setter
329      CM_ConstQualified,
330      CM_ConstQualifiedField,
331      CM_ConstAddrSpace,
332      CM_ArrayType,
333      CM_IncompleteType
334    };
335
336  private:
337    friend class Expr;
338
339    unsigned short Kind;
340    unsigned short Modifiable;
341
342    explicit Classification(Kinds kModifiableType m)
343      : Kind(k), Modifiable(m)
344    {}
345
346  public:
347    Classification() {}
348
349    Kinds getKind() const { return static_cast<Kinds>(Kind); }
350    ModifiableType getModifiable() const {
351       (0) . __assert_fail ("Modifiable != CM_Untested && \"Did not test for modifiability.\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 351, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(Modifiable != CM_Untested && "Did not test for modifiability.");
352      return static_cast<ModifiableType>(Modifiable);
353    }
354    bool isLValue() const { return Kind == CL_LValue; }
355    bool isXValue() const { return Kind == CL_XValue; }
356    bool isGLValue() const { return Kind <= CL_XValue; }
357    bool isPRValue() const { return Kind >= CL_Function; }
358    bool isRValue() const { return Kind >= CL_XValue; }
359    bool isModifiable() const { return getModifiable() == CM_Modifiable; }
360
361    /// Create a simple, modifiably lvalue
362    static Classification makeSimpleLValue() {
363      return Classification(CL_LValueCM_Modifiable);
364    }
365
366  };
367  /// Classify - Classify this expression according to the C++11
368  ///        expression taxonomy.
369  ///
370  /// C++11 defines ([basic.lval]) a new taxonomy of expressions to replace the
371  /// old lvalue vs rvalue. This function determines the type of expression this
372  /// is. There are three expression types:
373  /// - lvalues are classical lvalues as in C++03.
374  /// - prvalues are equivalent to rvalues in C++03.
375  /// - xvalues are expressions yielding unnamed rvalue references, e.g. a
376  ///   function returning an rvalue reference.
377  /// lvalues and xvalues are collectively referred to as glvalues, while
378  /// prvalues and xvalues together form rvalues.
379  Classification Classify(ASTContext &Ctxconst {
380    return ClassifyImpl(Ctxnullptr);
381  }
382
383  /// ClassifyModifiable - Classify this expression according to the
384  ///        C++11 expression taxonomy, and see if it is valid on the left side
385  ///        of an assignment.
386  ///
387  /// This function extends classify in that it also tests whether the
388  /// expression is modifiable (C99 6.3.2.1p1).
389  /// \param Loc A source location that might be filled with a relevant location
390  ///            if the expression is not modifiable.
391  Classification ClassifyModifiable(ASTContext &CtxSourceLocation &Locconst{
392    return ClassifyImpl(Ctx, &Loc);
393  }
394
395  /// getValueKindForType - Given a formal return or parameter type,
396  /// give its value kind.
397  static ExprValueKind getValueKindForType(QualType T) {
398    if (const ReferenceType *RT = T->getAs<ReferenceType>())
399      return (isa<LValueReferenceType>(RT)
400                ? VK_LValue
401                : (RT->getPointeeType()->isFunctionType()
402                     ? VK_LValue : VK_XValue));
403    return VK_RValue;
404  }
405
406  /// getValueKind - The value kind that this expression produces.
407  ExprValueKind getValueKind() const {
408    return static_cast<ExprValueKind>(ExprBits.ValueKind);
409  }
410
411  /// getObjectKind - The object kind that this expression produces.
412  /// Object kinds are meaningful only for expressions that yield an
413  /// l-value or x-value.
414  ExprObjectKind getObjectKind() const {
415    return static_cast<ExprObjectKind>(ExprBits.ObjectKind);
416  }
417
418  bool isOrdinaryOrBitFieldObject() const {
419    ExprObjectKind OK = getObjectKind();
420    return (OK == OK_Ordinary || OK == OK_BitField);
421  }
422
423  /// setValueKind - Set the value kind produced by this expression.
424  void setValueKind(ExprValueKind Cat) { ExprBits.ValueKind = Cat; }
425
426  /// setObjectKind - Set the object kind produced by this expression.
427  void setObjectKind(ExprObjectKind Cat) { ExprBits.ObjectKind = Cat; }
428
429private:
430  Classification ClassifyImpl(ASTContext &CtxSourceLocation *Locconst;
431
432public:
433
434  /// Returns true if this expression is a gl-value that
435  /// potentially refers to a bit-field.
436  ///
437  /// In C++, whether a gl-value refers to a bitfield is essentially
438  /// an aspect of the value-kind type system.
439  bool refersToBitField() const { return getObjectKind() == OK_BitField; }
440
441  /// If this expression refers to a bit-field, retrieve the
442  /// declaration of that bit-field.
443  ///
444  /// Note that this returns a non-null pointer in subtly different
445  /// places than refersToBitField returns true.  In particular, this can
446  /// return a non-null pointer even for r-values loaded from
447  /// bit-fields, but it will return null for a conditional bit-field.
448  FieldDecl *getSourceBitField();
449
450  const FieldDecl *getSourceBitField() const {
451    return const_cast<Expr*>(this)->getSourceBitField();
452  }
453
454  Decl *getReferencedDeclOfCallee();
455  const Decl *getReferencedDeclOfCallee() const {
456    return const_cast<Expr*>(this)->getReferencedDeclOfCallee();
457  }
458
459  /// If this expression is an l-value for an Objective C
460  /// property, find the underlying property reference expression.
461  const ObjCPropertyRefExpr *getObjCProperty() const;
462
463  /// Check if this expression is the ObjC 'self' implicit parameter.
464  bool isObjCSelfExpr() const;
465
466  /// Returns whether this expression refers to a vector element.
467  bool refersToVectorElement() const;
468
469  /// Returns whether this expression refers to a global register
470  /// variable.
471  bool refersToGlobalRegisterVar() const;
472
473  /// Returns whether this expression has a placeholder type.
474  bool hasPlaceholderType() const {
475    return getType()->isPlaceholderType();
476  }
477
478  /// Returns whether this expression has a specific placeholder type.
479  bool hasPlaceholderType(BuiltinType::Kind Kconst {
480    assert(BuiltinType::isPlaceholderTypeKind(K));
481    if (const BuiltinType *BT = dyn_cast<BuiltinType>(getType()))
482      return BT->getKind() == K;
483    return false;
484  }
485
486  /// isKnownToHaveBooleanValue - Return true if this is an integer expression
487  /// that is known to return 0 or 1.  This happens for _Bool/bool expressions
488  /// but also int expressions which are produced by things like comparisons in
489  /// C.
490  bool isKnownToHaveBooleanValue() const;
491
492  /// isIntegerConstantExpr - Return true if this expression is a valid integer
493  /// constant expression, and, if so, return its value in Result.  If not a
494  /// valid i-c-e, return false and fill in Loc (if specified) with the location
495  /// of the invalid expression.
496  ///
497  /// Note: This does not perform the implicit conversions required by C++11
498  /// [expr.const]p5.
499  bool isIntegerConstantExpr(llvm::APSInt &Resultconst ASTContext &Ctx,
500                             SourceLocation *Loc = nullptr,
501                             bool isEvaluated = trueconst;
502  bool isIntegerConstantExpr(const ASTContext &Ctx,
503                             SourceLocation *Loc = nullptrconst;
504
505  /// isCXX98IntegralConstantExpr - Return true if this expression is an
506  /// integral constant expression in C++98. Can only be used in C++.
507  bool isCXX98IntegralConstantExpr(const ASTContext &Ctxconst;
508
509  /// isCXX11ConstantExpr - Return true if this expression is a constant
510  /// expression in C++11. Can only be used in C++.
511  ///
512  /// Note: This does not perform the implicit conversions required by C++11
513  /// [expr.const]p5.
514  bool isCXX11ConstantExpr(const ASTContext &CtxAPValue *Result = nullptr,
515                           SourceLocation *Loc = nullptrconst;
516
517  /// isPotentialConstantExpr - Return true if this function's definition
518  /// might be usable in a constant expression in C++11, if it were marked
519  /// constexpr. Return false if the function can never produce a constant
520  /// expression, along with diagnostics describing why not.
521  static bool isPotentialConstantExpr(const FunctionDecl *FD,
522                                      SmallVectorImpl<
523                                        PartialDiagnosticAt> &Diags);
524
525  /// isPotentialConstantExprUnevaluted - Return true if this expression might
526  /// be usable in a constant expression in C++11 in an unevaluated context, if
527  /// it were in function FD marked constexpr. Return false if the function can
528  /// never produce a constant expression, along with diagnostics describing
529  /// why not.
530  static bool isPotentialConstantExprUnevaluated(Expr *E,
531                                                 const FunctionDecl *FD,
532                                                 SmallVectorImpl<
533                                                   PartialDiagnosticAt> &Diags);
534
535  /// isConstantInitializer - Returns true if this expression can be emitted to
536  /// IR as a constant, and thus can be used as a constant initializer in C.
537  /// If this expression is not constant and Culprit is non-null,
538  /// it is used to store the address of first non constant expr.
539  bool isConstantInitializer(ASTContext &Ctxbool ForRef,
540                             const Expr **Culprit = nullptrconst;
541
542  /// EvalStatus is a struct with detailed info about an evaluation in progress.
543  struct EvalStatus {
544    /// Whether the evaluated expression has side effects.
545    /// For example, (f() && 0) can be folded, but it still has side effects.
546    bool HasSideEffects;
547
548    /// Whether the evaluation hit undefined behavior.
549    /// For example, 1.0 / 0.0 can be folded to Inf, but has undefined behavior.
550    /// Likewise, INT_MAX + 1 can be folded to INT_MIN, but has UB.
551    bool HasUndefinedBehavior;
552
553    /// Diag - If this is non-null, it will be filled in with a stack of notes
554    /// indicating why evaluation failed (or why it failed to produce a constant
555    /// expression).
556    /// If the expression is unfoldable, the notes will indicate why it's not
557    /// foldable. If the expression is foldable, but not a constant expression,
558    /// the notes will describes why it isn't a constant expression. If the
559    /// expression *is* a constant expression, no notes will be produced.
560    SmallVectorImpl<PartialDiagnosticAt> *Diag;
561
562    EvalStatus()
563        : HasSideEffects(false), HasUndefinedBehavior(false), Diag(nullptr) {}
564
565    // hasSideEffects - Return true if the evaluated expression has
566    // side effects.
567    bool hasSideEffects() const {
568      return HasSideEffects;
569    }
570  };
571
572  /// EvalResult is a struct with detailed info about an evaluated expression.
573  struct EvalResult : EvalStatus {
574    /// Val - This is the value the expression can be folded to.
575    APValue Val;
576
577    // isGlobalLValue - Return true if the evaluated lvalue expression
578    // is global.
579    bool isGlobalLValue() const;
580  };
581
582  /// EvaluateAsRValue - Return true if this is a constant which we can fold to
583  /// an rvalue using any crazy technique (that has nothing to do with language
584  /// standards) that we want to, even if the expression has side-effects. If
585  /// this function returns true, it returns the folded constant in Result. If
586  /// the expression is a glvalue, an lvalue-to-rvalue conversion will be
587  /// applied.
588  bool EvaluateAsRValue(EvalResult &Resultconst ASTContext &Ctx,
589                        bool InConstantContext = falseconst;
590
591  /// EvaluateAsBooleanCondition - Return true if this is a constant
592  /// which we can fold and convert to a boolean condition using
593  /// any crazy technique that we want to, even if the expression has
594  /// side-effects.
595  bool EvaluateAsBooleanCondition(bool &Resultconst ASTContext &Ctxconst;
596
597  enum SideEffectsKind {
598    SE_NoSideEffects,          ///< Strictly evaluate the expression.
599    SE_AllowUndefinedBehavior///< Allow UB that we can give a value, but not
600                               ///< arbitrary unmodeled side effects.
601    SE_AllowSideEffects        ///< Allow any unmodeled side effect.
602  };
603
604  /// EvaluateAsInt - Return true if this is a constant which we can fold and
605  /// convert to an integer, using any crazy technique that we want to.
606  bool EvaluateAsInt(EvalResult &Resultconst ASTContext &Ctx,
607                     SideEffectsKind AllowSideEffects = SE_NoSideEffectsconst;
608
609  /// EvaluateAsFloat - Return true if this is a constant which we can fold and
610  /// convert to a floating point value, using any crazy technique that we
611  /// want to.
612  bool
613  EvaluateAsFloat(llvm::APFloat &Resultconst ASTContext &Ctx,
614                  SideEffectsKind AllowSideEffects = SE_NoSideEffectsconst;
615
616  /// EvaluateAsFloat - Return true if this is a constant which we can fold and
617  /// convert to a fixed point value.
618  bool EvaluateAsFixedPoint(
619      EvalResult &Resultconst ASTContext &Ctx,
620      SideEffectsKind AllowSideEffects = SE_NoSideEffectsconst;
621
622  /// isEvaluatable - Call EvaluateAsRValue to see if this expression can be
623  /// constant folded without side-effects, but discard the result.
624  bool isEvaluatable(const ASTContext &Ctx,
625                     SideEffectsKind AllowSideEffects = SE_NoSideEffectsconst;
626
627  /// HasSideEffects - This routine returns true for all those expressions
628  /// which have any effect other than producing a value. Example is a function
629  /// call, volatile variable read, or throwing an exception. If
630  /// IncludePossibleEffects is false, this call treats certain expressions with
631  /// potential side effects (such as function call-like expressions,
632  /// instantiation-dependent expressions, or invocations from a macro) as not
633  /// having side effects.
634  bool HasSideEffects(const ASTContext &Ctx,
635                      bool IncludePossibleEffects = trueconst;
636
637  /// Determine whether this expression involves a call to any function
638  /// that is not trivial.
639  bool hasNonTrivialCall(const ASTContext &Ctxconst;
640
641  /// EvaluateKnownConstInt - Call EvaluateAsRValue and return the folded
642  /// integer. This must be called on an expression that constant folds to an
643  /// integer.
644  llvm::APSInt EvaluateKnownConstInt(
645      const ASTContext &Ctx,
646      SmallVectorImpl<PartialDiagnosticAt> *Diag = nullptrconst;
647
648  llvm::APSInt EvaluateKnownConstIntCheckOverflow(
649      const ASTContext &Ctx,
650      SmallVectorImpl<PartialDiagnosticAt> *Diag = nullptrconst;
651
652  void EvaluateForOverflow(const ASTContext &Ctxconst;
653
654  /// EvaluateAsLValue - Evaluate an expression to see if we can fold it to an
655  /// lvalue with link time known address, with no side-effects.
656  bool EvaluateAsLValue(EvalResult &Resultconst ASTContext &Ctxconst;
657
658  /// EvaluateAsInitializer - Evaluate an expression as if it were the
659  /// initializer of the given declaration. Returns true if the initializer
660  /// can be folded to a constant, and produces any relevant notes. In C++11,
661  /// notes will be produced if the expression is not a constant expression.
662  bool EvaluateAsInitializer(APValue &Resultconst ASTContext &Ctx,
663                             const VarDecl *VD,
664                             SmallVectorImpl<PartialDiagnosticAt> &Notesconst;
665
666  /// EvaluateWithSubstitution - Evaluate an expression as if from the context
667  /// of a call to the given function with the given arguments, inside an
668  /// unevaluated context. Returns true if the expression could be folded to a
669  /// constant.
670  bool EvaluateWithSubstitution(APValue &ValueASTContext &Ctx,
671                                const FunctionDecl *Callee,
672                                ArrayRef<const Expr*> Args,
673                                const Expr *This = nullptrconst;
674
675  /// Indicates how the constant expression will be used.
676  enum ConstExprUsage { EvaluateForCodeGenEvaluateForMangling };
677
678  /// Evaluate an expression that is required to be a constant expression.
679  bool EvaluateAsConstantExpr(EvalResult &ResultConstExprUsage Usage,
680                              const ASTContext &Ctxconst;
681
682  /// If the current Expr is a pointer, this will try to statically
683  /// determine the number of bytes available where the pointer is pointing.
684  /// Returns true if all of the above holds and we were able to figure out the
685  /// size, false otherwise.
686  ///
687  /// \param Type - How to evaluate the size of the Expr, as defined by the
688  /// "type" parameter of __builtin_object_size
689  bool tryEvaluateObjectSize(uint64_t &ResultASTContext &Ctx,
690                             unsigned Typeconst;
691
692  /// Enumeration used to describe the kind of Null pointer constant
693  /// returned from \c isNullPointerConstant().
694  enum NullPointerConstantKind {
695    /// Expression is not a Null pointer constant.
696    NPCK_NotNull = 0,
697
698    /// Expression is a Null pointer constant built from a zero integer
699    /// expression that is not a simple, possibly parenthesized, zero literal.
700    /// C++ Core Issue 903 will classify these expressions as "not pointers"
701    /// once it is adopted.
702    /// http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#903
703    NPCK_ZeroExpression,
704
705    /// Expression is a Null pointer constant built from a literal zero.
706    NPCK_ZeroLiteral,
707
708    /// Expression is a C++11 nullptr.
709    NPCK_CXX11_nullptr,
710
711    /// Expression is a GNU-style __null constant.
712    NPCK_GNUNull
713  };
714
715  /// Enumeration used to describe how \c isNullPointerConstant()
716  /// should cope with value-dependent expressions.
717  enum NullPointerConstantValueDependence {
718    /// Specifies that the expression should never be value-dependent.
719    NPC_NeverValueDependent = 0,
720
721    /// Specifies that a value-dependent expression of integral or
722    /// dependent type should be considered a null pointer constant.
723    NPC_ValueDependentIsNull,
724
725    /// Specifies that a value-dependent expression should be considered
726    /// to never be a null pointer constant.
727    NPC_ValueDependentIsNotNull
728  };
729
730  /// isNullPointerConstant - C99 6.3.2.3p3 - Test if this reduces down to
731  /// a Null pointer constant. The return value can further distinguish the
732  /// kind of NULL pointer constant that was detected.
733  NullPointerConstantKind isNullPointerConstant(
734      ASTContext &Ctx,
735      NullPointerConstantValueDependence NPCconst;
736
737  /// isOBJCGCCandidate - Return true if this expression may be used in a read/
738  /// write barrier.
739  bool isOBJCGCCandidate(ASTContext &Ctxconst;
740
741  /// Returns true if this expression is a bound member function.
742  bool isBoundMemberFunction(ASTContext &Ctxconst;
743
744  /// Given an expression of bound-member type, find the type
745  /// of the member.  Returns null if this is an *overloaded* bound
746  /// member expression.
747  static QualType findBoundMemberType(const Expr *expr);
748
749  /// Skip past any implicit casts which might surround this expression until
750  /// reaching a fixed point. Skips:
751  /// * ImplicitCastExpr
752  /// * FullExpr
753  Expr *IgnoreImpCasts() LLVM_READONLY;
754  const Expr *IgnoreImpCasts() const {
755    return const_cast<Expr *>(this)->IgnoreImpCasts();
756  }
757
758  /// Skip past any casts which might surround this expression until reaching
759  /// a fixed point. Skips:
760  /// * CastExpr
761  /// * FullExpr
762  /// * MaterializeTemporaryExpr
763  /// * SubstNonTypeTemplateParmExpr
764  Expr *IgnoreCasts() LLVM_READONLY;
765  const Expr *IgnoreCasts() const {
766    return const_cast<Expr *>(this)->IgnoreCasts();
767  }
768
769  /// Skip past any implicit AST nodes which might surround this expression
770  /// until reaching a fixed point. Skips:
771  /// * What IgnoreImpCasts() skips
772  /// * MaterializeTemporaryExpr
773  /// * CXXBindTemporaryExpr
774  Expr *IgnoreImplicit() LLVM_READONLY;
775  const Expr *IgnoreImplicit() const {
776    return const_cast<Expr *>(this)->IgnoreImplicit();
777  }
778
779  /// Skip past any parentheses which might surround this expression until
780  /// reaching a fixed point. Skips:
781  /// * ParenExpr
782  /// * UnaryOperator if `UO_Extension`
783  /// * GenericSelectionExpr if `!isResultDependent()`
784  /// * ChooseExpr if `!isConditionDependent()`
785  /// * ConstantExpr
786  Expr *IgnoreParens() LLVM_READONLY;
787  const Expr *IgnoreParens() const {
788    return const_cast<Expr *>(this)->IgnoreParens();
789  }
790
791  /// Skip past any parentheses and implicit casts which might surround this
792  /// expression until reaching a fixed point.
793  /// FIXME: IgnoreParenImpCasts really ought to be equivalent to
794  /// IgnoreParens() + IgnoreImpCasts() until reaching a fixed point. However
795  /// this is currently not the case. Instead IgnoreParenImpCasts() skips:
796  /// * What IgnoreParens() skips
797  /// * What IgnoreImpCasts() skips
798  /// * MaterializeTemporaryExpr
799  /// * SubstNonTypeTemplateParmExpr
800  Expr *IgnoreParenImpCasts() LLVM_READONLY;
801  const Expr *IgnoreParenImpCasts() const {
802    return const_cast<Expr *>(this)->IgnoreParenImpCasts();
803  }
804
805  /// Skip past any parentheses and casts which might surround this expression
806  /// until reaching a fixed point. Skips:
807  /// * What IgnoreParens() skips
808  /// * What IgnoreCasts() skips
809  Expr *IgnoreParenCasts() LLVM_READONLY;
810  const Expr *IgnoreParenCasts() const {
811    return const_cast<Expr *>(this)->IgnoreParenCasts();
812  }
813
814  /// Skip conversion operators. If this Expr is a call to a conversion
815  /// operator, return the argument.
816  Expr *IgnoreConversionOperator() LLVM_READONLY;
817  const Expr *IgnoreConversionOperator() const {
818    return const_cast<Expr *>(this)->IgnoreConversionOperator();
819  }
820
821  /// Skip past any parentheses and lvalue casts which might surround this
822  /// expression until reaching a fixed point. Skips:
823  /// * What IgnoreParens() skips
824  /// * What IgnoreCasts() skips, except that only lvalue-to-rvalue
825  ///   casts are skipped
826  /// FIXME: This is intended purely as a temporary workaround for code
827  /// that hasn't yet been rewritten to do the right thing about those
828  /// casts, and may disappear along with the last internal use.
829  Expr *IgnoreParenLValueCasts() LLVM_READONLY;
830  const Expr *IgnoreParenLValueCasts() const {
831    return const_cast<Expr *>(this)->IgnoreParenLValueCasts();
832  }
833
834  /// Skip past any parenthese and casts which do not change the value
835  /// (including ptr->int casts of the same size) until reaching a fixed point.
836  /// Skips:
837  /// * What IgnoreParens() skips
838  /// * CastExpr which do not change the value
839  /// * SubstNonTypeTemplateParmExpr
840  Expr *IgnoreParenNoopCasts(const ASTContext &Ctx) LLVM_READONLY;
841  const Expr *IgnoreParenNoopCasts(const ASTContext &Ctxconst {
842    return const_cast<Expr *>(this)->IgnoreParenNoopCasts(Ctx);
843  }
844
845  /// Skip past any parentheses and derived-to-base casts until reaching a
846  /// fixed point. Skips:
847  /// * What IgnoreParens() skips
848  /// * CastExpr which represent a derived-to-base cast (CK_DerivedToBase,
849  ///   CK_UncheckedDerivedToBase and CK_NoOp)
850  Expr *ignoreParenBaseCasts() LLVM_READONLY;
851  const Expr *ignoreParenBaseCasts() const {
852    return const_cast<Expr *>(this)->ignoreParenBaseCasts();
853  }
854
855  /// Determine whether this expression is a default function argument.
856  ///
857  /// Default arguments are implicitly generated in the abstract syntax tree
858  /// by semantic analysis for function calls, object constructions, etc. in
859  /// C++. Default arguments are represented by \c CXXDefaultArgExpr nodes;
860  /// this routine also looks through any implicit casts to determine whether
861  /// the expression is a default argument.
862  bool isDefaultArgument() const;
863
864  /// Determine whether the result of this expression is a
865  /// temporary object of the given class type.
866  bool isTemporaryObject(ASTContext &Ctxconst CXXRecordDecl *TempTyconst;
867
868  /// Whether this expression is an implicit reference to 'this' in C++.
869  bool isImplicitCXXThis() const;
870
871  static bool hasAnyTypeDependentArguments(ArrayRef<Expr *> Exprs);
872
873  /// For an expression of class type or pointer to class type,
874  /// return the most derived class decl the expression is known to refer to.
875  ///
876  /// If this expression is a cast, this method looks through it to find the
877  /// most derived decl that can be inferred from the expression.
878  /// This is valid because derived-to-base conversions have undefined
879  /// behavior if the object isn't dynamically of the derived type.
880  const CXXRecordDecl *getBestDynamicClassType() const;
881
882  /// Get the inner expression that determines the best dynamic class.
883  /// If this is a prvalue, we guarantee that it is of the most-derived type
884  /// for the object itself.
885  const Expr *getBestDynamicClassTypeExpr() const;
886
887  /// Walk outwards from an expression we want to bind a reference to and
888  /// find the expression whose lifetime needs to be extended. Record
889  /// the LHSs of comma expressions and adjustments needed along the path.
890  const Expr *skipRValueSubobjectAdjustments(
891      SmallVectorImpl<const Expr *> &CommaLHS,
892      SmallVectorImpl<SubobjectAdjustment> &Adjustmentsconst;
893  const Expr *skipRValueSubobjectAdjustments() const {
894    SmallVector<const Expr *, 8CommaLHSs;
895    SmallVector<SubobjectAdjustment8Adjustments;
896    return skipRValueSubobjectAdjustments(CommaLHSs, Adjustments);
897  }
898
899  static bool classof(const Stmt *T) {
900    return T->getStmtClass() >= firstExprConstant &&
901           T->getStmtClass() <= lastExprConstant;
902  }
903};
904
905//===----------------------------------------------------------------------===//
906// Wrapper Expressions.
907//===----------------------------------------------------------------------===//
908
909/// FullExpr - Represents a "full-expression" node.
910class FullExpr : public Expr {
911protected:
912 Stmt *SubExpr;
913
914 FullExpr(StmtClass SCExpr *subexpr)
915    : Expr(SCsubexpr->getType(),
916           subexpr->getValueKind(), subexpr->getObjectKind(),
917           subexpr->isTypeDependent(), subexpr->isValueDependent(),
918           subexpr->isInstantiationDependent(),
919           subexpr->containsUnexpandedParameterPack()), SubExpr(subexpr) {}
920  FullExpr(StmtClass SCEmptyShell Empty)
921    : Expr(SCEmpty) {}
922public:
923  const Expr *getSubExpr() const { return cast<Expr>(SubExpr); }
924  Expr *getSubExpr() { return cast<Expr>(SubExpr); }
925
926  /// As with any mutator of the AST, be very careful when modifying an
927  /// existing AST to preserve its invariants.
928  void setSubExpr(Expr *E) { SubExpr = E; }
929
930  static bool classof(const Stmt *T) {
931    return T->getStmtClass() >= firstFullExprConstant &&
932           T->getStmtClass() <= lastFullExprConstant;
933  }
934};
935
936/// ConstantExpr - An expression that occurs in a constant context.
937class ConstantExpr : public FullExpr {
938  ConstantExpr(Expr *subexpr)
939    : FullExpr(ConstantExprClass, subexpr) {}
940
941public:
942  static ConstantExpr *Create(const ASTContext &ContextExpr *E) {
943    (E)", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 943, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(!isa<ConstantExpr>(E));
944    return new (ContextConstantExpr(E);
945  }
946
947  /// Build an empty constant expression wrapper.
948  explicit ConstantExpr(EmptyShell Empty)
949    : FullExpr(ConstantExprClass, Empty) {}
950
951  SourceLocation getBeginLoc() const LLVM_READONLY {
952    return SubExpr->getBeginLoc();
953  }
954  SourceLocation getEndLoc() const LLVM_READONLY {
955    return SubExpr->getEndLoc();
956  }
957
958  static bool classof(const Stmt *T) {
959    return T->getStmtClass() == ConstantExprClass;
960  }
961
962  // Iterators
963  child_range children() { return child_range(&SubExpr, &SubExpr+1); }
964  const_child_range children() const {
965    return const_child_range(&SubExpr, &SubExpr + 1);
966  }
967};
968
969//===----------------------------------------------------------------------===//
970// Primary Expressions.
971//===----------------------------------------------------------------------===//
972
973/// OpaqueValueExpr - An expression referring to an opaque object of a
974/// fixed type and value class.  These don't correspond to concrete
975/// syntax; instead they're used to express operations (usually copy
976/// operations) on values whose source is generally obvious from
977/// context.
978class OpaqueValueExpr : public Expr {
979  friend class ASTStmtReader;
980  Expr *SourceExpr;
981
982public:
983  OpaqueValueExpr(SourceLocation LocQualType TExprValueKind VK,
984                  ExprObjectKind OK = OK_Ordinary,
985                  Expr *SourceExpr = nullptr)
986    : Expr(OpaqueValueExprClass, T, VK, OK,
987           T->isDependentType() ||
988           (SourceExpr && SourceExpr->isTypeDependent()),
989           T->isDependentType() ||
990           (SourceExpr && SourceExpr->isValueDependent()),
991           T->isInstantiationDependentType() ||
992           (SourceExpr && SourceExpr->isInstantiationDependent()),
993           false),
994      SourceExpr(SourceExpr) {
995    setIsUnique(false);
996    OpaqueValueExprBits.Loc = Loc;
997  }
998
999  /// Given an expression which invokes a copy constructor --- i.e.  a
1000  /// CXXConstructExpr, possibly wrapped in an ExprWithCleanups ---
1001  /// find the OpaqueValueExpr that's the source of the construction.
1002  static const OpaqueValueExpr *findInCopyConstruct(const Expr *expr);
1003
1004  explicit OpaqueValueExpr(EmptyShell Empty)
1005    : Expr(OpaqueValueExprClass, Empty) {}
1006
1007  /// Retrieve the location of this expression.
1008  SourceLocation getLocation() const { return OpaqueValueExprBits.Loc; }
1009
1010  SourceLocation getBeginLoc() const LLVM_READONLY {
1011    return SourceExpr ? SourceExpr->getBeginLoc() : getLocation();
1012  }
1013  SourceLocation getEndLoc() const LLVM_READONLY {
1014    return SourceExpr ? SourceExpr->getEndLoc() : getLocation();
1015  }
1016  SourceLocation getExprLoc() const LLVM_READONLY {
1017    return SourceExpr ? SourceExpr->getExprLoc() : getLocation();
1018  }
1019
1020  child_range children() {
1021    return child_range(child_iterator(), child_iterator());
1022  }
1023
1024  const_child_range children() const {
1025    return const_child_range(const_child_iterator(), const_child_iterator());
1026  }
1027
1028  /// The source expression of an opaque value expression is the
1029  /// expression which originally generated the value.  This is
1030  /// provided as a convenience for analyses that don't wish to
1031  /// precisely model the execution behavior of the program.
1032  ///
1033  /// The source expression is typically set when building the
1034  /// expression which binds the opaque value expression in the first
1035  /// place.
1036  Expr *getSourceExpr() const { return SourceExpr; }
1037
1038  void setIsUnique(bool V) {
1039     (0) . __assert_fail ("(!V || SourceExpr) && \"unique OVEs are expected to have source expressions\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 1040, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert((!V || SourceExpr) &&
1040 (0) . __assert_fail ("(!V || SourceExpr) && \"unique OVEs are expected to have source expressions\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 1040, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "unique OVEs are expected to have source expressions");
1041    OpaqueValueExprBits.IsUnique = V;
1042  }
1043
1044  bool isUnique() const { return OpaqueValueExprBits.IsUnique; }
1045
1046  static bool classof(const Stmt *T) {
1047    return T->getStmtClass() == OpaqueValueExprClass;
1048  }
1049};
1050
1051/// A reference to a declared variable, function, enum, etc.
1052/// [C99 6.5.1p2]
1053///
1054/// This encodes all the information about how a declaration is referenced
1055/// within an expression.
1056///
1057/// There are several optional constructs attached to DeclRefExprs only when
1058/// they apply in order to conserve memory. These are laid out past the end of
1059/// the object, and flags in the DeclRefExprBitfield track whether they exist:
1060///
1061///   DeclRefExprBits.HasQualifier:
1062///       Specifies when this declaration reference expression has a C++
1063///       nested-name-specifier.
1064///   DeclRefExprBits.HasFoundDecl:
1065///       Specifies when this declaration reference expression has a record of
1066///       a NamedDecl (different from the referenced ValueDecl) which was found
1067///       during name lookup and/or overload resolution.
1068///   DeclRefExprBits.HasTemplateKWAndArgsInfo:
1069///       Specifies when this declaration reference expression has an explicit
1070///       C++ template keyword and/or template argument list.
1071///   DeclRefExprBits.RefersToEnclosingVariableOrCapture
1072///       Specifies when this declaration reference expression (validly)
1073///       refers to an enclosed local or a captured variable.
1074class DeclRefExpr final
1075    : public Expr,
1076      private llvm::TrailingObjects<DeclRefExpr, NestedNameSpecifierLoc,
1077                                    NamedDecl *, ASTTemplateKWAndArgsInfo,
1078                                    TemplateArgumentLoc> {
1079  friend class ASTStmtReader;
1080  friend class ASTStmtWriter;
1081  friend TrailingObjects;
1082
1083  /// The declaration that we are referencing.
1084  ValueDecl *D;
1085
1086  /// Provides source/type location info for the declaration name
1087  /// embedded in D.
1088  DeclarationNameLoc DNLoc;
1089
1090  size_t numTrailingObjects(OverloadToken<NestedNameSpecifierLoc>) const {
1091    return hasQualifier();
1092  }
1093
1094  size_t numTrailingObjects(OverloadToken<NamedDecl *>) const {
1095    return hasFoundDecl();
1096  }
1097
1098  size_t numTrailingObjects(OverloadToken<ASTTemplateKWAndArgsInfo>) const {
1099    return hasTemplateKWAndArgsInfo();
1100  }
1101
1102  /// Test whether there is a distinct FoundDecl attached to the end of
1103  /// this DRE.
1104  bool hasFoundDecl() const { return DeclRefExprBits.HasFoundDecl; }
1105
1106  DeclRefExpr(const ASTContext &CtxNestedNameSpecifierLoc QualifierLoc,
1107              SourceLocation TemplateKWLocValueDecl *D,
1108              bool RefersToEnlosingVariableOrCapture,
1109              const DeclarationNameInfo &NameInfoNamedDecl *FoundD,
1110              const TemplateArgumentListInfo *TemplateArgsQualType T,
1111              ExprValueKind VK);
1112
1113  /// Construct an empty declaration reference expression.
1114  explicit DeclRefExpr(EmptyShell Empty) : Expr(DeclRefExprClass, Empty) {}
1115
1116  /// Computes the type- and value-dependence flags for this
1117  /// declaration reference expression.
1118  void computeDependence(const ASTContext &Ctx);
1119
1120public:
1121  DeclRefExpr(const ASTContext &CtxValueDecl *D,
1122              bool RefersToEnclosingVariableOrCaptureQualType T,
1123              ExprValueKind VKSourceLocation L,
1124              const DeclarationNameLoc &LocInfo = DeclarationNameLoc());
1125
1126  static DeclRefExpr *
1127  Create(const ASTContext &ContextNestedNameSpecifierLoc QualifierLoc,
1128         SourceLocation TemplateKWLocValueDecl *D,
1129         bool RefersToEnclosingVariableOrCaptureSourceLocation NameLoc,
1130         QualType TExprValueKind VKNamedDecl *FoundD = nullptr,
1131         const TemplateArgumentListInfo *TemplateArgs = nullptr);
1132
1133  static DeclRefExpr *
1134  Create(const ASTContext &ContextNestedNameSpecifierLoc QualifierLoc,
1135         SourceLocation TemplateKWLocValueDecl *D,
1136         bool RefersToEnclosingVariableOrCapture,
1137         const DeclarationNameInfo &NameInfoQualType TExprValueKind VK,
1138         NamedDecl *FoundD = nullptr,
1139         const TemplateArgumentListInfo *TemplateArgs = nullptr);
1140
1141  /// Construct an empty declaration reference expression.
1142  static DeclRefExpr *CreateEmpty(const ASTContext &Contextbool HasQualifier,
1143                                  bool HasFoundDecl,
1144                                  bool HasTemplateKWAndArgsInfo,
1145                                  unsigned NumTemplateArgs);
1146
1147  ValueDecl *getDecl() { return D; }
1148  const ValueDecl *getDecl() const { return D; }
1149  void setDecl(ValueDecl *NewD) { D = NewD; }
1150
1151  DeclarationNameInfo getNameInfo() const {
1152    return DeclarationNameInfo(getDecl()->getDeclName(), getLocation(), DNLoc);
1153  }
1154
1155  SourceLocation getLocation() const { return DeclRefExprBits.Loc; }
1156  void setLocation(SourceLocation L) { DeclRefExprBits.Loc = L; }
1157  SourceLocation getBeginLoc() const LLVM_READONLY;
1158  SourceLocation getEndLoc() const LLVM_READONLY;
1159
1160  /// Determine whether this declaration reference was preceded by a
1161  /// C++ nested-name-specifier, e.g., \c N::foo.
1162  bool hasQualifier() const { return DeclRefExprBits.HasQualifier; }
1163
1164  /// If the name was qualified, retrieves the nested-name-specifier
1165  /// that precedes the name, with source-location information.
1166  NestedNameSpecifierLoc getQualifierLoc() const {
1167    if (!hasQualifier())
1168      return NestedNameSpecifierLoc();
1169    return *getTrailingObjects<NestedNameSpecifierLoc>();
1170  }
1171
1172  /// If the name was qualified, retrieves the nested-name-specifier
1173  /// that precedes the name. Otherwise, returns NULL.
1174  NestedNameSpecifier *getQualifier() const {
1175    return getQualifierLoc().getNestedNameSpecifier();
1176  }
1177
1178  /// Get the NamedDecl through which this reference occurred.
1179  ///
1180  /// This Decl may be different from the ValueDecl actually referred to in the
1181  /// presence of using declarations, etc. It always returns non-NULL, and may
1182  /// simple return the ValueDecl when appropriate.
1183
1184  NamedDecl *getFoundDecl() {
1185    return hasFoundDecl() ? *getTrailingObjects<NamedDecl *>() : D;
1186  }
1187
1188  /// Get the NamedDecl through which this reference occurred.
1189  /// See non-const variant.
1190  const NamedDecl *getFoundDecl() const {
1191    return hasFoundDecl() ? *getTrailingObjects<NamedDecl *>() : D;
1192  }
1193
1194  bool hasTemplateKWAndArgsInfo() const {
1195    return DeclRefExprBits.HasTemplateKWAndArgsInfo;
1196  }
1197
1198  /// Retrieve the location of the template keyword preceding
1199  /// this name, if any.
1200  SourceLocation getTemplateKeywordLoc() const {
1201    if (!hasTemplateKWAndArgsInfo())
1202      return SourceLocation();
1203    return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->TemplateKWLoc;
1204  }
1205
1206  /// Retrieve the location of the left angle bracket starting the
1207  /// explicit template argument list following the name, if any.
1208  SourceLocation getLAngleLoc() const {
1209    if (!hasTemplateKWAndArgsInfo())
1210      return SourceLocation();
1211    return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->LAngleLoc;
1212  }
1213
1214  /// Retrieve the location of the right angle bracket ending the
1215  /// explicit template argument list following the name, if any.
1216  SourceLocation getRAngleLoc() const {
1217    if (!hasTemplateKWAndArgsInfo())
1218      return SourceLocation();
1219    return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->RAngleLoc;
1220  }
1221
1222  /// Determines whether the name in this declaration reference
1223  /// was preceded by the template keyword.
1224  bool hasTemplateKeyword() const { return getTemplateKeywordLoc().isValid(); }
1225
1226  /// Determines whether this declaration reference was followed by an
1227  /// explicit template argument list.
1228  bool hasExplicitTemplateArgs() const { return getLAngleLoc().isValid(); }
1229
1230  /// Copies the template arguments (if present) into the given
1231  /// structure.
1232  void copyTemplateArgumentsInto(TemplateArgumentListInfo &Listconst {
1233    if (hasExplicitTemplateArgs())
1234      getTrailingObjects<ASTTemplateKWAndArgsInfo>()->copyInto(
1235          getTrailingObjects<TemplateArgumentLoc>(), List);
1236  }
1237
1238  /// Retrieve the template arguments provided as part of this
1239  /// template-id.
1240  const TemplateArgumentLoc *getTemplateArgs() const {
1241    if (!hasExplicitTemplateArgs())
1242      return nullptr;
1243    return getTrailingObjects<TemplateArgumentLoc>();
1244  }
1245
1246  /// Retrieve the number of template arguments provided as part of this
1247  /// template-id.
1248  unsigned getNumTemplateArgs() const {
1249    if (!hasExplicitTemplateArgs())
1250      return 0;
1251    return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->NumTemplateArgs;
1252  }
1253
1254  ArrayRef<TemplateArgumentLoctemplate_arguments() const {
1255    return {getTemplateArgs(), getNumTemplateArgs()};
1256  }
1257
1258  /// Returns true if this expression refers to a function that
1259  /// was resolved from an overloaded set having size greater than 1.
1260  bool hadMultipleCandidates() const {
1261    return DeclRefExprBits.HadMultipleCandidates;
1262  }
1263  /// Sets the flag telling whether this expression refers to
1264  /// a function that was resolved from an overloaded set having size
1265  /// greater than 1.
1266  void setHadMultipleCandidates(bool V = true) {
1267    DeclRefExprBits.HadMultipleCandidates = V;
1268  }
1269
1270  /// Does this DeclRefExpr refer to an enclosing local or a captured
1271  /// variable?
1272  bool refersToEnclosingVariableOrCapture() const {
1273    return DeclRefExprBits.RefersToEnclosingVariableOrCapture;
1274  }
1275
1276  static bool classof(const Stmt *T) {
1277    return T->getStmtClass() == DeclRefExprClass;
1278  }
1279
1280  // Iterators
1281  child_range children() {
1282    return child_range(child_iterator(), child_iterator());
1283  }
1284
1285  const_child_range children() const {
1286    return const_child_range(const_child_iterator(), const_child_iterator());
1287  }
1288};
1289
1290/// Used by IntegerLiteral/FloatingLiteral to store the numeric without
1291/// leaking memory.
1292///
1293/// For large floats/integers, APFloat/APInt will allocate memory from the heap
1294/// to represent these numbers.  Unfortunately, when we use a BumpPtrAllocator
1295/// to allocate IntegerLiteral/FloatingLiteral nodes the memory associated with
1296/// the APFloat/APInt values will never get freed. APNumericStorage uses
1297/// ASTContext's allocator for memory allocation.
1298class APNumericStorage {
1299  union {
1300    uint64_t VAL;    ///< Used to store the <= 64 bits integer value.
1301    uint64_t *pVal;  ///< Used to store the >64 bits integer value.
1302  };
1303  unsigned BitWidth;
1304
1305  bool hasAllocation() const { return llvm::APInt::getNumWords(BitWidth) > 1; }
1306
1307  APNumericStorage(const APNumericStorage &) = delete;
1308  void operator=(const APNumericStorage &) = delete;
1309
1310protected:
1311  APNumericStorage() : VAL(0), BitWidth(0) { }
1312
1313  llvm::APInt getIntValue() const {
1314    unsigned NumWords = llvm::APInt::getNumWords(BitWidth);
1315    if (NumWords > 1)
1316      return llvm::APInt(BitWidth, NumWords, pVal);
1317    else
1318      return llvm::APInt(BitWidth, VAL);
1319  }
1320  void setIntValue(const ASTContext &Cconst llvm::APInt &Val);
1321};
1322
1323class APIntStorage : private APNumericStorage {
1324public:
1325  llvm::APInt getValue() const { return getIntValue(); }
1326  void setValue(const ASTContext &Cconst llvm::APInt &Val) {
1327    setIntValue(C, Val);
1328  }
1329};
1330
1331class APFloatStorage : private APNumericStorage {
1332public:
1333  llvm::APFloat getValue(const llvm::fltSemantics &Semantics) const {
1334    return llvm::APFloat(Semantics, getIntValue());
1335  }
1336  void setValue(const ASTContext &Cconst llvm::APFloat &Val) {
1337    setIntValue(C, Val.bitcastToAPInt());
1338  }
1339};
1340
1341class IntegerLiteral : public Exprpublic APIntStorage {
1342  SourceLocation Loc;
1343
1344  /// Construct an empty integer literal.
1345  explicit IntegerLiteral(EmptyShell Empty)
1346    : Expr(IntegerLiteralClass, Empty) { }
1347
1348public:
1349  // type should be IntTy, LongTy, LongLongTy, UnsignedIntTy, UnsignedLongTy,
1350  // or UnsignedLongLongTy
1351  IntegerLiteral(const ASTContext &Cconst llvm::APInt &VQualType type,
1352                 SourceLocation l);
1353
1354  /// Returns a new integer literal with value 'V' and type 'type'.
1355  /// \param type - either IntTy, LongTy, LongLongTy, UnsignedIntTy,
1356  /// UnsignedLongTy, or UnsignedLongLongTy which should match the size of V
1357  /// \param V - the value that the returned integer literal contains.
1358  static IntegerLiteral *Create(const ASTContext &Cconst llvm::APInt &V,
1359                                QualType typeSourceLocation l);
1360  /// Returns a new empty integer literal.
1361  static IntegerLiteral *Create(const ASTContext &CEmptyShell Empty);
1362
1363  SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; }
1364  SourceLocation getEndLoc() const LLVM_READONLY { return Loc; }
1365
1366  /// Retrieve the location of the literal.
1367  SourceLocation getLocation() const { return Loc; }
1368
1369  void setLocation(SourceLocation Location) { Loc = Location; }
1370
1371  static bool classof(const Stmt *T) {
1372    return T->getStmtClass() == IntegerLiteralClass;
1373  }
1374
1375  // Iterators
1376  child_range children() {
1377    return child_range(child_iterator(), child_iterator());
1378  }
1379  const_child_range children() const {
1380    return const_child_range(const_child_iterator(), const_child_iterator());
1381  }
1382};
1383
1384class FixedPointLiteral : public Exprpublic APIntStorage {
1385  SourceLocation Loc;
1386  unsigned Scale;
1387
1388  /// \brief Construct an empty integer literal.
1389  explicit FixedPointLiteral(EmptyShell Empty)
1390      : Expr(FixedPointLiteralClass, Empty) {}
1391
1392 public:
1393  FixedPointLiteral(const ASTContext &Cconst llvm::APInt &VQualType type,
1394                    SourceLocation lunsigned Scale);
1395
1396  // Store the int as is without any bit shifting.
1397  static FixedPointLiteral *CreateFromRawInt(const ASTContext &C,
1398                                             const llvm::APInt &V,
1399                                             QualType typeSourceLocation l,
1400                                             unsigned Scale);
1401
1402  SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; }
1403  SourceLocation getEndLoc() const LLVM_READONLY { return Loc; }
1404
1405  /// \brief Retrieve the location of the literal.
1406  SourceLocation getLocation() const { return Loc; }
1407
1408  void setLocation(SourceLocation Location) { Loc = Location; }
1409
1410  static bool classof(const Stmt *T) {
1411    return T->getStmtClass() == FixedPointLiteralClass;
1412  }
1413
1414  std::string getValueAsString(unsigned Radix) const;
1415
1416  // Iterators
1417  child_range children() {
1418    return child_range(child_iterator(), child_iterator());
1419  }
1420  const_child_range children() const {
1421    return const_child_range(const_child_iterator(), const_child_iterator());
1422  }
1423};
1424
1425class CharacterLiteral : public Expr {
1426public:
1427  enum CharacterKind {
1428    Ascii,
1429    Wide,
1430    UTF8,
1431    UTF16,
1432    UTF32
1433  };
1434
1435private:
1436  unsigned Value;
1437  SourceLocation Loc;
1438public:
1439  // type should be IntTy
1440  CharacterLiteral(unsigned valueCharacterKind kindQualType type,
1441                   SourceLocation l)
1442    : Expr(CharacterLiteralClass, type, VK_RValue, OK_Ordinary, falsefalse,
1443           falsefalse),
1444      Value(value), Loc(l) {
1445    CharacterLiteralBits.Kind = kind;
1446  }
1447
1448  /// Construct an empty character literal.
1449  CharacterLiteral(EmptyShell Empty) : Expr(CharacterLiteralClass, Empty) { }
1450
1451  SourceLocation getLocation() const { return Loc; }
1452  CharacterKind getKind() const {
1453    return static_cast<CharacterKind>(CharacterLiteralBits.Kind);
1454  }
1455
1456  SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; }
1457  SourceLocation getEndLoc() const LLVM_READONLY { return Loc; }
1458
1459  unsigned getValue() const { return Value; }
1460
1461  void setLocation(SourceLocation Location) { Loc = Location; }
1462  void setKind(CharacterKind kind) { CharacterLiteralBits.Kind = kind; }
1463  void setValue(unsigned Val) { Value = Val; }
1464
1465  static bool classof(const Stmt *T) {
1466    return T->getStmtClass() == CharacterLiteralClass;
1467  }
1468
1469  // Iterators
1470  child_range children() {
1471    return child_range(child_iterator(), child_iterator());
1472  }
1473  const_child_range children() const {
1474    return const_child_range(const_child_iterator(), const_child_iterator());
1475  }
1476};
1477
1478class FloatingLiteral : public Exprprivate APFloatStorage {
1479  SourceLocation Loc;
1480
1481  FloatingLiteral(const ASTContext &Cconst llvm::APFloat &Vbool isexact,
1482                  QualType TypeSourceLocation L);
1483
1484  /// Construct an empty floating-point literal.
1485  explicit FloatingLiteral(const ASTContext &CEmptyShell Empty);
1486
1487public:
1488  static FloatingLiteral *Create(const ASTContext &Cconst llvm::APFloat &V,
1489                                 bool isexactQualType TypeSourceLocation L);
1490  static FloatingLiteral *Create(const ASTContext &CEmptyShell Empty);
1491
1492  llvm::APFloat getValue() const {
1493    return APFloatStorage::getValue(getSemantics());
1494  }
1495  void setValue(const ASTContext &Cconst llvm::APFloat &Val) {
1496     (0) . __assert_fail ("&getSemantics() == &Val.getSemantics() && \"Inconsistent semantics\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 1496, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(&getSemantics() == &Val.getSemantics() && "Inconsistent semantics");
1497    APFloatStorage::setValue(C, Val);
1498  }
1499
1500  /// Get a raw enumeration value representing the floating-point semantics of
1501  /// this literal (32-bit IEEE, x87, ...), suitable for serialisation.
1502  APFloatSemantics getRawSemantics() const {
1503    return static_cast<APFloatSemantics>(FloatingLiteralBits.Semantics);
1504  }
1505
1506  /// Set the raw enumeration value representing the floating-point semantics of
1507  /// this literal (32-bit IEEE, x87, ...), suitable for serialisation.
1508  void setRawSemantics(APFloatSemantics Sem) {
1509    FloatingLiteralBits.Semantics = Sem;
1510  }
1511
1512  /// Return the APFloat semantics this literal uses.
1513  const llvm::fltSemantics &getSemantics() const;
1514
1515  /// Set the APFloat semantics this literal uses.
1516  void setSemantics(const llvm::fltSemantics &Sem);
1517
1518  bool isExact() const { return FloatingLiteralBits.IsExact; }
1519  void setExact(bool E) { FloatingLiteralBits.IsExact = E; }
1520
1521  /// getValueAsApproximateDouble - This returns the value as an inaccurate
1522  /// double.  Note that this may cause loss of precision, but is useful for
1523  /// debugging dumps, etc.
1524  double getValueAsApproximateDouble() const;
1525
1526  SourceLocation getLocation() const { return Loc; }
1527  void setLocation(SourceLocation L) { Loc = L; }
1528
1529  SourceLocation getBeginLoc() const LLVM_READONLY { return Loc; }
1530  SourceLocation getEndLoc() const LLVM_READONLY { return Loc; }
1531
1532  static bool classof(const Stmt *T) {
1533    return T->getStmtClass() == FloatingLiteralClass;
1534  }
1535
1536  // Iterators
1537  child_range children() {
1538    return child_range(child_iterator(), child_iterator());
1539  }
1540  const_child_range children() const {
1541    return const_child_range(const_child_iterator(), const_child_iterator());
1542  }
1543};
1544
1545/// ImaginaryLiteral - We support imaginary integer and floating point literals,
1546/// like "1.0i".  We represent these as a wrapper around FloatingLiteral and
1547/// IntegerLiteral classes.  Instances of this class always have a Complex type
1548/// whose element type matches the subexpression.
1549///
1550class ImaginaryLiteral : public Expr {
1551  Stmt *Val;
1552public:
1553  ImaginaryLiteral(Expr *valQualType Ty)
1554    : Expr(ImaginaryLiteralClass, Ty, VK_RValue, OK_Ordinary, falsefalse,
1555           falsefalse),
1556      Val(val) {}
1557
1558  /// Build an empty imaginary literal.
1559  explicit ImaginaryLiteral(EmptyShell Empty)
1560    : Expr(ImaginaryLiteralClass, Empty) { }
1561
1562  const Expr *getSubExpr() const { return cast<Expr>(Val); }
1563  Expr *getSubExpr() { return cast<Expr>(Val); }
1564  void setSubExpr(Expr *E) { Val = E; }
1565
1566  SourceLocation getBeginLoc() const LLVM_READONLY {
1567    return Val->getBeginLoc();
1568  }
1569  SourceLocation getEndLoc() const LLVM_READONLY { return Val->getEndLoc(); }
1570
1571  static bool classof(const Stmt *T) {
1572    return T->getStmtClass() == ImaginaryLiteralClass;
1573  }
1574
1575  // Iterators
1576  child_range children() { return child_range(&Val, &Val+1); }
1577  const_child_range children() const {
1578    return const_child_range(&Val, &Val + 1);
1579  }
1580};
1581
1582/// StringLiteral - This represents a string literal expression, e.g. "foo"
1583/// or L"bar" (wide strings). The actual string data can be obtained with
1584/// getBytes() and is NOT null-terminated. The length of the string data is
1585/// determined by calling getByteLength().
1586///
1587/// The C type for a string is always a ConstantArrayType. In C++, the char
1588/// type is const qualified, in C it is not.
1589///
1590/// Note that strings in C can be formed by concatenation of multiple string
1591/// literal pptokens in translation phase #6. This keeps track of the locations
1592/// of each of these pieces.
1593///
1594/// Strings in C can also be truncated and extended by assigning into arrays,
1595/// e.g. with constructs like:
1596///   char X[2] = "foobar";
1597/// In this case, getByteLength() will return 6, but the string literal will
1598/// have type "char[2]".
1599class StringLiteral final
1600    : public Expr,
1601      private llvm::TrailingObjects<StringLiteral, unsigned, SourceLocation,
1602                                    char> {
1603  friend class ASTStmtReader;
1604  friend TrailingObjects;
1605
1606  /// StringLiteral is followed by several trailing objects. They are in order:
1607  ///
1608  /// * A single unsigned storing the length in characters of this string. The
1609  ///   length in bytes is this length times the width of a single character.
1610  ///   Always present and stored as a trailing objects because storing it in
1611  ///   StringLiteral would increase the size of StringLiteral by sizeof(void *)
1612  ///   due to alignment requirements. If you add some data to StringLiteral,
1613  ///   consider moving it inside StringLiteral.
1614  ///
1615  /// * An array of getNumConcatenated() SourceLocation, one for each of the
1616  ///   token this string is made of.
1617  ///
1618  /// * An array of getByteLength() char used to store the string data.
1619
1620public:
1621  enum StringKind { AsciiWideUTF8UTF16UTF32 };
1622
1623private:
1624  unsigned numTrailingObjects(OverloadToken<unsigned>) const { return 1; }
1625  unsigned numTrailingObjects(OverloadToken<SourceLocation>) const {
1626    return getNumConcatenated();
1627  }
1628
1629  unsigned numTrailingObjects(OverloadToken<char>) const {
1630    return getByteLength();
1631  }
1632
1633  char *getStrDataAsChar() { return getTrailingObjects<char>(); }
1634  const char *getStrDataAsChar() const { return getTrailingObjects<char>(); }
1635
1636  const uint16_t *getStrDataAsUInt16() const {
1637    return reinterpret_cast<const uint16_t *>(getTrailingObjects<char>());
1638  }
1639
1640  const uint32_t *getStrDataAsUInt32() const {
1641    return reinterpret_cast<const uint32_t *>(getTrailingObjects<char>());
1642  }
1643
1644  /// Build a string literal.
1645  StringLiteral(const ASTContext &CtxStringRef StrStringKind Kind,
1646                bool PascalQualType Tyconst SourceLocation *Loc,
1647                unsigned NumConcatenated);
1648
1649  /// Build an empty string literal.
1650  StringLiteral(EmptyShell Emptyunsigned NumConcatenatedunsigned Length,
1651                unsigned CharByteWidth);
1652
1653  /// Map a target and string kind to the appropriate character width.
1654  static unsigned mapCharByteWidth(TargetInfo const &TargetStringKind SK);
1655
1656  /// Set one of the string literal token.
1657  void setStrTokenLoc(unsigned TokNumSourceLocation L) {
1658     (0) . __assert_fail ("TokNum < getNumConcatenated() && \"Invalid tok number\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 1658, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(TokNum < getNumConcatenated() && "Invalid tok number");
1659    getTrailingObjects<SourceLocation>()[TokNum] = L;
1660  }
1661
1662public:
1663  /// This is the "fully general" constructor that allows representation of
1664  /// strings formed from multiple concatenated tokens.
1665  static StringLiteral *Create(const ASTContext &CtxStringRef Str,
1666                               StringKind Kindbool PascalQualType Ty,
1667                               const SourceLocation *Loc,
1668                               unsigned NumConcatenated);
1669
1670  /// Simple constructor for string literals made from one token.
1671  static StringLiteral *Create(const ASTContext &CtxStringRef Str,
1672                               StringKind Kindbool PascalQualType Ty,
1673                               SourceLocation Loc) {
1674    return Create(Ctx, Str, Kind, Pascal, Ty, &Loc, 1);
1675  }
1676
1677  /// Construct an empty string literal.
1678  static StringLiteral *CreateEmpty(const ASTContext &Ctx,
1679                                    unsigned NumConcatenatedunsigned Length,
1680                                    unsigned CharByteWidth);
1681
1682  StringRef getString() const {
1683     (0) . __assert_fail ("getCharByteWidth() == 1 && \"This function is used in places that assume strings use char\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 1684, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(getCharByteWidth() == 1 &&
1684 (0) . __assert_fail ("getCharByteWidth() == 1 && \"This function is used in places that assume strings use char\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 1684, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "This function is used in places that assume strings use char");
1685    return StringRef(getStrDataAsChar(), getByteLength());
1686  }
1687
1688  /// Allow access to clients that need the byte representation, such as
1689  /// ASTWriterStmt::VisitStringLiteral().
1690  StringRef getBytes() const {
1691    // FIXME: StringRef may not be the right type to use as a result for this.
1692    return StringRef(getStrDataAsChar(), getByteLength());
1693  }
1694
1695  void outputString(raw_ostream &OSconst;
1696
1697  uint32_t getCodeUnit(size_t iconst {
1698     (0) . __assert_fail ("i < getLength() && \"out of bounds access\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 1698, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(i < getLength() && "out of bounds access");
1699    switch (getCharByteWidth()) {
1700    case 1:
1701      return static_cast<unsigned char>(getStrDataAsChar()[i]);
1702    case 2:
1703      return getStrDataAsUInt16()[i];
1704    case 4:
1705      return getStrDataAsUInt32()[i];
1706    }
1707    llvm_unreachable("Unsupported character width!");
1708  }
1709
1710  unsigned getByteLength() const { return getCharByteWidth() * getLength(); }
1711  unsigned getLength() const { return *getTrailingObjects<unsigned>(); }
1712  unsigned getCharByteWidth() const { return StringLiteralBits.CharByteWidth; }
1713
1714  StringKind getKind() const {
1715    return static_cast<StringKind>(StringLiteralBits.Kind);
1716  }
1717
1718  bool isAscii() const { return getKind() == Ascii; }
1719  bool isWide() const { return getKind() == Wide; }
1720  bool isUTF8() const { return getKind() == UTF8; }
1721  bool isUTF16() const { return getKind() == UTF16; }
1722  bool isUTF32() const { return getKind() == UTF32; }
1723  bool isPascal() const { return StringLiteralBits.IsPascal; }
1724
1725  bool containsNonAscii() const {
1726    for (auto c : getString())
1727      if (!isASCII(c))
1728        return true;
1729    return false;
1730  }
1731
1732  bool containsNonAsciiOrNull() const {
1733    for (auto c : getString())
1734      if (!isASCII(c) || !c)
1735        return true;
1736    return false;
1737  }
1738
1739  /// getNumConcatenated - Get the number of string literal tokens that were
1740  /// concatenated in translation phase #6 to form this string literal.
1741  unsigned getNumConcatenated() const {
1742    return StringLiteralBits.NumConcatenated;
1743  }
1744
1745  /// Get one of the string literal token.
1746  SourceLocation getStrTokenLoc(unsigned TokNumconst {
1747     (0) . __assert_fail ("TokNum < getNumConcatenated() && \"Invalid tok number\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 1747, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(TokNum < getNumConcatenated() && "Invalid tok number");
1748    return getTrailingObjects<SourceLocation>()[TokNum];
1749  }
1750
1751  /// getLocationOfByte - Return a source location that points to the specified
1752  /// byte of this string literal.
1753  ///
1754  /// Strings are amazingly complex.  They can be formed from multiple tokens
1755  /// and can have escape sequences in them in addition to the usual trigraph
1756  /// and escaped newline business.  This routine handles this complexity.
1757  ///
1758  SourceLocation
1759  getLocationOfByte(unsigned ByteNoconst SourceManager &SM,
1760                    const LangOptions &Featuresconst TargetInfo &Target,
1761                    unsigned *StartToken = nullptr,
1762                    unsigned *StartTokenByteOffset = nullptrconst;
1763
1764  typedef const SourceLocation *tokloc_iterator;
1765
1766  tokloc_iterator tokloc_begin() const {
1767    return getTrailingObjects<SourceLocation>();
1768  }
1769
1770  tokloc_iterator tokloc_end() const {
1771    return getTrailingObjects<SourceLocation>() + getNumConcatenated();
1772  }
1773
1774  SourceLocation getBeginLoc() const LLVM_READONLY { return *tokloc_begin(); }
1775  SourceLocation getEndLoc() const LLVM_READONLY { return *(tokloc_end() - 1); }
1776
1777  static bool classof(const Stmt *T) {
1778    return T->getStmtClass() == StringLiteralClass;
1779  }
1780
1781  // Iterators
1782  child_range children() {
1783    return child_range(child_iterator(), child_iterator());
1784  }
1785  const_child_range children() const {
1786    return const_child_range(const_child_iterator(), const_child_iterator());
1787  }
1788};
1789
1790/// [C99 6.4.2.2] - A predefined identifier such as __func__.
1791class PredefinedExpr final
1792    : public Expr,
1793      private llvm::TrailingObjects<PredefinedExpr, Stmt *> {
1794  friend class ASTStmtReader;
1795  friend TrailingObjects;
1796
1797  // PredefinedExpr is optionally followed by a single trailing
1798  // "Stmt *" for the predefined identifier. It is present if and only if
1799  // hasFunctionName() is true and is always a "StringLiteral *".
1800
1801public:
1802  enum IdentKind {
1803    Func,
1804    Function,
1805    LFunction// Same as Function, but as wide string.
1806    FuncDName,
1807    FuncSig,
1808    LFuncSig// Same as FuncSig, but as as wide string
1809    PrettyFunction,
1810    /// The same as PrettyFunction, except that the
1811    /// 'virtual' keyword is omitted for virtual member functions.
1812    PrettyFunctionNoVirtual
1813  };
1814
1815private:
1816  PredefinedExpr(SourceLocation LQualType FNTyIdentKind IK,
1817                 StringLiteral *SL);
1818
1819  explicit PredefinedExpr(EmptyShell Emptybool HasFunctionName);
1820
1821  /// True if this PredefinedExpr has storage for a function name.
1822  bool hasFunctionName() const { return PredefinedExprBits.HasFunctionName; }
1823
1824  void setFunctionName(StringLiteral *SL) {
1825     (0) . __assert_fail ("hasFunctionName() && \"This PredefinedExpr has no storage for a function name!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 1826, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(hasFunctionName() &&
1826 (0) . __assert_fail ("hasFunctionName() && \"This PredefinedExpr has no storage for a function name!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 1826, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "This PredefinedExpr has no storage for a function name!");
1827    *getTrailingObjects<Stmt *>() = SL;
1828  }
1829
1830public:
1831  /// Create a PredefinedExpr.
1832  static PredefinedExpr *Create(const ASTContext &CtxSourceLocation L,
1833                                QualType FNTyIdentKind IKStringLiteral *SL);
1834
1835  /// Create an empty PredefinedExpr.
1836  static PredefinedExpr *CreateEmpty(const ASTContext &Ctx,
1837                                     bool HasFunctionName);
1838
1839  IdentKind getIdentKind() const {
1840    return static_cast<IdentKind>(PredefinedExprBits.Kind);
1841  }
1842
1843  SourceLocation getLocation() const { return PredefinedExprBits.Loc; }
1844  void setLocation(SourceLocation L) { PredefinedExprBits.Loc = L; }
1845
1846  StringLiteral *getFunctionName() {
1847    return hasFunctionName()
1848               ? static_cast<StringLiteral *>(*getTrailingObjects<Stmt *>())
1849               : nullptr;
1850  }
1851
1852  const StringLiteral *getFunctionName() const {
1853    return hasFunctionName()
1854               ? static_cast<StringLiteral *>(*getTrailingObjects<Stmt *>())
1855               : nullptr;
1856  }
1857
1858  static StringRef getIdentKindName(IdentKind IK);
1859  static std::string ComputeName(IdentKind IKconst Decl *CurrentDecl);
1860
1861  SourceLocation getBeginLoc() const { return getLocation(); }
1862  SourceLocation getEndLoc() const { return getLocation(); }
1863
1864  static bool classof(const Stmt *T) {
1865    return T->getStmtClass() == PredefinedExprClass;
1866  }
1867
1868  // Iterators
1869  child_range children() {
1870    return child_range(getTrailingObjects<Stmt *>(),
1871                       getTrailingObjects<Stmt *>() + hasFunctionName());
1872  }
1873};
1874
1875/// ParenExpr - This represents a parethesized expression, e.g. "(1)".  This
1876/// AST node is only formed if full location information is requested.
1877class ParenExpr : public Expr {
1878  SourceLocation LR;
1879  Stmt *Val;
1880public:
1881  ParenExpr(SourceLocation lSourceLocation rExpr *val)
1882    : Expr(ParenExprClass, val->getType(),
1883           val->getValueKind(), val->getObjectKind(),
1884           val->isTypeDependent(), val->isValueDependent(),
1885           val->isInstantiationDependent(),
1886           val->containsUnexpandedParameterPack()),
1887      L(l), R(r), Val(val) {}
1888
1889  /// Construct an empty parenthesized expression.
1890  explicit ParenExpr(EmptyShell Empty)
1891    : Expr(ParenExprClass, Empty) { }
1892
1893  const Expr *getSubExpr() const { return cast<Expr>(Val); }
1894  Expr *getSubExpr() { return cast<Expr>(Val); }
1895  void setSubExpr(Expr *E) { Val = E; }
1896
1897  SourceLocation getBeginLoc() const LLVM_READONLY { return L; }
1898  SourceLocation getEndLoc() const LLVM_READONLY { return R; }
1899
1900  /// Get the location of the left parentheses '('.
1901  SourceLocation getLParen() const { return L; }
1902  void setLParen(SourceLocation Loc) { L = Loc; }
1903
1904  /// Get the location of the right parentheses ')'.
1905  SourceLocation getRParen() const { return R; }
1906  void setRParen(SourceLocation Loc) { R = Loc; }
1907
1908  static bool classof(const Stmt *T) {
1909    return T->getStmtClass() == ParenExprClass;
1910  }
1911
1912  // Iterators
1913  child_range children() { return child_range(&Val, &Val+1); }
1914  const_child_range children() const {
1915    return const_child_range(&Val, &Val + 1);
1916  }
1917};
1918
1919/// UnaryOperator - This represents the unary-expression's (except sizeof and
1920/// alignof), the postinc/postdec operators from postfix-expression, and various
1921/// extensions.
1922///
1923/// Notes on various nodes:
1924///
1925/// Real/Imag - These return the real/imag part of a complex operand.  If
1926///   applied to a non-complex value, the former returns its operand and the
1927///   later returns zero in the type of the operand.
1928///
1929class UnaryOperator : public Expr {
1930  Stmt *Val;
1931
1932public:
1933  typedef UnaryOperatorKind Opcode;
1934
1935  UnaryOperator(Expr *inputOpcode opcQualType typeExprValueKind VK,
1936                ExprObjectKind OKSourceLocation lbool CanOverflow)
1937      : Expr(UnaryOperatorClass, type, VK, OK,
1938             input->isTypeDependent() || type->isDependentType(),
1939             input->isValueDependent(),
1940             (input->isInstantiationDependent() ||
1941              type->isInstantiationDependentType()),
1942             input->containsUnexpandedParameterPack()),
1943        Val(input) {
1944    UnaryOperatorBits.Opc = opc;
1945    UnaryOperatorBits.CanOverflow = CanOverflow;
1946    UnaryOperatorBits.Loc = l;
1947  }
1948
1949  /// Build an empty unary operator.
1950  explicit UnaryOperator(EmptyShell Empty) : Expr(UnaryOperatorClass, Empty) {
1951    UnaryOperatorBits.Opc = UO_AddrOf;
1952  }
1953
1954  Opcode getOpcode() const {
1955    return static_cast<Opcode>(UnaryOperatorBits.Opc);
1956  }
1957  void setOpcode(Opcode Opc) { UnaryOperatorBits.Opc = Opc; }
1958
1959  Expr *getSubExpr() const { return cast<Expr>(Val); }
1960  void setSubExpr(Expr *E) { Val = E; }
1961
1962  /// getOperatorLoc - Return the location of the operator.
1963  SourceLocation getOperatorLoc() const { return UnaryOperatorBits.Loc; }
1964  void setOperatorLoc(SourceLocation L) { UnaryOperatorBits.Loc = L; }
1965
1966  /// Returns true if the unary operator can cause an overflow. For instance,
1967  ///   signed int i = INT_MAX; i++;
1968  ///   signed char c = CHAR_MAX; c++;
1969  /// Due to integer promotions, c++ is promoted to an int before the postfix
1970  /// increment, and the result is an int that cannot overflow. However, i++
1971  /// can overflow.
1972  bool canOverflow() const { return UnaryOperatorBits.CanOverflow; }
1973  void setCanOverflow(bool C) { UnaryOperatorBits.CanOverflow = C; }
1974
1975  /// isPostfix - Return true if this is a postfix operation, like x++.
1976  static bool isPostfix(Opcode Op) {
1977    return Op == UO_PostInc || Op == UO_PostDec;
1978  }
1979
1980  /// isPrefix - Return true if this is a prefix operation, like --x.
1981  static bool isPrefix(Opcode Op) {
1982    return Op == UO_PreInc || Op == UO_PreDec;
1983  }
1984
1985  bool isPrefix() const { return isPrefix(getOpcode()); }
1986  bool isPostfix() const { return isPostfix(getOpcode()); }
1987
1988  static bool isIncrementOp(Opcode Op) {
1989    return Op == UO_PreInc || Op == UO_PostInc;
1990  }
1991  bool isIncrementOp() const {
1992    return isIncrementOp(getOpcode());
1993  }
1994
1995  static bool isDecrementOp(Opcode Op) {
1996    return Op == UO_PreDec || Op == UO_PostDec;
1997  }
1998  bool isDecrementOp() const {
1999    return isDecrementOp(getOpcode());
2000  }
2001
2002  static bool isIncrementDecrementOp(Opcode Op) { return Op <= UO_PreDec; }
2003  bool isIncrementDecrementOp() const {
2004    return isIncrementDecrementOp(getOpcode());
2005  }
2006
2007  static bool isArithmeticOp(Opcode Op) {
2008    return Op >= UO_Plus && Op <= UO_LNot;
2009  }
2010  bool isArithmeticOp() const { return isArithmeticOp(getOpcode()); }
2011
2012  /// getOpcodeStr - Turn an Opcode enum value into the punctuation char it
2013  /// corresponds to, e.g. "sizeof" or "[pre]++"
2014  static StringRef getOpcodeStr(Opcode Op);
2015
2016  /// Retrieve the unary opcode that corresponds to the given
2017  /// overloaded operator.
2018  static Opcode getOverloadedOpcode(OverloadedOperatorKind OObool Postfix);
2019
2020  /// Retrieve the overloaded operator kind that corresponds to
2021  /// the given unary opcode.
2022  static OverloadedOperatorKind getOverloadedOperator(Opcode Opc);
2023
2024  SourceLocation getBeginLoc() const LLVM_READONLY {
2025    return isPostfix() ? Val->getBeginLoc() : getOperatorLoc();
2026  }
2027  SourceLocation getEndLoc() const LLVM_READONLY {
2028    return isPostfix() ? getOperatorLoc() : Val->getEndLoc();
2029  }
2030  SourceLocation getExprLoc() const { return getOperatorLoc(); }
2031
2032  static bool classof(const Stmt *T) {
2033    return T->getStmtClass() == UnaryOperatorClass;
2034  }
2035
2036  // Iterators
2037  child_range children() { return child_range(&Val, &Val+1); }
2038  const_child_range children() const {
2039    return const_child_range(&Val, &Val + 1);
2040  }
2041};
2042
2043/// Helper class for OffsetOfExpr.
2044
2045// __builtin_offsetof(type, identifier(.identifier|[expr])*)
2046class OffsetOfNode {
2047public:
2048  /// The kind of offsetof node we have.
2049  enum Kind {
2050    /// An index into an array.
2051    Array = 0x00,
2052    /// A field.
2053    Field = 0x01,
2054    /// A field in a dependent type, known only by its name.
2055    Identifier = 0x02,
2056    /// An implicit indirection through a C++ base class, when the
2057    /// field found is in a base class.
2058    Base = 0x03
2059  };
2060
2061private:
2062  enum { MaskBits = 2Mask = 0x03 };
2063
2064  /// The source range that covers this part of the designator.
2065  SourceRange Range;
2066
2067  /// The data describing the designator, which comes in three
2068  /// different forms, depending on the lower two bits.
2069  ///   - An unsigned index into the array of Expr*'s stored after this node
2070  ///     in memory, for [constant-expression] designators.
2071  ///   - A FieldDecl*, for references to a known field.
2072  ///   - An IdentifierInfo*, for references to a field with a given name
2073  ///     when the class type is dependent.
2074  ///   - A CXXBaseSpecifier*, for references that look at a field in a
2075  ///     base class.
2076  uintptr_t Data;
2077
2078public:
2079  /// Create an offsetof node that refers to an array element.
2080  OffsetOfNode(SourceLocation LBracketLocunsigned Index,
2081               SourceLocation RBracketLoc)
2082      : Range(LBracketLocRBracketLoc), Data((Index << 2) | Array) {}
2083
2084  /// Create an offsetof node that refers to a field.
2085  OffsetOfNode(SourceLocation DotLocFieldDecl *FieldSourceLocation NameLoc)
2086      : Range(DotLoc.isValid() ? DotLoc : NameLocNameLoc),
2087        Data(reinterpret_cast<uintptr_t>(Field) | OffsetOfNode::Field) {}
2088
2089  /// Create an offsetof node that refers to an identifier.
2090  OffsetOfNode(SourceLocation DotLocIdentifierInfo *Name,
2091               SourceLocation NameLoc)
2092      : Range(DotLoc.isValid() ? DotLoc : NameLocNameLoc),
2093        Data(reinterpret_cast<uintptr_t>(Name) | Identifier) {}
2094
2095  /// Create an offsetof node that refers into a C++ base class.
2096  explicit OffsetOfNode(const CXXBaseSpecifier *Base)
2097      : Range(), Data(reinterpret_cast<uintptr_t>(Base) | OffsetOfNode::Base) {}
2098
2099  /// Determine what kind of offsetof node this is.
2100  Kind getKind() const { return static_cast<Kind>(Data & Mask); }
2101
2102  /// For an array element node, returns the index into the array
2103  /// of expressions.
2104  unsigned getArrayExprIndex() const {
2105    assert(getKind() == Array);
2106    return Data >> 2;
2107  }
2108
2109  /// For a field offsetof node, returns the field.
2110  FieldDecl *getField() const {
2111    assert(getKind() == Field);
2112    return reinterpret_cast<FieldDecl *>(Data & ~(uintptr_t)Mask);
2113  }
2114
2115  /// For a field or identifier offsetof node, returns the name of
2116  /// the field.
2117  IdentifierInfo *getFieldName() const;
2118
2119  /// For a base class node, returns the base specifier.
2120  CXXBaseSpecifier *getBase() const {
2121    assert(getKind() == Base);
2122    return reinterpret_cast<CXXBaseSpecifier *>(Data & ~(uintptr_t)Mask);
2123  }
2124
2125  /// Retrieve the source range that covers this offsetof node.
2126  ///
2127  /// For an array element node, the source range contains the locations of
2128  /// the square brackets. For a field or identifier node, the source range
2129  /// contains the location of the period (if there is one) and the
2130  /// identifier.
2131  SourceRange getSourceRange() const LLVM_READONLY { return Range; }
2132  SourceLocation getBeginLoc() const LLVM_READONLY { return Range.getBegin(); }
2133  SourceLocation getEndLoc() const LLVM_READONLY { return Range.getEnd(); }
2134};
2135
2136/// OffsetOfExpr - [C99 7.17] - This represents an expression of the form
2137/// offsetof(record-type, member-designator). For example, given:
2138/// @code
2139/// struct S {
2140///   float f;
2141///   double d;
2142/// };
2143/// struct T {
2144///   int i;
2145///   struct S s[10];
2146/// };
2147/// @endcode
2148/// we can represent and evaluate the expression @c offsetof(struct T, s[2].d).
2149
2150class OffsetOfExpr final
2151    : public Expr,
2152      private llvm::TrailingObjects<OffsetOfExpr, OffsetOfNode, Expr *> {
2153  SourceLocation OperatorLocRParenLoc;
2154  // Base type;
2155  TypeSourceInfo *TSInfo;
2156  // Number of sub-components (i.e. instances of OffsetOfNode).
2157  unsigned NumComps;
2158  // Number of sub-expressions (i.e. array subscript expressions).
2159  unsigned NumExprs;
2160
2161  size_t numTrailingObjects(OverloadToken<OffsetOfNode>) const {
2162    return NumComps;
2163  }
2164
2165  OffsetOfExpr(const ASTContext &CQualType type,
2166               SourceLocation OperatorLocTypeSourceInfo *tsi,
2167               ArrayRef<OffsetOfNodecompsArrayRef<Expr*> exprs,
2168               SourceLocation RParenLoc);
2169
2170  explicit OffsetOfExpr(unsigned numCompsunsigned numExprs)
2171    : Expr(OffsetOfExprClass, EmptyShell()),
2172      TSInfo(nullptr), NumComps(numComps), NumExprs(numExprs) {}
2173
2174public:
2175
2176  static OffsetOfExpr *Create(const ASTContext &CQualType type,
2177                              SourceLocation OperatorLocTypeSourceInfo *tsi,
2178                              ArrayRef<OffsetOfNodecomps,
2179                              ArrayRef<Expr*> exprsSourceLocation RParenLoc);
2180
2181  static OffsetOfExpr *CreateEmpty(const ASTContext &C,
2182                                   unsigned NumCompsunsigned NumExprs);
2183
2184  /// getOperatorLoc - Return the location of the operator.
2185  SourceLocation getOperatorLoc() const { return OperatorLoc; }
2186  void setOperatorLoc(SourceLocation L) { OperatorLoc = L; }
2187
2188  /// Return the location of the right parentheses.
2189  SourceLocation getRParenLoc() const { return RParenLoc; }
2190  void setRParenLoc(SourceLocation R) { RParenLoc = R; }
2191
2192  TypeSourceInfo *getTypeSourceInfo() const {
2193    return TSInfo;
2194  }
2195  void setTypeSourceInfo(TypeSourceInfo *tsi) {
2196    TSInfo = tsi;
2197  }
2198
2199  const OffsetOfNode &getComponent(unsigned Idxconst {
2200     (0) . __assert_fail ("Idx < NumComps && \"Subscript out of range\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 2200, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(Idx < NumComps && "Subscript out of range");
2201    return getTrailingObjects<OffsetOfNode>()[Idx];
2202  }
2203
2204  void setComponent(unsigned IdxOffsetOfNode ON) {
2205     (0) . __assert_fail ("Idx < NumComps && \"Subscript out of range\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 2205, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(Idx < NumComps && "Subscript out of range");
2206    getTrailingObjects<OffsetOfNode>()[Idx] = ON;
2207  }
2208
2209  unsigned getNumComponents() const {
2210    return NumComps;
2211  }
2212
2213  ExprgetIndexExpr(unsigned Idx) {
2214     (0) . __assert_fail ("Idx < NumExprs && \"Subscript out of range\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 2214, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(Idx < NumExprs && "Subscript out of range");
2215    return getTrailingObjects<Expr *>()[Idx];
2216  }
2217
2218  const Expr *getIndexExpr(unsigned Idxconst {
2219     (0) . __assert_fail ("Idx < NumExprs && \"Subscript out of range\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 2219, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(Idx < NumExprs && "Subscript out of range");
2220    return getTrailingObjects<Expr *>()[Idx];
2221  }
2222
2223  void setIndexExpr(unsigned IdxExprE) {
2224     (0) . __assert_fail ("Idx < NumComps && \"Subscript out of range\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 2224, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(Idx < NumComps && "Subscript out of range");
2225    getTrailingObjects<Expr *>()[Idx] = E;
2226  }
2227
2228  unsigned getNumExpressions() const {
2229    return NumExprs;
2230  }
2231
2232  SourceLocation getBeginLoc() const LLVM_READONLY { return OperatorLoc; }
2233  SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; }
2234
2235  static bool classof(const Stmt *T) {
2236    return T->getStmtClass() == OffsetOfExprClass;
2237  }
2238
2239  // Iterators
2240  child_range children() {
2241    Stmt **begin = reinterpret_cast<Stmt **>(getTrailingObjects<Expr *>());
2242    return child_range(begin, begin + NumExprs);
2243  }
2244  const_child_range children() const {
2245    Stmt *const *begin =
2246        reinterpret_cast<Stmt *const *>(getTrailingObjects<Expr *>());
2247    return const_child_range(begin, begin + NumExprs);
2248  }
2249  friend TrailingObjects;
2250};
2251
2252/// UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated)
2253/// expression operand.  Used for sizeof/alignof (C99 6.5.3.4) and
2254/// vec_step (OpenCL 1.1 6.11.12).
2255class UnaryExprOrTypeTraitExpr : public Expr {
2256  union {
2257    TypeSourceInfo *Ty;
2258    Stmt *Ex;
2259  } Argument;
2260  SourceLocation OpLocRParenLoc;
2261
2262public:
2263  UnaryExprOrTypeTraitExpr(UnaryExprOrTypeTrait ExprKindTypeSourceInfo *TInfo,
2264                           QualType resultTypeSourceLocation op,
2265                           SourceLocation rp) :
2266      Expr(UnaryExprOrTypeTraitExprClass, resultType, VK_RValue, OK_Ordinary,
2267           false// Never type-dependent (C++ [temp.dep.expr]p3).
2268           // Value-dependent if the argument is type-dependent.
2269           TInfo->getType()->isDependentType(),
2270           TInfo->getType()->isInstantiationDependentType(),
2271           TInfo->getType()->containsUnexpandedParameterPack()),
2272      OpLoc(op), RParenLoc(rp) {
2273    UnaryExprOrTypeTraitExprBits.Kind = ExprKind;
2274    UnaryExprOrTypeTraitExprBits.IsType = true;
2275    Argument.Ty = TInfo;
2276  }
2277
2278  UnaryExprOrTypeTraitExpr(UnaryExprOrTypeTrait ExprKindExpr *E,
2279                           QualType resultTypeSourceLocation op,
2280                           SourceLocation rp);
2281
2282  /// Construct an empty sizeof/alignof expression.
2283  explicit UnaryExprOrTypeTraitExpr(EmptyShell Empty)
2284    : Expr(UnaryExprOrTypeTraitExprClass, Empty) { }
2285
2286  UnaryExprOrTypeTrait getKind() const {
2287    return static_cast<UnaryExprOrTypeTrait>(UnaryExprOrTypeTraitExprBits.Kind);
2288  }
2289  void setKind(UnaryExprOrTypeTrait K) { UnaryExprOrTypeTraitExprBits.Kind = K;}
2290
2291  bool isArgumentType() const { return UnaryExprOrTypeTraitExprBits.IsType; }
2292  QualType getArgumentType() const {
2293    return getArgumentTypeInfo()->getType();
2294  }
2295  TypeSourceInfo *getArgumentTypeInfo() const {
2296     (0) . __assert_fail ("isArgumentType() && \"calling getArgumentType() when arg is expr\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 2296, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(isArgumentType() && "calling getArgumentType() when arg is expr");
2297    return Argument.Ty;
2298  }
2299  Expr *getArgumentExpr() {
2300     (0) . __assert_fail ("!isArgumentType() && \"calling getArgumentExpr() when arg is type\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 2300, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(!isArgumentType() && "calling getArgumentExpr() when arg is type");
2301    return static_cast<Expr*>(Argument.Ex);
2302  }
2303  const Expr *getArgumentExpr() const {
2304    return const_cast<UnaryExprOrTypeTraitExpr*>(this)->getArgumentExpr();
2305  }
2306
2307  void setArgument(Expr *E) {
2308    Argument.Ex = E;
2309    UnaryExprOrTypeTraitExprBits.IsType = false;
2310  }
2311  void setArgument(TypeSourceInfo *TInfo) {
2312    Argument.Ty = TInfo;
2313    UnaryExprOrTypeTraitExprBits.IsType = true;
2314  }
2315
2316  /// Gets the argument type, or the type of the argument expression, whichever
2317  /// is appropriate.
2318  QualType getTypeOfArgument() const {
2319    return isArgumentType() ? getArgumentType() : getArgumentExpr()->getType();
2320  }
2321
2322  SourceLocation getOperatorLoc() const { return OpLoc; }
2323  void setOperatorLoc(SourceLocation L) { OpLoc = L; }
2324
2325  SourceLocation getRParenLoc() const { return RParenLoc; }
2326  void setRParenLoc(SourceLocation L) { RParenLoc = L; }
2327
2328  SourceLocation getBeginLoc() const LLVM_READONLY { return OpLoc; }
2329  SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; }
2330
2331  static bool classof(const Stmt *T) {
2332    return T->getStmtClass() == UnaryExprOrTypeTraitExprClass;
2333  }
2334
2335  // Iterators
2336  child_range children();
2337  const_child_range children() const;
2338};
2339
2340//===----------------------------------------------------------------------===//
2341// Postfix Operators.
2342//===----------------------------------------------------------------------===//
2343
2344/// ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
2345class ArraySubscriptExpr : public Expr {
2346  enum { LHSRHSEND_EXPR };
2347  Stmt *SubExprs[END_EXPR];
2348
2349  bool lhsIsBase() const { return getRHS()->getType()->isIntegerType(); }
2350
2351public:
2352  ArraySubscriptExpr(Expr *lhsExpr *rhsQualType t,
2353                     ExprValueKind VKExprObjectKind OK,
2354                     SourceLocation rbracketloc)
2355  : Expr(ArraySubscriptExprClass, t, VK, OK,
2356         lhs->isTypeDependent() || rhs->isTypeDependent(),
2357         lhs->isValueDependent() || rhs->isValueDependent(),
2358         (lhs->isInstantiationDependent() ||
2359          rhs->isInstantiationDependent()),
2360         (lhs->containsUnexpandedParameterPack() ||
2361          rhs->containsUnexpandedParameterPack())) {
2362    SubExprs[LHS] = lhs;
2363    SubExprs[RHS] = rhs;
2364    ArraySubscriptExprBits.RBracketLoc = rbracketloc;
2365  }
2366
2367  /// Create an empty array subscript expression.
2368  explicit ArraySubscriptExpr(EmptyShell Shell)
2369    : Expr(ArraySubscriptExprClass, Shell) { }
2370
2371  /// An array access can be written A[4] or 4[A] (both are equivalent).
2372  /// - getBase() and getIdx() always present the normalized view: A[4].
2373  ///    In this case getBase() returns "A" and getIdx() returns "4".
2374  /// - getLHS() and getRHS() present the syntactic view. e.g. for
2375  ///    4[A] getLHS() returns "4".
2376  /// Note: Because vector element access is also written A[4] we must
2377  /// predicate the format conversion in getBase and getIdx only on the
2378  /// the type of the RHS, as it is possible for the LHS to be a vector of
2379  /// integer type
2380  Expr *getLHS() { return cast<Expr>(SubExprs[LHS]); }
2381  const Expr *getLHS() const { return cast<Expr>(SubExprs[LHS]); }
2382  void setLHS(Expr *E) { SubExprs[LHS] = E; }
2383
2384  Expr *getRHS() { return cast<Expr>(SubExprs[RHS]); }
2385  const Expr *getRHS() const { return cast<Expr>(SubExprs[RHS]); }
2386  void setRHS(Expr *E) { SubExprs[RHS] = E; }
2387
2388  Expr *getBase() { return lhsIsBase() ? getLHS() : getRHS(); }
2389  const Expr *getBase() const { return lhsIsBase() ? getLHS() : getRHS(); }
2390
2391  Expr *getIdx() { return lhsIsBase() ? getRHS() : getLHS(); }
2392  const Expr *getIdx() const { return lhsIsBase() ? getRHS() : getLHS(); }
2393
2394  SourceLocation getBeginLoc() const LLVM_READONLY {
2395    return getLHS()->getBeginLoc();
2396  }
2397  SourceLocation getEndLoc() const { return getRBracketLoc(); }
2398
2399  SourceLocation getRBracketLoc() const {
2400    return ArraySubscriptExprBits.RBracketLoc;
2401  }
2402  void setRBracketLoc(SourceLocation L) {
2403    ArraySubscriptExprBits.RBracketLoc = L;
2404  }
2405
2406  SourceLocation getExprLoc() const LLVM_READONLY {
2407    return getBase()->getExprLoc();
2408  }
2409
2410  static bool classof(const Stmt *T) {
2411    return T->getStmtClass() == ArraySubscriptExprClass;
2412  }
2413
2414  // Iterators
2415  child_range children() {
2416    return child_range(&SubExprs[0], &SubExprs[0]+END_EXPR);
2417  }
2418  const_child_range children() const {
2419    return const_child_range(&SubExprs[0], &SubExprs[0] + END_EXPR);
2420  }
2421};
2422
2423/// CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
2424/// CallExpr itself represents a normal function call, e.g., "f(x, 2)",
2425/// while its subclasses may represent alternative syntax that (semantically)
2426/// results in a function call. For example, CXXOperatorCallExpr is
2427/// a subclass for overloaded operator calls that use operator syntax, e.g.,
2428/// "str1 + str2" to resolve to a function call.
2429class CallExpr : public Expr {
2430  enum { FN = 0PREARGS_START = 1 };
2431
2432  /// The number of arguments in the call expression.
2433  unsigned NumArgs;
2434
2435  /// The location of the right parenthese. This has a different meaning for
2436  /// the derived classes of CallExpr.
2437  SourceLocation RParenLoc;
2438
2439  void updateDependenciesFromArg(Expr *Arg);
2440
2441  // CallExpr store some data in trailing objects. However since CallExpr
2442  // is used a base of other expression classes we cannot use
2443  // llvm::TrailingObjects. Instead we manually perform the pointer arithmetic
2444  // and casts.
2445  //
2446  // The trailing objects are in order:
2447  //
2448  // * A single "Stmt *" for the callee expression.
2449  //
2450  // * An array of getNumPreArgs() "Stmt *" for the pre-argument expressions.
2451  //
2452  // * An array of getNumArgs() "Stmt *" for the argument expressions.
2453  //
2454  // Note that we store the offset in bytes from the this pointer to the start
2455  // of the trailing objects. It would be perfectly possible to compute it
2456  // based on the dynamic kind of the CallExpr. However 1.) we have plenty of
2457  // space in the bit-fields of Stmt. 2.) It was benchmarked to be faster to
2458  // compute this once and then load the offset from the bit-fields of Stmt,
2459  // instead of re-computing the offset each time the trailing objects are
2460  // accessed.
2461
2462  /// Return a pointer to the start of the trailing array of "Stmt *".
2463  Stmt **getTrailingStmts() {
2464    return reinterpret_cast<Stmt **>(reinterpret_cast<char *>(this) +
2465                                     CallExprBits.OffsetToTrailingObjects);
2466  }
2467  Stmt *const *getTrailingStmts() const {
2468    return const_cast<CallExpr *>(this)->getTrailingStmts();
2469  }
2470
2471  /// Map a statement class to the appropriate offset in bytes from the
2472  /// this pointer to the trailing objects.
2473  static unsigned offsetToTrailingObjects(StmtClass SC);
2474
2475public:
2476  enum class ADLCallKind : bool { NotADLUsesADL };
2477  static constexpr ADLCallKind NotADL = ADLCallKind::NotADL;
2478  static constexpr ADLCallKind UsesADL = ADLCallKind::UsesADL;
2479
2480protected:
2481  /// Build a call expression, assuming that appropriate storage has been
2482  /// allocated for the trailing objects.
2483  CallExpr(StmtClass SCExpr *FnArrayRef<Expr *> PreArgs,
2484           ArrayRef<Expr *> ArgsQualType TyExprValueKind VK,
2485           SourceLocation RParenLocunsigned MinNumArgsADLCallKind UsesADL);
2486
2487  /// Build an empty call expression, for deserialization.
2488  CallExpr(StmtClass SCunsigned NumPreArgsunsigned NumArgs,
2489           EmptyShell Empty);
2490
2491  /// Return the size in bytes needed for the trailing objects.
2492  /// Used by the derived classes to allocate the right amount of storage.
2493  static unsigned sizeOfTrailingObjects(unsigned NumPreArgsunsigned NumArgs) {
2494    return (1 + NumPreArgs + NumArgs) * sizeof(Stmt *);
2495  }
2496
2497  Stmt *getPreArg(unsigned I) {
2498     (0) . __assert_fail ("I < getNumPreArgs() && \"Prearg access out of range!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 2498, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(I < getNumPreArgs() && "Prearg access out of range!");
2499    return getTrailingStmts()[PREARGS_START + I];
2500  }
2501  const Stmt *getPreArg(unsigned Iconst {
2502     (0) . __assert_fail ("I < getNumPreArgs() && \"Prearg access out of range!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 2502, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(I < getNumPreArgs() && "Prearg access out of range!");
2503    return getTrailingStmts()[PREARGS_START + I];
2504  }
2505  void setPreArg(unsigned IStmt *PreArg) {
2506     (0) . __assert_fail ("I < getNumPreArgs() && \"Prearg access out of range!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 2506, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(I < getNumPreArgs() && "Prearg access out of range!");
2507    getTrailingStmts()[PREARGS_START + I] = PreArg;
2508  }
2509
2510  unsigned getNumPreArgs() const { return CallExprBits.NumPreArgs; }
2511
2512public:
2513  /// Create a call expression. Fn is the callee expression, Args is the
2514  /// argument array, Ty is the type of the call expression (which is *not*
2515  /// the return type in general), VK is the value kind of the call expression
2516  /// (lvalue, rvalue, ...), and RParenLoc is the location of the right
2517  /// parenthese in the call expression. MinNumArgs specifies the minimum
2518  /// number of arguments. The actual number of arguments will be the greater
2519  /// of Args.size() and MinNumArgs. This is used in a few places to allocate
2520  /// enough storage for the default arguments. UsesADL specifies whether the
2521  /// callee was found through argument-dependent lookup.
2522  ///
2523  /// Note that you can use CreateTemporary if you need a temporary call
2524  /// expression on the stack.
2525  static CallExpr *Create(const ASTContext &CtxExpr *Fn,
2526                          ArrayRef<Expr *> ArgsQualType TyExprValueKind VK,
2527                          SourceLocation RParenLocunsigned MinNumArgs = 0,
2528                          ADLCallKind UsesADL = NotADL);
2529
2530  /// Create a temporary call expression with no arguments in the memory
2531  /// pointed to by Mem. Mem must points to at least sizeof(CallExpr)
2532  /// + sizeof(Stmt *) bytes of storage, aligned to alignof(CallExpr):
2533  ///
2534  /// \code{.cpp}
2535  ///   llvm::AlignedCharArray<alignof(CallExpr),
2536  ///                          sizeof(CallExpr) + sizeof(Stmt *)> Buffer;
2537  ///   CallExpr *TheCall = CallExpr::CreateTemporary(Buffer.buffer, etc);
2538  /// \endcode
2539  static CallExpr *CreateTemporary(void *MemExpr *FnQualType Ty,
2540                                   ExprValueKind VKSourceLocation RParenLoc,
2541                                   ADLCallKind UsesADL = NotADL);
2542
2543  /// Create an empty call expression, for deserialization.
2544  static CallExpr *CreateEmpty(const ASTContext &Ctxunsigned NumArgs,
2545                               EmptyShell Empty);
2546
2547  Expr *getCallee() { return cast<Expr>(getTrailingStmts()[FN]); }
2548  const Expr *getCallee() const { return cast<Expr>(getTrailingStmts()[FN]); }
2549  void setCallee(Expr *F) { getTrailingStmts()[FN] = F; }
2550
2551  ADLCallKind getADLCallKind() const {
2552    return static_cast<ADLCallKind>(CallExprBits.UsesADL);
2553  }
2554  void setADLCallKind(ADLCallKind V = UsesADL) {
2555    CallExprBits.UsesADL = static_cast<bool>(V);
2556  }
2557  bool usesADL() const { return getADLCallKind() == UsesADL; }
2558
2559  Decl *getCalleeDecl() { return getCallee()->getReferencedDeclOfCallee(); }
2560  const Decl *getCalleeDecl() const {
2561    return getCallee()->getReferencedDeclOfCallee();
2562  }
2563
2564  /// If the callee is a FunctionDecl, return it. Otherwise return null.
2565  FunctionDecl *getDirectCallee() {
2566    return dyn_cast_or_null<FunctionDecl>(getCalleeDecl());
2567  }
2568  const FunctionDecl *getDirectCallee() const {
2569    return dyn_cast_or_null<FunctionDecl>(getCalleeDecl());
2570  }
2571
2572  /// getNumArgs - Return the number of actual arguments to this call.
2573  unsigned getNumArgs() const { return NumArgs; }
2574
2575  /// Retrieve the call arguments.
2576  Expr **getArgs() {
2577    return reinterpret_cast<Expr **>(getTrailingStmts() + PREARGS_START +
2578                                     getNumPreArgs());
2579  }
2580  const Expr *const *getArgs() const {
2581    return reinterpret_cast<const Expr *const *>(
2582        getTrailingStmts() + PREARGS_START + getNumPreArgs());
2583  }
2584
2585  /// getArg - Return the specified argument.
2586  Expr *getArg(unsigned Arg) {
2587     (0) . __assert_fail ("Arg < getNumArgs() && \"Arg access out of range!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 2587, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(Arg < getNumArgs() && "Arg access out of range!");
2588    return getArgs()[Arg];
2589  }
2590  const Expr *getArg(unsigned Argconst {
2591     (0) . __assert_fail ("Arg < getNumArgs() && \"Arg access out of range!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 2591, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(Arg < getNumArgs() && "Arg access out of range!");
2592    return getArgs()[Arg];
2593  }
2594
2595  /// setArg - Set the specified argument.
2596  void setArg(unsigned ArgExpr *ArgExpr) {
2597     (0) . __assert_fail ("Arg < getNumArgs() && \"Arg access out of range!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 2597, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(Arg < getNumArgs() && "Arg access out of range!");
2598    getArgs()[Arg] = ArgExpr;
2599  }
2600
2601  /// Reduce the number of arguments in this call expression. This is used for
2602  /// example during error recovery to drop extra arguments. There is no way
2603  /// to perform the opposite because: 1.) We don't track how much storage
2604  /// we have for the argument array 2.) This would potentially require growing
2605  /// the argument array, something we cannot support since the arguments are
2606  /// stored in a trailing array.
2607  void shrinkNumArgs(unsigned NewNumArgs) {
2608     (0) . __assert_fail ("(NewNumArgs <= getNumArgs()) && \"shrinkNumArgs cannot increase the number of arguments!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 2609, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert((NewNumArgs <= getNumArgs()) &&
2609 (0) . __assert_fail ("(NewNumArgs <= getNumArgs()) && \"shrinkNumArgs cannot increase the number of arguments!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 2609, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "shrinkNumArgs cannot increase the number of arguments!");
2610    NumArgs = NewNumArgs;
2611  }
2612
2613  /// Bluntly set a new number of arguments without doing any checks whatsoever.
2614  /// Only used during construction of a CallExpr in a few places in Sema.
2615  /// FIXME: Find a way to remove it.
2616  void setNumArgsUnsafe(unsigned NewNumArgs) { NumArgs = NewNumArgs; }
2617
2618  typedef ExprIterator arg_iterator;
2619  typedef ConstExprIterator const_arg_iterator;
2620  typedef llvm::iterator_range<arg_iterator> arg_range;
2621  typedef llvm::iterator_range<const_arg_iterator> const_arg_range;
2622
2623  arg_range arguments() { return arg_range(arg_begin(), arg_end()); }
2624  const_arg_range arguments() const {
2625    return const_arg_range(arg_begin(), arg_end());
2626  }
2627
2628  arg_iterator arg_begin() {
2629    return getTrailingStmts() + PREARGS_START + getNumPreArgs();
2630  }
2631  arg_iterator arg_end() { return arg_begin() + getNumArgs(); }
2632
2633  const_arg_iterator arg_begin() const {
2634    return getTrailingStmts() + PREARGS_START + getNumPreArgs();
2635  }
2636  const_arg_iterator arg_end() const { return arg_begin() + getNumArgs(); }
2637
2638  /// This method provides fast access to all the subexpressions of
2639  /// a CallExpr without going through the slower virtual child_iterator
2640  /// interface.  This provides efficient reverse iteration of the
2641  /// subexpressions.  This is currently used for CFG construction.
2642  ArrayRef<Stmt *> getRawSubExprs() {
2643    return llvm::makeArrayRef(getTrailingStmts(),
2644                              PREARGS_START + getNumPreArgs() + getNumArgs());
2645  }
2646
2647  /// getNumCommas - Return the number of commas that must have been present in
2648  /// this function call.
2649  unsigned getNumCommas() const { return getNumArgs() ? getNumArgs() - 1 : 0; }
2650
2651  /// getBuiltinCallee - If this is a call to a builtin, return the builtin ID
2652  /// of the callee. If not, return 0.
2653  unsigned getBuiltinCallee() const;
2654
2655  /// Returns \c true if this is a call to a builtin which does not
2656  /// evaluate side-effects within its arguments.
2657  bool isUnevaluatedBuiltinCall(const ASTContext &Ctxconst;
2658
2659  /// getCallReturnType - Get the return type of the call expr. This is not
2660  /// always the type of the expr itself, if the return type is a reference
2661  /// type.
2662  QualType getCallReturnType(const ASTContext &Ctxconst;
2663
2664  /// Returns the WarnUnusedResultAttr that is either declared on the called
2665  /// function, or its return type declaration.
2666  const Attr *getUnusedResultAttr(const ASTContext &Ctxconst;
2667
2668  /// Returns true if this call expression should warn on unused results.
2669  bool hasUnusedResultAttr(const ASTContext &Ctxconst {
2670    return getUnusedResultAttr(Ctx) != nullptr;
2671  }
2672
2673  SourceLocation getRParenLoc() const { return RParenLoc; }
2674  void setRParenLoc(SourceLocation L) { RParenLoc = L; }
2675
2676  SourceLocation getBeginLoc() const LLVM_READONLY;
2677  SourceLocation getEndLoc() const LLVM_READONLY;
2678
2679  /// Return true if this is a call to __assume() or __builtin_assume() with
2680  /// a non-value-dependent constant parameter evaluating as false.
2681  bool isBuiltinAssumeFalse(const ASTContext &Ctxconst;
2682
2683  bool isCallToStdMove() const {
2684    const FunctionDecl *FD = getDirectCallee();
2685    return getNumArgs() == 1 && FD && FD->isInStdNamespace() &&
2686           FD->getIdentifier() && FD->getIdentifier()->isStr("move");
2687  }
2688
2689  static bool classof(const Stmt *T) {
2690    return T->getStmtClass() >= firstCallExprConstant &&
2691           T->getStmtClass() <= lastCallExprConstant;
2692  }
2693
2694  // Iterators
2695  child_range children() {
2696    return child_range(getTrailingStmts(), getTrailingStmts() + PREARGS_START +
2697                                               getNumPreArgs() + getNumArgs());
2698  }
2699
2700  const_child_range children() const {
2701    return const_child_range(getTrailingStmts(),
2702                             getTrailingStmts() + PREARGS_START +
2703                                 getNumPreArgs() + getNumArgs());
2704  }
2705};
2706
2707/// Extra data stored in some MemberExpr objects.
2708struct MemberExprNameQualifier {
2709  /// The nested-name-specifier that qualifies the name, including
2710  /// source-location information.
2711  NestedNameSpecifierLoc QualifierLoc;
2712
2713  /// The DeclAccessPair through which the MemberDecl was found due to
2714  /// name qualifiers.
2715  DeclAccessPair FoundDecl;
2716};
2717
2718/// MemberExpr - [C99 6.5.2.3] Structure and Union Members.  X->F and X.F.
2719///
2720class MemberExpr final
2721    : public Expr,
2722      private llvm::TrailingObjects<MemberExpr, MemberExprNameQualifier,
2723                                    ASTTemplateKWAndArgsInfo,
2724                                    TemplateArgumentLoc> {
2725  friend class ASTReader;
2726  friend class ASTStmtWriter;
2727  friend TrailingObjects;
2728
2729  /// Base - the expression for the base pointer or structure references.  In
2730  /// X.F, this is "X".
2731  Stmt *Base;
2732
2733  /// MemberDecl - This is the decl being referenced by the field/member name.
2734  /// In X.F, this is the decl referenced by F.
2735  ValueDecl *MemberDecl;
2736
2737  /// MemberDNLoc - Provides source/type location info for the
2738  /// declaration name embedded in MemberDecl.
2739  DeclarationNameLoc MemberDNLoc;
2740
2741  /// MemberLoc - This is the location of the member name.
2742  SourceLocation MemberLoc;
2743
2744  size_t numTrailingObjects(OverloadToken<MemberExprNameQualifier>) const {
2745    return hasQualifierOrFoundDecl();
2746  }
2747
2748  size_t numTrailingObjects(OverloadToken<ASTTemplateKWAndArgsInfo>) const {
2749    return hasTemplateKWAndArgsInfo();
2750  }
2751
2752  bool hasQualifierOrFoundDecl() const {
2753    return MemberExprBits.HasQualifierOrFoundDecl;
2754  }
2755
2756  bool hasTemplateKWAndArgsInfo() const {
2757    return MemberExprBits.HasTemplateKWAndArgsInfo;
2758  }
2759
2760public:
2761  MemberExpr(Expr *basebool isarrowSourceLocation operatorloc,
2762             ValueDecl *memberdeclconst DeclarationNameInfo &NameInfo,
2763             QualType tyExprValueKind VKExprObjectKind OK)
2764      : Expr(MemberExprClass, ty, VK, OK, base->isTypeDependent(),
2765             base->isValueDependent(), base->isInstantiationDependent(),
2766             base->containsUnexpandedParameterPack()),
2767        Base(base), MemberDecl(memberdecl), MemberDNLoc(NameInfo.getInfo()),
2768        MemberLoc(NameInfo.getLoc()) {
2769    getDeclName() == NameInfo.getName()", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 2769, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(memberdecl->getDeclName() == NameInfo.getName());
2770    MemberExprBits.IsArrow = isarrow;
2771    MemberExprBits.HasQualifierOrFoundDecl = false;
2772    MemberExprBits.HasTemplateKWAndArgsInfo = false;
2773    MemberExprBits.HadMultipleCandidates = false;
2774    MemberExprBits.OperatorLoc = operatorloc;
2775  }
2776
2777  // NOTE: this constructor should be used only when it is known that
2778  // the member name can not provide additional syntactic info
2779  // (i.e., source locations for C++ operator names or type source info
2780  // for constructors, destructors and conversion operators).
2781  MemberExpr(Expr *basebool isarrowSourceLocation operatorloc,
2782             ValueDecl *memberdeclSourceLocation lQualType ty,
2783             ExprValueKind VKExprObjectKind OK)
2784      : Expr(MemberExprClass, ty, VK, OK, base->isTypeDependent(),
2785             base->isValueDependent(), base->isInstantiationDependent(),
2786             base->containsUnexpandedParameterPack()),
2787        Base(base), MemberDecl(memberdecl), MemberDNLoc(), MemberLoc(l) {
2788    MemberExprBits.IsArrow = isarrow;
2789    MemberExprBits.HasQualifierOrFoundDecl = false;
2790    MemberExprBits.HasTemplateKWAndArgsInfo = false;
2791    MemberExprBits.HadMultipleCandidates = false;
2792    MemberExprBits.OperatorLoc = operatorloc;
2793  }
2794
2795  static MemberExpr *Create(const ASTContext &CExpr *basebool isarrow,
2796                            SourceLocation OperatorLoc,
2797                            NestedNameSpecifierLoc QualifierLoc,
2798                            SourceLocation TemplateKWLocValueDecl *memberdecl,
2799                            DeclAccessPair founddecl,
2800                            DeclarationNameInfo MemberNameInfo,
2801                            const TemplateArgumentListInfo *targsQualType ty,
2802                            ExprValueKind VKExprObjectKind OK);
2803
2804  void setBase(Expr *E) { Base = E; }
2805  Expr *getBase() const { return cast<Expr>(Base); }
2806
2807  /// Retrieve the member declaration to which this expression refers.
2808  ///
2809  /// The returned declaration will be a FieldDecl or (in C++) a VarDecl (for
2810  /// static data members), a CXXMethodDecl, or an EnumConstantDecl.
2811  ValueDecl *getMemberDecl() const { return MemberDecl; }
2812  void setMemberDecl(ValueDecl *D) { MemberDecl = D; }
2813
2814  /// Retrieves the declaration found by lookup.
2815  DeclAccessPair getFoundDecl() const {
2816    if (!hasQualifierOrFoundDecl())
2817      return DeclAccessPair::make(getMemberDecl(),
2818                                  getMemberDecl()->getAccess());
2819    return getTrailingObjects<MemberExprNameQualifier>()->FoundDecl;
2820  }
2821
2822  /// Determines whether this member expression actually had
2823  /// a C++ nested-name-specifier prior to the name of the member, e.g.,
2824  /// x->Base::foo.
2825  bool hasQualifier() const { return getQualifier() != nullptr; }
2826
2827  /// If the member name was qualified, retrieves the
2828  /// nested-name-specifier that precedes the member name, with source-location
2829  /// information.
2830  NestedNameSpecifierLoc getQualifierLoc() const {
2831    if (!hasQualifierOrFoundDecl())
2832      return NestedNameSpecifierLoc();
2833    return getTrailingObjects<MemberExprNameQualifier>()->QualifierLoc;
2834  }
2835
2836  /// If the member name was qualified, retrieves the
2837  /// nested-name-specifier that precedes the member name. Otherwise, returns
2838  /// NULL.
2839  NestedNameSpecifier *getQualifier() const {
2840    return getQualifierLoc().getNestedNameSpecifier();
2841  }
2842
2843  /// Retrieve the location of the template keyword preceding
2844  /// the member name, if any.
2845  SourceLocation getTemplateKeywordLoc() const {
2846    if (!hasTemplateKWAndArgsInfo())
2847      return SourceLocation();
2848    return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->TemplateKWLoc;
2849  }
2850
2851  /// Retrieve the location of the left angle bracket starting the
2852  /// explicit template argument list following the member name, if any.
2853  SourceLocation getLAngleLoc() const {
2854    if (!hasTemplateKWAndArgsInfo())
2855      return SourceLocation();
2856    return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->LAngleLoc;
2857  }
2858
2859  /// Retrieve the location of the right angle bracket ending the
2860  /// explicit template argument list following the member name, if any.
2861  SourceLocation getRAngleLoc() const {
2862    if (!hasTemplateKWAndArgsInfo())
2863      return SourceLocation();
2864    return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->RAngleLoc;
2865  }
2866
2867  /// Determines whether the member name was preceded by the template keyword.
2868  bool hasTemplateKeyword() const { return getTemplateKeywordLoc().isValid(); }
2869
2870  /// Determines whether the member name was followed by an
2871  /// explicit template argument list.
2872  bool hasExplicitTemplateArgs() const { return getLAngleLoc().isValid(); }
2873
2874  /// Copies the template arguments (if present) into the given
2875  /// structure.
2876  void copyTemplateArgumentsInto(TemplateArgumentListInfo &Listconst {
2877    if (hasExplicitTemplateArgs())
2878      getTrailingObjects<ASTTemplateKWAndArgsInfo>()->copyInto(
2879          getTrailingObjects<TemplateArgumentLoc>(), List);
2880  }
2881
2882  /// Retrieve the template arguments provided as part of this
2883  /// template-id.
2884  const TemplateArgumentLoc *getTemplateArgs() const {
2885    if (!hasExplicitTemplateArgs())
2886      return nullptr;
2887
2888    return getTrailingObjects<TemplateArgumentLoc>();
2889  }
2890
2891  /// Retrieve the number of template arguments provided as part of this
2892  /// template-id.
2893  unsigned getNumTemplateArgs() const {
2894    if (!hasExplicitTemplateArgs())
2895      return 0;
2896
2897    return getTrailingObjects<ASTTemplateKWAndArgsInfo>()->NumTemplateArgs;
2898  }
2899
2900  ArrayRef<TemplateArgumentLoctemplate_arguments() const {
2901    return {getTemplateArgs(), getNumTemplateArgs()};
2902  }
2903
2904  /// Retrieve the member declaration name info.
2905  DeclarationNameInfo getMemberNameInfo() const {
2906    return DeclarationNameInfo(MemberDecl->getDeclName(),
2907                               MemberLocMemberDNLoc);
2908  }
2909
2910  SourceLocation getOperatorLoc() const { return MemberExprBits.OperatorLoc; }
2911
2912  bool isArrow() const { return MemberExprBits.IsArrow; }
2913  void setArrow(bool A) { MemberExprBits.IsArrow = A; }
2914
2915  /// getMemberLoc - Return the location of the "member", in X->F, it is the
2916  /// location of 'F'.
2917  SourceLocation getMemberLoc() const { return MemberLoc; }
2918  void setMemberLoc(SourceLocation L) { MemberLoc = L; }
2919
2920  SourceLocation getBeginLoc() const LLVM_READONLY;
2921  SourceLocation getEndLoc() const LLVM_READONLY;
2922
2923  SourceLocation getExprLoc() const LLVM_READONLY { return MemberLoc; }
2924
2925  /// Determine whether the base of this explicit is implicit.
2926  bool isImplicitAccess() const {
2927    return getBase() && getBase()->isImplicitCXXThis();
2928  }
2929
2930  /// Returns true if this member expression refers to a method that
2931  /// was resolved from an overloaded set having size greater than 1.
2932  bool hadMultipleCandidates() const {
2933    return MemberExprBits.HadMultipleCandidates;
2934  }
2935  /// Sets the flag telling whether this expression refers to
2936  /// a method that was resolved from an overloaded set having size
2937  /// greater than 1.
2938  void setHadMultipleCandidates(bool V = true) {
2939    MemberExprBits.HadMultipleCandidates = V;
2940  }
2941
2942  /// Returns true if virtual dispatch is performed.
2943  /// If the member access is fully qualified, (i.e. X::f()), virtual
2944  /// dispatching is not performed. In -fapple-kext mode qualified
2945  /// calls to virtual method will still go through the vtable.
2946  bool performsVirtualDispatch(const LangOptions &LO) const {
2947    return LO.AppleKext || !hasQualifier();
2948  }
2949
2950  static bool classof(const Stmt *T) {
2951    return T->getStmtClass() == MemberExprClass;
2952  }
2953
2954  // Iterators
2955  child_range children() { return child_range(&Base, &Base+1); }
2956  const_child_range children() const {
2957    return const_child_range(&Base, &Base + 1);
2958  }
2959};
2960
2961/// CompoundLiteralExpr - [C99 6.5.2.5]
2962///
2963class CompoundLiteralExpr : public Expr {
2964  /// LParenLoc - If non-null, this is the location of the left paren in a
2965  /// compound literal like "(int){4}".  This can be null if this is a
2966  /// synthesized compound expression.
2967  SourceLocation LParenLoc;
2968
2969  /// The type as written.  This can be an incomplete array type, in
2970  /// which case the actual expression type will be different.
2971  /// The int part of the pair stores whether this expr is file scope.
2972  llvm::PointerIntPair<TypeSourceInfo *, 1boolTInfoAndScope;
2973  Stmt *Init;
2974public:
2975  CompoundLiteralExpr(SourceLocation lparenlocTypeSourceInfo *tinfo,
2976                      QualType TExprValueKind VKExpr *initbool fileScope)
2977    : Expr(CompoundLiteralExprClass, T, VK, OK_Ordinary,
2978           tinfo->getType()->isDependentType(),
2979           init->isValueDependent(),
2980           (init->isInstantiationDependent() ||
2981            tinfo->getType()->isInstantiationDependentType()),
2982           init->containsUnexpandedParameterPack()),
2983      LParenLoc(lparenloc), TInfoAndScope(tinfo, fileScope), Init(init) {}
2984
2985  /// Construct an empty compound literal.
2986  explicit CompoundLiteralExpr(EmptyShell Empty)
2987    : Expr(CompoundLiteralExprClass, Empty) { }
2988
2989  const Expr *getInitializer() const { return cast<Expr>(Init); }
2990  Expr *getInitializer() { return cast<Expr>(Init); }
2991  void setInitializer(Expr *E) { Init = E; }
2992
2993  bool isFileScope() const { return TInfoAndScope.getInt(); }
2994  void setFileScope(bool FS) { TInfoAndScope.setInt(FS); }
2995
2996  SourceLocation getLParenLoc() const { return LParenLoc; }
2997  void setLParenLoc(SourceLocation L) { LParenLoc = L; }
2998
2999  TypeSourceInfo *getTypeSourceInfo() const {
3000    return TInfoAndScope.getPointer();
3001  }
3002  void setTypeSourceInfo(TypeSourceInfo *tinfo) {
3003    TInfoAndScope.setPointer(tinfo);
3004  }
3005
3006  SourceLocation getBeginLoc() const LLVM_READONLY {
3007    // FIXME: Init should never be null.
3008    if (!Init)
3009      return SourceLocation();
3010    if (LParenLoc.isInvalid())
3011      return Init->getBeginLoc();
3012    return LParenLoc;
3013  }
3014  SourceLocation getEndLoc() const LLVM_READONLY {
3015    // FIXME: Init should never be null.
3016    if (!Init)
3017      return SourceLocation();
3018    return Init->getEndLoc();
3019  }
3020
3021  static bool classof(const Stmt *T) {
3022    return T->getStmtClass() == CompoundLiteralExprClass;
3023  }
3024
3025  // Iterators
3026  child_range children() { return child_range(&Init, &Init+1); }
3027  const_child_range children() const {
3028    return const_child_range(&Init, &Init + 1);
3029  }
3030};
3031
3032/// CastExpr - Base class for type casts, including both implicit
3033/// casts (ImplicitCastExpr) and explicit casts that have some
3034/// representation in the source code (ExplicitCastExpr's derived
3035/// classes).
3036class CastExpr : public Expr {
3037  Stmt *Op;
3038
3039  bool CastConsistency() const;
3040
3041  const CXXBaseSpecifier * const *path_buffer() const {
3042    return const_cast<CastExpr*>(this)->path_buffer();
3043  }
3044  CXXBaseSpecifier **path_buffer();
3045
3046protected:
3047  CastExpr(StmtClass SCQualType tyExprValueKind VKconst CastKind kind,
3048           Expr *opunsigned BasePathSize)
3049      : Expr(SC, ty, VK, OK_Ordinary,
3050             // Cast expressions are type-dependent if the type is
3051             // dependent (C++ [temp.dep.expr]p3).
3052             ty->isDependentType(),
3053             // Cast expressions are value-dependent if the type is
3054             // dependent or if the subexpression is value-dependent.
3055             ty->isDependentType() || (op && op->isValueDependent()),
3056             (ty->isInstantiationDependentType() ||
3057              (op && op->isInstantiationDependent())),
3058             // An implicit cast expression doesn't (lexically) contain an
3059             // unexpanded pack, even if its target type does.
3060             ((SC != ImplicitCastExprClass &&
3061               ty->containsUnexpandedParameterPack()) ||
3062              (op && op->containsUnexpandedParameterPack()))),
3063        Op(op) {
3064    CastExprBits.Kind = kind;
3065    CastExprBits.PartOfExplicitCast = false;
3066    CastExprBits.BasePathSize = BasePathSize;
3067     (0) . __assert_fail ("(CastExprBits.BasePathSize == BasePathSize) && \"BasePathSize overflow!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 3068, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert((CastExprBits.BasePathSize == BasePathSize) &&
3068 (0) . __assert_fail ("(CastExprBits.BasePathSize == BasePathSize) && \"BasePathSize overflow!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 3068, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "BasePathSize overflow!");
3069    assert(CastConsistency());
3070  }
3071
3072  /// Construct an empty cast.
3073  CastExpr(StmtClass SCEmptyShell Emptyunsigned BasePathSize)
3074    : Expr(SCEmpty) {
3075    CastExprBits.PartOfExplicitCast = false;
3076    CastExprBits.BasePathSize = BasePathSize;
3077     (0) . __assert_fail ("(CastExprBits.BasePathSize == BasePathSize) && \"BasePathSize overflow!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 3078, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert((CastExprBits.BasePathSize == BasePathSize) &&
3078 (0) . __assert_fail ("(CastExprBits.BasePathSize == BasePathSize) && \"BasePathSize overflow!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 3078, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "BasePathSize overflow!");
3079  }
3080
3081public:
3082  CastKind getCastKind() const { return (CastKindCastExprBits.Kind; }
3083  void setCastKind(CastKind K) { CastExprBits.Kind = K; }
3084
3085  static const char *getCastKindName(CastKind CK);
3086  const char *getCastKindName() const { return getCastKindName(getCastKind()); }
3087
3088  Expr *getSubExpr() { return cast<Expr>(Op); }
3089  const Expr *getSubExpr() const { return cast<Expr>(Op); }
3090  void setSubExpr(Expr *E) { Op = E; }
3091
3092  /// Retrieve the cast subexpression as it was written in the source
3093  /// code, looking through any implicit casts or other intermediate nodes
3094  /// introduced by semantic analysis.
3095  Expr *getSubExprAsWritten();
3096  const Expr *getSubExprAsWritten() const {
3097    return const_cast<CastExpr *>(this)->getSubExprAsWritten();
3098  }
3099
3100  /// If this cast applies a user-defined conversion, retrieve the conversion
3101  /// function that it invokes.
3102  NamedDecl *getConversionFunction() const;
3103
3104  typedef CXXBaseSpecifier **path_iterator;
3105  typedef const CXXBaseSpecifier *const *path_const_iterator;
3106  bool path_empty() const { return path_size() == 0; }
3107  unsigned path_size() const { return CastExprBits.BasePathSize; }
3108  path_iterator path_begin() { return path_buffer(); }
3109  path_iterator path_end() { return path_buffer() + path_size(); }
3110  path_const_iterator path_begin() const { return path_buffer(); }
3111  path_const_iterator path_end() const { return path_buffer() + path_size(); }
3112
3113  const FieldDecl *getTargetUnionField() const {
3114    assert(getCastKind() == CK_ToUnion);
3115    return getTargetFieldForToUnionCast(getType(), getSubExpr()->getType());
3116  }
3117
3118  static const FieldDecl *getTargetFieldForToUnionCast(QualType unionType,
3119                                                       QualType opType);
3120  static const FieldDecl *getTargetFieldForToUnionCast(const RecordDecl *RD,
3121                                                       QualType opType);
3122
3123  static bool classof(const Stmt *T) {
3124    return T->getStmtClass() >= firstCastExprConstant &&
3125           T->getStmtClass() <= lastCastExprConstant;
3126  }
3127
3128  // Iterators
3129  child_range children() { return child_range(&Op, &Op+1); }
3130  const_child_range children() const { return const_child_range(&Op, &Op + 1); }
3131};
3132
3133/// ImplicitCastExpr - Allows us to explicitly represent implicit type
3134/// conversions, which have no direct representation in the original
3135/// source code. For example: converting T[]->T*, void f()->void
3136/// (*f)(), float->double, short->int, etc.
3137///
3138/// In C, implicit casts always produce rvalues. However, in C++, an
3139/// implicit cast whose result is being bound to a reference will be
3140/// an lvalue or xvalue. For example:
3141///
3142/// @code
3143/// class Base { };
3144/// class Derived : public Base { };
3145/// Derived &&ref();
3146/// void f(Derived d) {
3147///   Base& b = d; // initializer is an ImplicitCastExpr
3148///                // to an lvalue of type Base
3149///   Base&& r = ref(); // initializer is an ImplicitCastExpr
3150///                     // to an xvalue of type Base
3151/// }
3152/// @endcode
3153class ImplicitCastExpr final
3154    : public CastExpr,
3155      private llvm::TrailingObjects<ImplicitCastExpr, CXXBaseSpecifier *> {
3156
3157  ImplicitCastExpr(QualType tyCastKind kindExpr *op,
3158                   unsigned BasePathLengthExprValueKind VK)
3159    : CastExpr(ImplicitCastExprClass, ty, VK, kind, op, BasePathLength) { }
3160
3161  /// Construct an empty implicit cast.
3162  explicit ImplicitCastExpr(EmptyShell Shellunsigned PathSize)
3163    : CastExpr(ImplicitCastExprClass, Shell, PathSize) { }
3164
3165public:
3166  enum OnStack_t { OnStack };
3167  ImplicitCastExpr(OnStack_t _QualType tyCastKind kindExpr *op,
3168                   ExprValueKind VK)
3169    : CastExpr(ImplicitCastExprClass, ty, VK, kind, op, 0) {
3170  }
3171
3172  bool isPartOfExplicitCast() const { return CastExprBits.PartOfExplicitCast; }
3173  void setIsPartOfExplicitCast(bool PartOfExplicitCast) {
3174    CastExprBits.PartOfExplicitCast = PartOfExplicitCast;
3175  }
3176
3177  static ImplicitCastExpr *Create(const ASTContext &ContextQualType T,
3178                                  CastKind KindExpr *Operand,
3179                                  const CXXCastPath *BasePath,
3180                                  ExprValueKind Cat);
3181
3182  static ImplicitCastExpr *CreateEmpty(const ASTContext &Context,
3183                                       unsigned PathSize);
3184
3185  SourceLocation getBeginLoc() const LLVM_READONLY {
3186    return getSubExpr()->getBeginLoc();
3187  }
3188  SourceLocation getEndLoc() const LLVM_READONLY {
3189    return getSubExpr()->getEndLoc();
3190  }
3191
3192  static bool classof(const Stmt *T) {
3193    return T->getStmtClass() == ImplicitCastExprClass;
3194  }
3195
3196  friend TrailingObjects;
3197  friend class CastExpr;
3198};
3199
3200/// ExplicitCastExpr - An explicit cast written in the source
3201/// code.
3202///
3203/// This class is effectively an abstract class, because it provides
3204/// the basic representation of an explicitly-written cast without
3205/// specifying which kind of cast (C cast, functional cast, static
3206/// cast, etc.) was written; specific derived classes represent the
3207/// particular style of cast and its location information.
3208///
3209/// Unlike implicit casts, explicit cast nodes have two different
3210/// types: the type that was written into the source code, and the
3211/// actual type of the expression as determined by semantic
3212/// analysis. These types may differ slightly. For example, in C++ one
3213/// can cast to a reference type, which indicates that the resulting
3214/// expression will be an lvalue or xvalue. The reference type, however,
3215/// will not be used as the type of the expression.
3216class ExplicitCastExpr : public CastExpr {
3217  /// TInfo - Source type info for the (written) type
3218  /// this expression is casting to.
3219  TypeSourceInfo *TInfo;
3220
3221protected:
3222  ExplicitCastExpr(StmtClass SCQualType exprTyExprValueKind VK,
3223                   CastKind kindExpr *opunsigned PathSize,
3224                   TypeSourceInfo *writtenTy)
3225    : CastExpr(SCexprTyVKkindopPathSize), TInfo(writtenTy) {}
3226
3227  /// Construct an empty explicit cast.
3228  ExplicitCastExpr(StmtClass SCEmptyShell Shellunsigned PathSize)
3229    : CastExpr(SCShellPathSize) { }
3230
3231public:
3232  /// getTypeInfoAsWritten - Returns the type source info for the type
3233  /// that this expression is casting to.
3234  TypeSourceInfo *getTypeInfoAsWritten() const { return TInfo; }
3235  void setTypeInfoAsWritten(TypeSourceInfo *writtenTy) { TInfo = writtenTy; }
3236
3237  /// getTypeAsWritten - Returns the type that this expression is
3238  /// casting to, as written in the source code.
3239  QualType getTypeAsWritten() const { return TInfo->getType(); }
3240
3241  static bool classof(const Stmt *T) {
3242     return T->getStmtClass() >= firstExplicitCastExprConstant &&
3243            T->getStmtClass() <= lastExplicitCastExprConstant;
3244  }
3245};
3246
3247/// CStyleCastExpr - An explicit cast in C (C99 6.5.4) or a C-style
3248/// cast in C++ (C++ [expr.cast]), which uses the syntax
3249/// (Type)expr. For example: @c (int)f.
3250class CStyleCastExpr final
3251    : public ExplicitCastExpr,
3252      private llvm::TrailingObjects<CStyleCastExpr, CXXBaseSpecifier *> {
3253  SourceLocation LPLoc// the location of the left paren
3254  SourceLocation RPLoc// the location of the right paren
3255
3256  CStyleCastExpr(QualType exprTyExprValueKind vkCastKind kindExpr *op,
3257                 unsigned PathSizeTypeSourceInfo *writtenTy,
3258                 SourceLocation lSourceLocation r)
3259    : ExplicitCastExpr(CStyleCastExprClass, exprTy, vk, kind, op, PathSize,
3260                       writtenTy), LPLoc(l), RPLoc(r) {}
3261
3262  /// Construct an empty C-style explicit cast.
3263  explicit CStyleCastExpr(EmptyShell Shellunsigned PathSize)
3264    : ExplicitCastExpr(CStyleCastExprClass, Shell, PathSize) { }
3265
3266public:
3267  static CStyleCastExpr *Create(const ASTContext &ContextQualType T,
3268                                ExprValueKind VKCastKind K,
3269                                Expr *Opconst CXXCastPath *BasePath,
3270                                TypeSourceInfo *WrittenTySourceLocation L,
3271                                SourceLocation R);
3272
3273  static CStyleCastExpr *CreateEmpty(const ASTContext &Context,
3274                                     unsigned PathSize);
3275
3276  SourceLocation getLParenLoc() const { return LPLoc; }
3277  void setLParenLoc(SourceLocation L) { LPLoc = L; }
3278
3279  SourceLocation getRParenLoc() const { return RPLoc; }
3280  void setRParenLoc(SourceLocation L) { RPLoc = L; }
3281
3282  SourceLocation getBeginLoc() const LLVM_READONLY { return LPLoc; }
3283  SourceLocation getEndLoc() const LLVM_READONLY {
3284    return getSubExpr()->getEndLoc();
3285  }
3286
3287  static bool classof(const Stmt *T) {
3288    return T->getStmtClass() == CStyleCastExprClass;
3289  }
3290
3291  friend TrailingObjects;
3292  friend class CastExpr;
3293};
3294
3295/// A builtin binary operation expression such as "x + y" or "x <= y".
3296///
3297/// This expression node kind describes a builtin binary operation,
3298/// such as "x + y" for integer values "x" and "y". The operands will
3299/// already have been converted to appropriate types (e.g., by
3300/// performing promotions or conversions).
3301///
3302/// In C++, where operators may be overloaded, a different kind of
3303/// expression node (CXXOperatorCallExpr) is used to express the
3304/// invocation of an overloaded operator with operator syntax. Within
3305/// a C++ template, whether BinaryOperator or CXXOperatorCallExpr is
3306/// used to store an expression "x + y" depends on the subexpressions
3307/// for x and y. If neither x or y is type-dependent, and the "+"
3308/// operator resolves to a built-in operation, BinaryOperator will be
3309/// used to express the computation (x and y may still be
3310/// value-dependent). If either x or y is type-dependent, or if the
3311/// "+" resolves to an overloaded operator, CXXOperatorCallExpr will
3312/// be used to express the computation.
3313class BinaryOperator : public Expr {
3314  enum { LHSRHSEND_EXPR };
3315  Stmt *SubExprs[END_EXPR];
3316
3317public:
3318  typedef BinaryOperatorKind Opcode;
3319
3320  BinaryOperator(Expr *lhsExpr *rhsOpcode opcQualType ResTy,
3321                 ExprValueKind VKExprObjectKind OK,
3322                 SourceLocation opLocFPOptions FPFeatures)
3323    : Expr(BinaryOperatorClass, ResTy, VK, OK,
3324           lhs->isTypeDependent() || rhs->isTypeDependent(),
3325           lhs->isValueDependent() || rhs->isValueDependent(),
3326           (lhs->isInstantiationDependent() ||
3327            rhs->isInstantiationDependent()),
3328           (lhs->containsUnexpandedParameterPack() ||
3329            rhs->containsUnexpandedParameterPack())) {
3330    BinaryOperatorBits.Opc = opc;
3331    BinaryOperatorBits.FPFeatures = FPFeatures.getInt();
3332    BinaryOperatorBits.OpLoc = opLoc;
3333    SubExprs[LHS] = lhs;
3334    SubExprs[RHS] = rhs;
3335     (0) . __assert_fail ("!isCompoundAssignmentOp() && \"Use CompoundAssignOperator for compound assignments\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 3336, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(!isCompoundAssignmentOp() &&
3336 (0) . __assert_fail ("!isCompoundAssignmentOp() && \"Use CompoundAssignOperator for compound assignments\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 3336, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "Use CompoundAssignOperator for compound assignments");
3337  }
3338
3339  /// Construct an empty binary operator.
3340  explicit BinaryOperator(EmptyShell Empty) : Expr(BinaryOperatorClass, Empty) {
3341    BinaryOperatorBits.Opc = BO_Comma;
3342  }
3343
3344  SourceLocation getExprLoc() const { return getOperatorLoc(); }
3345  SourceLocation getOperatorLoc() const { return BinaryOperatorBits.OpLoc; }
3346  void setOperatorLoc(SourceLocation L) { BinaryOperatorBits.OpLoc = L; }
3347
3348  Opcode getOpcode() const {
3349    return static_cast<Opcode>(BinaryOperatorBits.Opc);
3350  }
3351  void setOpcode(Opcode Opc) { BinaryOperatorBits.Opc = Opc; }
3352
3353  Expr *getLHS() const { return cast<Expr>(SubExprs[LHS]); }
3354  void setLHS(Expr *E) { SubExprs[LHS] = E; }
3355  Expr *getRHS() const { return cast<Expr>(SubExprs[RHS]); }
3356  void setRHS(Expr *E) { SubExprs[RHS] = E; }
3357
3358  SourceLocation getBeginLoc() const LLVM_READONLY {
3359    return getLHS()->getBeginLoc();
3360  }
3361  SourceLocation getEndLoc() const LLVM_READONLY {
3362    return getRHS()->getEndLoc();
3363  }
3364
3365  /// getOpcodeStr - Turn an Opcode enum value into the punctuation char it
3366  /// corresponds to, e.g. "<<=".
3367  static StringRef getOpcodeStr(Opcode Op);
3368
3369  StringRef getOpcodeStr() const { return getOpcodeStr(getOpcode()); }
3370
3371  /// Retrieve the binary opcode that corresponds to the given
3372  /// overloaded operator.
3373  static Opcode getOverloadedOpcode(OverloadedOperatorKind OO);
3374
3375  /// Retrieve the overloaded operator kind that corresponds to
3376  /// the given binary opcode.
3377  static OverloadedOperatorKind getOverloadedOperator(Opcode Opc);
3378
3379  /// predicates to categorize the respective opcodes.
3380  static bool isPtrMemOp(Opcode Opc) {
3381    return Opc == BO_PtrMemD || Opc == BO_PtrMemI;
3382  }
3383  bool isPtrMemOp() const { return isPtrMemOp(getOpcode()); }
3384
3385  static bool isMultiplicativeOp(Opcode Opc) {
3386    return Opc >= BO_Mul && Opc <= BO_Rem;
3387  }
3388  bool isMultiplicativeOp() const { return isMultiplicativeOp(getOpcode()); }
3389  static bool isAdditiveOp(Opcode Opc) { return Opc == BO_Add || Opc==BO_Sub; }
3390  bool isAdditiveOp() const { return isAdditiveOp(getOpcode()); }
3391  static bool isShiftOp(Opcode Opc) { return Opc == BO_Shl || Opc == BO_Shr; }
3392  bool isShiftOp() const { return isShiftOp(getOpcode()); }
3393
3394  static bool isBitwiseOp(Opcode Opc) { return Opc >= BO_And && Opc <= BO_Or; }
3395  bool isBitwiseOp() const { return isBitwiseOp(getOpcode()); }
3396
3397  static bool isRelationalOp(Opcode Opc) { return Opc >= BO_LT && Opc<=BO_GE; }
3398  bool isRelationalOp() const { return isRelationalOp(getOpcode()); }
3399
3400  static bool isEqualityOp(Opcode Opc) { return Opc == BO_EQ || Opc == BO_NE; }
3401  bool isEqualityOp() const { return isEqualityOp(getOpcode()); }
3402
3403  static bool isComparisonOp(Opcode Opc) { return Opc >= BO_Cmp && Opc<=BO_NE; }
3404  bool isComparisonOp() const { return isComparisonOp(getOpcode()); }
3405
3406  static bool isCommaOp(Opcode Opc) { return Opc == BO_Comma; }
3407  bool isCommaOp() const { return isCommaOp(getOpcode()); }
3408
3409  static Opcode negateComparisonOp(Opcode Opc) {
3410    switch (Opc) {
3411    default:
3412      llvm_unreachable("Not a comparison operator.");
3413    case BO_LTreturn BO_GE;
3414    case BO_GTreturn BO_LE;
3415    case BO_LEreturn BO_GT;
3416    case BO_GEreturn BO_LT;
3417    case BO_EQreturn BO_NE;
3418    case BO_NEreturn BO_EQ;
3419    }
3420  }
3421
3422  static Opcode reverseComparisonOp(Opcode Opc) {
3423    switch (Opc) {
3424    default:
3425      llvm_unreachable("Not a comparison operator.");
3426    case BO_LTreturn BO_GT;
3427    case BO_GTreturn BO_LT;
3428    case BO_LEreturn BO_GE;
3429    case BO_GEreturn BO_LE;
3430    case BO_EQ:
3431    case BO_NE:
3432      return Opc;
3433    }
3434  }
3435
3436  static bool isLogicalOp(Opcode Opc) { return Opc == BO_LAnd || Opc==BO_LOr; }
3437  bool isLogicalOp() const { return isLogicalOp(getOpcode()); }
3438
3439  static bool isAssignmentOp(Opcode Opc) {
3440    return Opc >= BO_Assign && Opc <= BO_OrAssign;
3441  }
3442  bool isAssignmentOp() const { return isAssignmentOp(getOpcode()); }
3443
3444  static bool isCompoundAssignmentOp(Opcode Opc) {
3445    return Opc > BO_Assign && Opc <= BO_OrAssign;
3446  }
3447  bool isCompoundAssignmentOp() const {
3448    return isCompoundAssignmentOp(getOpcode());
3449  }
3450  static Opcode getOpForCompoundAssignment(Opcode Opc) {
3451    assert(isCompoundAssignmentOp(Opc));
3452    if (Opc >= BO_AndAssign)
3453      return Opcode(unsigned(Opc) - BO_AndAssign + BO_And);
3454    else
3455      return Opcode(unsigned(Opc) - BO_MulAssign + BO_Mul);
3456  }
3457
3458  static bool isShiftAssignOp(Opcode Opc) {
3459    return Opc == BO_ShlAssign || Opc == BO_ShrAssign;
3460  }
3461  bool isShiftAssignOp() const {
3462    return isShiftAssignOp(getOpcode());
3463  }
3464
3465  // Return true if a binary operator using the specified opcode and operands
3466  // would match the 'p = (i8*)nullptr + n' idiom for casting a pointer-sized
3467  // integer to a pointer.
3468  static bool isNullPointerArithmeticExtension(ASTContext &CtxOpcode Opc,
3469                                               Expr *LHSExpr *RHS);
3470
3471  static bool classof(const Stmt *S) {
3472    return S->getStmtClass() >= firstBinaryOperatorConstant &&
3473           S->getStmtClass() <= lastBinaryOperatorConstant;
3474  }
3475
3476  // Iterators
3477  child_range children() {
3478    return child_range(&SubExprs[0], &SubExprs[0]+END_EXPR);
3479  }
3480  const_child_range children() const {
3481    return const_child_range(&SubExprs[0], &SubExprs[0] + END_EXPR);
3482  }
3483
3484  // Set the FP contractability status of this operator. Only meaningful for
3485  // operations on floating point types.
3486  void setFPFeatures(FPOptions F) {
3487    BinaryOperatorBits.FPFeatures = F.getInt();
3488  }
3489
3490  FPOptions getFPFeatures() const {
3491    return FPOptions(BinaryOperatorBits.FPFeatures);
3492  }
3493
3494  // Get the FP contractability status of this operator. Only meaningful for
3495  // operations on floating point types.
3496  bool isFPContractableWithinStatement() const {
3497    return getFPFeatures().allowFPContractWithinStatement();
3498  }
3499
3500  // Get the FENV_ACCESS status of this operator. Only meaningful for
3501  // operations on floating point types.
3502  bool isFEnvAccessOn() const { return getFPFeatures().allowFEnvAccess(); }
3503
3504protected:
3505  BinaryOperator(Expr *lhsExpr *rhsOpcode opcQualType ResTy,
3506                 ExprValueKind VKExprObjectKind OK,
3507                 SourceLocation opLocFPOptions FPFeaturesbool dead2)
3508    : Expr(CompoundAssignOperatorClass, ResTy, VK, OK,
3509           lhs->isTypeDependent() || rhs->isTypeDependent(),
3510           lhs->isValueDependent() || rhs->isValueDependent(),
3511           (lhs->isInstantiationDependent() ||
3512            rhs->isInstantiationDependent()),
3513           (lhs->containsUnexpandedParameterPack() ||
3514            rhs->containsUnexpandedParameterPack())) {
3515    BinaryOperatorBits.Opc = opc;
3516    BinaryOperatorBits.FPFeatures = FPFeatures.getInt();
3517    BinaryOperatorBits.OpLoc = opLoc;
3518    SubExprs[LHS] = lhs;
3519    SubExprs[RHS] = rhs;
3520  }
3521
3522  BinaryOperator(StmtClass SCEmptyShell Empty) : Expr(SCEmpty) {
3523    BinaryOperatorBits.Opc = BO_MulAssign;
3524  }
3525};
3526
3527/// CompoundAssignOperator - For compound assignments (e.g. +=), we keep
3528/// track of the type the operation is performed in.  Due to the semantics of
3529/// these operators, the operands are promoted, the arithmetic performed, an
3530/// implicit conversion back to the result type done, then the assignment takes
3531/// place.  This captures the intermediate type which the computation is done
3532/// in.
3533class CompoundAssignOperator : public BinaryOperator {
3534  QualType ComputationLHSType;
3535  QualType ComputationResultType;
3536public:
3537  CompoundAssignOperator(Expr *lhsExpr *rhsOpcode opcQualType ResType,
3538                         ExprValueKind VKExprObjectKind OK,
3539                         QualType CompLHSTypeQualType CompResultType,
3540                         SourceLocation OpLocFPOptions FPFeatures)
3541    : BinaryOperator(lhsrhsopcResTypeVKOKOpLocFPFeatures,
3542                     true),
3543      ComputationLHSType(CompLHSType),
3544      ComputationResultType(CompResultType) {
3545     (0) . __assert_fail ("isCompoundAssignmentOp() && \"Only should be used for compound assignments\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 3546, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(isCompoundAssignmentOp() &&
3546 (0) . __assert_fail ("isCompoundAssignmentOp() && \"Only should be used for compound assignments\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 3546, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "Only should be used for compound assignments");
3547  }
3548
3549  /// Build an empty compound assignment operator expression.
3550  explicit CompoundAssignOperator(EmptyShell Empty)
3551    : BinaryOperator(CompoundAssignOperatorClass, Empty) { }
3552
3553  // The two computation types are the type the LHS is converted
3554  // to for the computation and the type of the result; the two are
3555  // distinct in a few cases (specifically, int+=ptr and ptr-=ptr).
3556  QualType getComputationLHSType() const { return ComputationLHSType; }
3557  void setComputationLHSType(QualType T) { ComputationLHSType = T; }
3558
3559  QualType getComputationResultType() const { return ComputationResultType; }
3560  void setComputationResultType(QualType T) { ComputationResultType = T; }
3561
3562  static bool classof(const Stmt *S) {
3563    return S->getStmtClass() == CompoundAssignOperatorClass;
3564  }
3565};
3566
3567/// AbstractConditionalOperator - An abstract base class for
3568/// ConditionalOperator and BinaryConditionalOperator.
3569class AbstractConditionalOperator : public Expr {
3570  SourceLocation QuestionLocColonLoc;
3571  friend class ASTStmtReader;
3572
3573protected:
3574  AbstractConditionalOperator(StmtClass SCQualType T,
3575                              ExprValueKind VKExprObjectKind OK,
3576                              bool TDbool VDbool ID,
3577                              bool ContainsUnexpandedParameterPack,
3578                              SourceLocation qloc,
3579                              SourceLocation cloc)
3580    : Expr(SCTVKOKTDVDIDContainsUnexpandedParameterPack),
3581      QuestionLoc(qloc), ColonLoc(cloc) {}
3582
3583  AbstractConditionalOperator(StmtClass SCEmptyShell Empty)
3584    : Expr(SCEmpty) { }
3585
3586public:
3587  // getCond - Return the expression representing the condition for
3588  //   the ?: operator.
3589  Expr *getCond() const;
3590
3591  // getTrueExpr - Return the subexpression representing the value of
3592  //   the expression if the condition evaluates to true.
3593  Expr *getTrueExpr() const;
3594
3595  // getFalseExpr - Return the subexpression representing the value of
3596  //   the expression if the condition evaluates to false.  This is
3597  //   the same as getRHS.
3598  Expr *getFalseExpr() const;
3599
3600  SourceLocation getQuestionLoc() const { return QuestionLoc; }
3601  SourceLocation getColonLoc() const { return ColonLoc; }
3602
3603  static bool classof(const Stmt *T) {
3604    return T->getStmtClass() == ConditionalOperatorClass ||
3605           T->getStmtClass() == BinaryConditionalOperatorClass;
3606  }
3607};
3608
3609/// ConditionalOperator - The ?: ternary operator.  The GNU "missing
3610/// middle" extension is a BinaryConditionalOperator.
3611class ConditionalOperator : public AbstractConditionalOperator {
3612  enum { CONDLHSRHSEND_EXPR };
3613  StmtSubExprs[END_EXPR]; // Left/Middle/Right hand sides.
3614
3615  friend class ASTStmtReader;
3616public:
3617  ConditionalOperator(Expr *condSourceLocation QLocExpr *lhs,
3618                      SourceLocation CLocExpr *rhs,
3619                      QualType tExprValueKind VKExprObjectKind OK)
3620    : AbstractConditionalOperator(ConditionalOperatorClass, t, VK, OK,
3621           // FIXME: the type of the conditional operator doesn't
3622           // depend on the type of the conditional, but the standard
3623           // seems to imply that it could. File a bug!
3624           (lhs->isTypeDependent() || rhs->isTypeDependent()),
3625           (cond->isValueDependent() || lhs->isValueDependent() ||
3626            rhs->isValueDependent()),
3627           (cond->isInstantiationDependent() ||
3628            lhs->isInstantiationDependent() ||
3629            rhs->isInstantiationDependent()),
3630           (cond->containsUnexpandedParameterPack() ||
3631            lhs->containsUnexpandedParameterPack() ||
3632            rhs->containsUnexpandedParameterPack()),
3633                                  QLoc, CLoc) {
3634    SubExprs[COND] = cond;
3635    SubExprs[LHS] = lhs;
3636    SubExprs[RHS] = rhs;
3637  }
3638
3639  /// Build an empty conditional operator.
3640  explicit ConditionalOperator(EmptyShell Empty)
3641    : AbstractConditionalOperator(ConditionalOperatorClass, Empty) { }
3642
3643  // getCond - Return the expression representing the condition for
3644  //   the ?: operator.
3645  Expr *getCond() const { return cast<Expr>(SubExprs[COND]); }
3646
3647  // getTrueExpr - Return the subexpression representing the value of
3648  //   the expression if the condition evaluates to true.
3649  Expr *getTrueExpr() const { return cast<Expr>(SubExprs[LHS]); }
3650
3651  // getFalseExpr - Return the subexpression representing the value of
3652  //   the expression if the condition evaluates to false.  This is
3653  //   the same as getRHS.
3654  Expr *getFalseExpr() const { return cast<Expr>(SubExprs[RHS]); }
3655
3656  Expr *getLHS() const { return cast<Expr>(SubExprs[LHS]); }
3657  Expr *getRHS() const { return cast<Expr>(SubExprs[RHS]); }
3658
3659  SourceLocation getBeginLoc() const LLVM_READONLY {
3660    return getCond()->getBeginLoc();
3661  }
3662  SourceLocation getEndLoc() const LLVM_READONLY {
3663    return getRHS()->getEndLoc();
3664  }
3665
3666  static bool classof(const Stmt *T) {
3667    return T->getStmtClass() == ConditionalOperatorClass;
3668  }
3669
3670  // Iterators
3671  child_range children() {
3672    return child_range(&SubExprs[0], &SubExprs[0]+END_EXPR);
3673  }
3674  const_child_range children() const {
3675    return const_child_range(&SubExprs[0], &SubExprs[0] + END_EXPR);
3676  }
3677};
3678
3679/// BinaryConditionalOperator - The GNU extension to the conditional
3680/// operator which allows the middle operand to be omitted.
3681///
3682/// This is a different expression kind on the assumption that almost
3683/// every client ends up needing to know that these are different.
3684class BinaryConditionalOperator : public AbstractConditionalOperator {
3685  enum { COMMONCONDLHSRHSNUM_SUBEXPRS };
3686
3687  /// - the common condition/left-hand-side expression, which will be
3688  ///   evaluated as the opaque value
3689  /// - the condition, expressed in terms of the opaque value
3690  /// - the left-hand-side, expressed in terms of the opaque value
3691  /// - the right-hand-side
3692  Stmt *SubExprs[NUM_SUBEXPRS];
3693  OpaqueValueExpr *OpaqueValue;
3694
3695  friend class ASTStmtReader;
3696public:
3697  BinaryConditionalOperator(Expr *commonOpaqueValueExpr *opaqueValue,
3698                            Expr *condExpr *lhsExpr *rhs,
3699                            SourceLocation qlocSourceLocation cloc,
3700                            QualType tExprValueKind VKExprObjectKind OK)
3701    : AbstractConditionalOperator(BinaryConditionalOperatorClass, t, VK, OK,
3702           (common->isTypeDependent() || rhs->isTypeDependent()),
3703           (common->isValueDependent() || rhs->isValueDependent()),
3704           (common->isInstantiationDependent() ||
3705            rhs->isInstantiationDependent()),
3706           (common->containsUnexpandedParameterPack() ||
3707            rhs->containsUnexpandedParameterPack()),
3708                                  qloc, cloc),
3709      OpaqueValue(opaqueValue) {
3710    SubExprs[COMMON] = common;
3711    SubExprs[COND] = cond;
3712    SubExprs[LHS] = lhs;
3713    SubExprs[RHS] = rhs;
3714     (0) . __assert_fail ("OpaqueValue->getSourceExpr() == common && \"Wrong opaque value\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 3714, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(OpaqueValue->getSourceExpr() == common && "Wrong opaque value");
3715  }
3716
3717  /// Build an empty conditional operator.
3718  explicit BinaryConditionalOperator(EmptyShell Empty)
3719    : AbstractConditionalOperator(BinaryConditionalOperatorClass, Empty) { }
3720
3721  /// getCommon - Return the common expression, written to the
3722  ///   left of the condition.  The opaque value will be bound to the
3723  ///   result of this expression.
3724  Expr *getCommon() const { return cast<Expr>(SubExprs[COMMON]); }
3725
3726  /// getOpaqueValue - Return the opaque value placeholder.
3727  OpaqueValueExpr *getOpaqueValue() const { return OpaqueValue; }
3728
3729  /// getCond - Return the condition expression; this is defined
3730  ///   in terms of the opaque value.
3731  Expr *getCond() const { return cast<Expr>(SubExprs[COND]); }
3732
3733  /// getTrueExpr - Return the subexpression which will be
3734  ///   evaluated if the condition evaluates to true;  this is defined
3735  ///   in terms of the opaque value.
3736  Expr *getTrueExpr() const {
3737    return cast<Expr>(SubExprs[LHS]);
3738  }
3739
3740  /// getFalseExpr - Return the subexpression which will be
3741  ///   evaluated if the condnition evaluates to false; this is
3742  ///   defined in terms of the opaque value.
3743  Expr *getFalseExpr() const {
3744    return cast<Expr>(SubExprs[RHS]);
3745  }
3746
3747  SourceLocation getBeginLoc() const LLVM_READONLY {
3748    return getCommon()->getBeginLoc();
3749  }
3750  SourceLocation getEndLoc() const LLVM_READONLY {
3751    return getFalseExpr()->getEndLoc();
3752  }
3753
3754  static bool classof(const Stmt *T) {
3755    return T->getStmtClass() == BinaryConditionalOperatorClass;
3756  }
3757
3758  // Iterators
3759  child_range children() {
3760    return child_range(SubExprs, SubExprs + NUM_SUBEXPRS);
3761  }
3762  const_child_range children() const {
3763    return const_child_range(SubExprs, SubExprs + NUM_SUBEXPRS);
3764  }
3765};
3766
3767inline Expr *AbstractConditionalOperator::getCond() const {
3768  if (const ConditionalOperator *co = dyn_cast<ConditionalOperator>(this))
3769    return co->getCond();
3770  return cast<BinaryConditionalOperator>(this)->getCond();
3771}
3772
3773inline Expr *AbstractConditionalOperator::getTrueExpr() const {
3774  if (const ConditionalOperator *co = dyn_cast<ConditionalOperator>(this))
3775    return co->getTrueExpr();
3776  return cast<BinaryConditionalOperator>(this)->getTrueExpr();
3777}
3778
3779inline Expr *AbstractConditionalOperator::getFalseExpr() const {
3780  if (const ConditionalOperator *co = dyn_cast<ConditionalOperator>(this))
3781    return co->getFalseExpr();
3782  return cast<BinaryConditionalOperator>(this)->getFalseExpr();
3783}
3784
3785/// AddrLabelExpr - The GNU address of label extension, representing &&label.
3786class AddrLabelExpr : public Expr {
3787  SourceLocation AmpAmpLocLabelLoc;
3788  LabelDecl *Label;
3789public:
3790  AddrLabelExpr(SourceLocation AALocSourceLocation LLocLabelDecl *L,
3791                QualType t)
3792    : Expr(AddrLabelExprClass, t, VK_RValue, OK_Ordinary, falsefalsefalse,
3793           false),
3794      AmpAmpLoc(AALoc), LabelLoc(LLoc), Label(L) {}
3795
3796  /// Build an empty address of a label expression.
3797  explicit AddrLabelExpr(EmptyShell Empty)
3798    : Expr(AddrLabelExprClass, Empty) { }
3799
3800  SourceLocation getAmpAmpLoc() const { return AmpAmpLoc; }
3801  void setAmpAmpLoc(SourceLocation L) { AmpAmpLoc = L; }
3802  SourceLocation getLabelLoc() const { return LabelLoc; }
3803  void setLabelLoc(SourceLocation L) { LabelLoc = L; }
3804
3805  SourceLocation getBeginLoc() const LLVM_READONLY { return AmpAmpLoc; }
3806  SourceLocation getEndLoc() const LLVM_READONLY { return LabelLoc; }
3807
3808  LabelDecl *getLabel() const { return Label; }
3809  void setLabel(LabelDecl *L) { Label = L; }
3810
3811  static bool classof(const Stmt *T) {
3812    return T->getStmtClass() == AddrLabelExprClass;
3813  }
3814
3815  // Iterators
3816  child_range children() {
3817    return child_range(child_iterator(), child_iterator());
3818  }
3819  const_child_range children() const {
3820    return const_child_range(const_child_iterator(), const_child_iterator());
3821  }
3822};
3823
3824/// StmtExpr - This is the GNU Statement Expression extension: ({int X=4; X;}).
3825/// The StmtExpr contains a single CompoundStmt node, which it evaluates and
3826/// takes the value of the last subexpression.
3827///
3828/// A StmtExpr is always an r-value; values "returned" out of a
3829/// StmtExpr will be copied.
3830class StmtExpr : public Expr {
3831  Stmt *SubStmt;
3832  SourceLocation LParenLocRParenLoc;
3833public:
3834  // FIXME: Does type-dependence need to be computed differently?
3835  // FIXME: Do we need to compute instantiation instantiation-dependence for
3836  // statements? (ugh!)
3837  StmtExpr(CompoundStmt *substmtQualType T,
3838           SourceLocation lpSourceLocation rp) :
3839    Expr(StmtExprClass, T, VK_RValue, OK_Ordinary,
3840         T->isDependentType(), falsefalsefalse),
3841    SubStmt(substmt), LParenLoc(lp), RParenLoc(rp) { }
3842
3843  /// Build an empty statement expression.
3844  explicit StmtExpr(EmptyShell Empty) : Expr(StmtExprClass, Empty) { }
3845
3846  CompoundStmt *getSubStmt() { return cast<CompoundStmt>(SubStmt); }
3847  const CompoundStmt *getSubStmt() const { return cast<CompoundStmt>(SubStmt); }
3848  void setSubStmt(CompoundStmt *S) { SubStmt = S; }
3849
3850  SourceLocation getBeginLoc() const LLVM_READONLY { return LParenLoc; }
3851  SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; }
3852
3853  SourceLocation getLParenLoc() const { return LParenLoc; }
3854  void setLParenLoc(SourceLocation L) { LParenLoc = L; }
3855  SourceLocation getRParenLoc() const { return RParenLoc; }
3856  void setRParenLoc(SourceLocation L) { RParenLoc = L; }
3857
3858  static bool classof(const Stmt *T) {
3859    return T->getStmtClass() == StmtExprClass;
3860  }
3861
3862  // Iterators
3863  child_range children() { return child_range(&SubStmt, &SubStmt+1); }
3864  const_child_range children() const {
3865    return const_child_range(&SubStmt, &SubStmt + 1);
3866  }
3867};
3868
3869/// ShuffleVectorExpr - clang-specific builtin-in function
3870/// __builtin_shufflevector.
3871/// This AST node represents a operator that does a constant
3872/// shuffle, similar to LLVM's shufflevector instruction. It takes
3873/// two vectors and a variable number of constant indices,
3874/// and returns the appropriately shuffled vector.
3875class ShuffleVectorExpr : public Expr {
3876  SourceLocation BuiltinLocRParenLoc;
3877
3878  // SubExprs - the list of values passed to the __builtin_shufflevector
3879  // function. The first two are vectors, and the rest are constant
3880  // indices.  The number of values in this list is always
3881  // 2+the number of indices in the vector type.
3882  Stmt **SubExprs;
3883  unsigned NumExprs;
3884
3885public:
3886  ShuffleVectorExpr(const ASTContext &CArrayRef<Expr*> argsQualType Type,
3887                    SourceLocation BLocSourceLocation RP);
3888
3889  /// Build an empty vector-shuffle expression.
3890  explicit ShuffleVectorExpr(EmptyShell Empty)
3891    : Expr(ShuffleVectorExprClass, Empty), SubExprs(nullptr) { }
3892
3893  SourceLocation getBuiltinLoc() const { return BuiltinLoc; }
3894  void setBuiltinLoc(SourceLocation L) { BuiltinLoc = L; }
3895
3896  SourceLocation getRParenLoc() const { return RParenLoc; }
3897  void setRParenLoc(SourceLocation L) { RParenLoc = L; }
3898
3899  SourceLocation getBeginLoc() const LLVM_READONLY { return BuiltinLoc; }
3900  SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; }
3901
3902  static bool classof(const Stmt *T) {
3903    return T->getStmtClass() == ShuffleVectorExprClass;
3904  }
3905
3906  /// getNumSubExprs - Return the size of the SubExprs array.  This includes the
3907  /// constant expression, the actual arguments passed in, and the function
3908  /// pointers.
3909  unsigned getNumSubExprs() const { return NumExprs; }
3910
3911  /// Retrieve the array of expressions.
3912  Expr **getSubExprs() { return reinterpret_cast<Expr **>(SubExprs); }
3913
3914  /// getExpr - Return the Expr at the specified index.
3915  Expr *getExpr(unsigned Index) {
3916     (0) . __assert_fail ("(Index < NumExprs) && \"Arg access out of range!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 3916, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert((Index < NumExprs) && "Arg access out of range!");
3917    return cast<Expr>(SubExprs[Index]);
3918  }
3919  const Expr *getExpr(unsigned Index) const {
3920     (0) . __assert_fail ("(Index < NumExprs) && \"Arg access out of range!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 3920, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert((Index < NumExprs) && "Arg access out of range!");
3921    return cast<Expr>(SubExprs[Index]);
3922  }
3923
3924  void setExprs(const ASTContext &C, ArrayRef<Expr *> Exprs);
3925
3926  llvm::APSInt getShuffleMaskIdx(const ASTContext &Ctxunsigned Nconst {
3927     (0) . __assert_fail ("(N < NumExprs - 2) && \"Shuffle idx out of range!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 3927, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert((N < NumExprs - 2) && "Shuffle idx out of range!");
3928    return getExpr(N+2)->EvaluateKnownConstInt(Ctx);
3929  }
3930
3931  // Iterators
3932  child_range children() {
3933    return child_range(&SubExprs[0], &SubExprs[0]+NumExprs);
3934  }
3935  const_child_range children() const {
3936    return const_child_range(&SubExprs[0], &SubExprs[0] + NumExprs);
3937  }
3938};
3939
3940/// ConvertVectorExpr - Clang builtin function __builtin_convertvector
3941/// This AST node provides support for converting a vector type to another
3942/// vector type of the same arity.
3943class ConvertVectorExpr : public Expr {
3944private:
3945  Stmt *SrcExpr;
3946  TypeSourceInfo *TInfo;
3947  SourceLocation BuiltinLocRParenLoc;
3948
3949  friend class ASTReader;
3950  friend class ASTStmtReader;
3951  explicit ConvertVectorExpr(EmptyShell Empty) : Expr(ConvertVectorExprClass, Empty) {}
3952
3953public:
3954  ConvertVectorExpr(ExprSrcExprTypeSourceInfo *TIQualType DstType,
3955             ExprValueKind VKExprObjectKind OK,
3956             SourceLocation BuiltinLocSourceLocation RParenLoc)
3957    : Expr(ConvertVectorExprClass, DstType, VK, OK,
3958           DstType->isDependentType(),
3959           DstType->isDependentType() || SrcExpr->isValueDependent(),
3960           (DstType->isInstantiationDependentType() ||
3961            SrcExpr->isInstantiationDependent()),
3962           (DstType->containsUnexpandedParameterPack() ||
3963            SrcExpr->containsUnexpandedParameterPack())),
3964  SrcExpr(SrcExpr), TInfo(TI), BuiltinLoc(BuiltinLoc), RParenLoc(RParenLoc) {}
3965
3966  /// getSrcExpr - Return the Expr to be converted.
3967  Expr *getSrcExpr() const { return cast<Expr>(SrcExpr); }
3968
3969  /// getTypeSourceInfo - Return the destination type.
3970  TypeSourceInfo *getTypeSourceInfo() const {
3971    return TInfo;
3972  }
3973  void setTypeSourceInfo(TypeSourceInfo *ti) {
3974    TInfo = ti;
3975  }
3976
3977  /// getBuiltinLoc - Return the location of the __builtin_convertvector token.
3978  SourceLocation getBuiltinLoc() const { return BuiltinLoc; }
3979
3980  /// getRParenLoc - Return the location of final right parenthesis.
3981  SourceLocation getRParenLoc() const { return RParenLoc; }
3982
3983  SourceLocation getBeginLoc() const LLVM_READONLY { return BuiltinLoc; }
3984  SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; }
3985
3986  static bool classof(const Stmt *T) {
3987    return T->getStmtClass() == ConvertVectorExprClass;
3988  }
3989
3990  // Iterators
3991  child_range children() { return child_range(&SrcExpr, &SrcExpr+1); }
3992  const_child_range children() const {
3993    return const_child_range(&SrcExpr, &SrcExpr + 1);
3994  }
3995};
3996
3997/// ChooseExpr - GNU builtin-in function __builtin_choose_expr.
3998/// This AST node is similar to the conditional operator (?:) in C, with
3999/// the following exceptions:
4000/// - the test expression must be a integer constant expression.
4001/// - the expression returned acts like the chosen subexpression in every
4002///   visible way: the type is the same as that of the chosen subexpression,
4003///   and all predicates (whether it's an l-value, whether it's an integer
4004///   constant expression, etc.) return the same result as for the chosen
4005///   sub-expression.
4006class ChooseExpr : public Expr {
4007  enum { CONDLHSRHSEND_EXPR };
4008  StmtSubExprs[END_EXPR]; // Left/Middle/Right hand sides.
4009  SourceLocation BuiltinLocRParenLoc;
4010  bool CondIsTrue;
4011public:
4012  ChooseExpr(SourceLocation BLocExpr *condExpr *lhsExpr *rhs,
4013             QualType tExprValueKind VKExprObjectKind OK,
4014             SourceLocation RPbool condIsTrue,
4015             bool TypeDependentbool ValueDependent)
4016    : Expr(ChooseExprClass, t, VK, OK, TypeDependent, ValueDependent,
4017           (cond->isInstantiationDependent() ||
4018            lhs->isInstantiationDependent() ||
4019            rhs->isInstantiationDependent()),
4020           (cond->containsUnexpandedParameterPack() ||
4021            lhs->containsUnexpandedParameterPack() ||
4022            rhs->containsUnexpandedParameterPack())),
4023      BuiltinLoc(BLoc), RParenLoc(RP), CondIsTrue(condIsTrue) {
4024      SubExprs[COND] = cond;
4025      SubExprs[LHS] = lhs;
4026      SubExprs[RHS] = rhs;
4027    }
4028
4029  /// Build an empty __builtin_choose_expr.
4030  explicit ChooseExpr(EmptyShell Empty) : Expr(ChooseExprClass, Empty) { }
4031
4032  /// isConditionTrue - Return whether the condition is true (i.e. not
4033  /// equal to zero).
4034  bool isConditionTrue() const {
4035     (0) . __assert_fail ("!isConditionDependent() && \"Dependent condition isn't true or false\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 4036, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(!isConditionDependent() &&
4036 (0) . __assert_fail ("!isConditionDependent() && \"Dependent condition isn't true or false\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 4036, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "Dependent condition isn't true or false");
4037    return CondIsTrue;
4038  }
4039  void setIsConditionTrue(bool isTrue) { CondIsTrue = isTrue; }
4040
4041  bool isConditionDependent() const {
4042    return getCond()->isTypeDependent() || getCond()->isValueDependent();
4043  }
4044
4045  /// getChosenSubExpr - Return the subexpression chosen according to the
4046  /// condition.
4047  Expr *getChosenSubExpr() const {
4048    return isConditionTrue() ? getLHS() : getRHS();
4049  }
4050
4051  Expr *getCond() const { return cast<Expr>(SubExprs[COND]); }
4052  void setCond(Expr *E) { SubExprs[COND] = E; }
4053  Expr *getLHS() const { return cast<Expr>(SubExprs[LHS]); }
4054  void setLHS(Expr *E) { SubExprs[LHS] = E; }
4055  Expr *getRHS() const { return cast<Expr>(SubExprs[RHS]); }
4056  void setRHS(Expr *E) { SubExprs[RHS] = E; }
4057
4058  SourceLocation getBuiltinLoc() const { return BuiltinLoc; }
4059  void setBuiltinLoc(SourceLocation L) { BuiltinLoc = L; }
4060
4061  SourceLocation getRParenLoc() const { return RParenLoc; }
4062  void setRParenLoc(SourceLocation L) { RParenLoc = L; }
4063
4064  SourceLocation getBeginLoc() const LLVM_READONLY { return BuiltinLoc; }
4065  SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; }
4066
4067  static bool classof(const Stmt *T) {
4068    return T->getStmtClass() == ChooseExprClass;
4069  }
4070
4071  // Iterators
4072  child_range children() {
4073    return child_range(&SubExprs[0], &SubExprs[0]+END_EXPR);
4074  }
4075  const_child_range children() const {
4076    return const_child_range(&SubExprs[0], &SubExprs[0] + END_EXPR);
4077  }
4078};
4079
4080/// GNUNullExpr - Implements the GNU __null extension, which is a name
4081/// for a null pointer constant that has integral type (e.g., int or
4082/// long) and is the same size and alignment as a pointer. The __null
4083/// extension is typically only used by system headers, which define
4084/// NULL as __null in C++ rather than using 0 (which is an integer
4085/// that may not match the size of a pointer).
4086class GNUNullExpr : public Expr {
4087  /// TokenLoc - The location of the __null keyword.
4088  SourceLocation TokenLoc;
4089
4090public:
4091  GNUNullExpr(QualType TySourceLocation Loc)
4092    : Expr(GNUNullExprClass, Ty, VK_RValue, OK_Ordinary, falsefalsefalse,
4093           false),
4094      TokenLoc(Loc) { }
4095
4096  /// Build an empty GNU __null expression.
4097  explicit GNUNullExpr(EmptyShell Empty) : Expr(GNUNullExprClass, Empty) { }
4098
4099  /// getTokenLocation - The location of the __null token.
4100  SourceLocation getTokenLocation() const { return TokenLoc; }
4101  void setTokenLocation(SourceLocation L) { TokenLoc = L; }
4102
4103  SourceLocation getBeginLoc() const LLVM_READONLY { return TokenLoc; }
4104  SourceLocation getEndLoc() const LLVM_READONLY { return TokenLoc; }
4105
4106  static bool classof(const Stmt *T) {
4107    return T->getStmtClass() == GNUNullExprClass;
4108  }
4109
4110  // Iterators
4111  child_range children() {
4112    return child_range(child_iterator(), child_iterator());
4113  }
4114  const_child_range children() const {
4115    return const_child_range(const_child_iterator(), const_child_iterator());
4116  }
4117};
4118
4119/// Represents a call to the builtin function \c __builtin_va_arg.
4120class VAArgExpr : public Expr {
4121  Stmt *Val;
4122  llvm::PointerIntPair<TypeSourceInfo *, 1boolTInfo;
4123  SourceLocation BuiltinLocRParenLoc;
4124public:
4125  VAArgExpr(SourceLocation BLocExpr *eTypeSourceInfo *TInfo,
4126            SourceLocation RPLocQualType tbool IsMS)
4127      : Expr(VAArgExprClass, t, VK_RValue, OK_Ordinary, t->isDependentType(),
4128             false, (TInfo->getType()->isInstantiationDependentType() ||
4129                     e->isInstantiationDependent()),
4130             (TInfo->getType()->containsUnexpandedParameterPack() ||
4131              e->containsUnexpandedParameterPack())),
4132        Val(e), TInfo(TInfo, IsMS), BuiltinLoc(BLoc), RParenLoc(RPLoc) {}
4133
4134  /// Create an empty __builtin_va_arg expression.
4135  explicit VAArgExpr(EmptyShell Empty)
4136      : Expr(VAArgExprClass, Empty), Val(nullptr), TInfo(nullptrfalse) {}
4137
4138  const Expr *getSubExpr() const { return cast<Expr>(Val); }
4139  Expr *getSubExpr() { return cast<Expr>(Val); }
4140  void setSubExpr(Expr *E) { Val = E; }
4141
4142  /// Returns whether this is really a Win64 ABI va_arg expression.
4143  bool isMicrosoftABI() const { return TInfo.getInt(); }
4144  void setIsMicrosoftABI(bool IsMS) { TInfo.setInt(IsMS); }
4145
4146  TypeSourceInfo *getWrittenTypeInfo() const { return TInfo.getPointer(); }
4147  void setWrittenTypeInfo(TypeSourceInfo *TI) { TInfo.setPointer(TI); }
4148
4149  SourceLocation getBuiltinLoc() const { return BuiltinLoc; }
4150  void setBuiltinLoc(SourceLocation L) { BuiltinLoc = L; }
4151
4152  SourceLocation getRParenLoc() const { return RParenLoc; }
4153  void setRParenLoc(SourceLocation L) { RParenLoc = L; }
4154
4155  SourceLocation getBeginLoc() const LLVM_READONLY { return BuiltinLoc; }
4156  SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; }
4157
4158  static bool classof(const Stmt *T) {
4159    return T->getStmtClass() == VAArgExprClass;
4160  }
4161
4162  // Iterators
4163  child_range children() { return child_range(&Val, &Val+1); }
4164  const_child_range children() const {
4165    return const_child_range(&Val, &Val + 1);
4166  }
4167};
4168
4169/// Describes an C or C++ initializer list.
4170///
4171/// InitListExpr describes an initializer list, which can be used to
4172/// initialize objects of different types, including
4173/// struct/class/union types, arrays, and vectors. For example:
4174///
4175/// @code
4176/// struct foo x = { 1, { 2, 3 } };
4177/// @endcode
4178///
4179/// Prior to semantic analysis, an initializer list will represent the
4180/// initializer list as written by the user, but will have the
4181/// placeholder type "void". This initializer list is called the
4182/// syntactic form of the initializer, and may contain C99 designated
4183/// initializers (represented as DesignatedInitExprs), initializations
4184/// of subobject members without explicit braces, and so on. Clients
4185/// interested in the original syntax of the initializer list should
4186/// use the syntactic form of the initializer list.
4187///
4188/// After semantic analysis, the initializer list will represent the
4189/// semantic form of the initializer, where the initializations of all
4190/// subobjects are made explicit with nested InitListExpr nodes and
4191/// C99 designators have been eliminated by placing the designated
4192/// initializations into the subobject they initialize. Additionally,
4193/// any "holes" in the initialization, where no initializer has been
4194/// specified for a particular subobject, will be replaced with
4195/// implicitly-generated ImplicitValueInitExpr expressions that
4196/// value-initialize the subobjects. Note, however, that the
4197/// initializer lists may still have fewer initializers than there are
4198/// elements to initialize within the object.
4199///
4200/// After semantic analysis has completed, given an initializer list,
4201/// method isSemanticForm() returns true if and only if this is the
4202/// semantic form of the initializer list (note: the same AST node
4203/// may at the same time be the syntactic form).
4204/// Given the semantic form of the initializer list, one can retrieve
4205/// the syntactic form of that initializer list (when different)
4206/// using method getSyntacticForm(); the method returns null if applied
4207/// to a initializer list which is already in syntactic form.
4208/// Similarly, given the syntactic form (i.e., an initializer list such
4209/// that isSemanticForm() returns false), one can retrieve the semantic
4210/// form using method getSemanticForm().
4211/// Since many initializer lists have the same syntactic and semantic forms,
4212/// getSyntacticForm() may return NULL, indicating that the current
4213/// semantic initializer list also serves as its syntactic form.
4214class InitListExpr : public Expr {
4215  // FIXME: Eliminate this vector in favor of ASTContext allocation
4216  typedef ASTVector<Stmt *> InitExprsTy;
4217  InitExprsTy InitExprs;
4218  SourceLocation LBraceLocRBraceLoc;
4219
4220  /// The alternative form of the initializer list (if it exists).
4221  /// The int part of the pair stores whether this initializer list is
4222  /// in semantic form. If not null, the pointer points to:
4223  ///   - the syntactic form, if this is in semantic form;
4224  ///   - the semantic form, if this is in syntactic form.
4225  llvm::PointerIntPair<InitListExpr *, 1boolAltForm;
4226
4227  /// Either:
4228  ///  If this initializer list initializes an array with more elements than
4229  ///  there are initializers in the list, specifies an expression to be used
4230  ///  for value initialization of the rest of the elements.
4231  /// Or
4232  ///  If this initializer list initializes a union, specifies which
4233  ///  field within the union will be initialized.
4234  llvm::PointerUnion<Expr *, FieldDecl *> ArrayFillerOrUnionFieldInit;
4235
4236public:
4237  InitListExpr(const ASTContext &CSourceLocation lbraceloc,
4238               ArrayRef<Expr*> initExprsSourceLocation rbraceloc);
4239
4240  /// Build an empty initializer list.
4241  explicit InitListExpr(EmptyShell Empty)
4242    : Expr(InitListExprClass, Empty), AltForm(nullptrtrue) { }
4243
4244  unsigned getNumInits() const { return InitExprs.size(); }
4245
4246  /// Retrieve the set of initializers.
4247  Expr **getInits() { return reinterpret_cast<Expr **>(InitExprs.data()); }
4248
4249  /// Retrieve the set of initializers.
4250  Expr * const *getInits() const {
4251    return reinterpret_cast<Expr * const *>(InitExprs.data());
4252  }
4253
4254  ArrayRef<Expr *> inits() {
4255    return llvm::makeArrayRef(getInits(), getNumInits());
4256  }
4257
4258  ArrayRef<Expr *> inits() const {
4259    return llvm::makeArrayRef(getInits(), getNumInits());
4260  }
4261
4262  const Expr *getInit(unsigned Initconst {
4263     (0) . __assert_fail ("Init < getNumInits() && \"Initializer access out of range!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 4263, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(Init < getNumInits() && "Initializer access out of range!");
4264    return cast_or_null<Expr>(InitExprs[Init]);
4265  }
4266
4267  Expr *getInit(unsigned Init) {
4268     (0) . __assert_fail ("Init < getNumInits() && \"Initializer access out of range!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 4268, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(Init < getNumInits() && "Initializer access out of range!");
4269    return cast_or_null<Expr>(InitExprs[Init]);
4270  }
4271
4272  void setInit(unsigned InitExpr *expr) {
4273     (0) . __assert_fail ("Init < getNumInits() && \"Initializer access out of range!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 4273, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(Init < getNumInits() && "Initializer access out of range!");
4274    InitExprs[Init] = expr;
4275
4276    if (expr) {
4277      ExprBits.TypeDependent |= expr->isTypeDependent();
4278      ExprBits.ValueDependent |= expr->isValueDependent();
4279      ExprBits.InstantiationDependent |= expr->isInstantiationDependent();
4280      ExprBits.ContainsUnexpandedParameterPack |=
4281          expr->containsUnexpandedParameterPack();
4282    }
4283  }
4284
4285  /// Reserve space for some number of initializers.
4286  void reserveInits(const ASTContext &Cunsigned NumInits);
4287
4288  /// Specify the number of initializers
4289  ///
4290  /// If there are more than @p NumInits initializers, the remaining
4291  /// initializers will be destroyed. If there are fewer than @p
4292  /// NumInits initializers, NULL expressions will be added for the
4293  /// unknown initializers.
4294  void resizeInits(const ASTContext &Contextunsigned NumInits);
4295
4296  /// Updates the initializer at index @p Init with the new
4297  /// expression @p expr, and returns the old expression at that
4298  /// location.
4299  ///
4300  /// When @p Init is out of range for this initializer list, the
4301  /// initializer list will be extended with NULL expressions to
4302  /// accommodate the new entry.
4303  Expr *updateInit(const ASTContext &Cunsigned InitExpr *expr);
4304
4305  /// If this initializer list initializes an array with more elements
4306  /// than there are initializers in the list, specifies an expression to be
4307  /// used for value initialization of the rest of the elements.
4308  Expr *getArrayFiller() {
4309    return ArrayFillerOrUnionFieldInit.dyn_cast<Expr *>();
4310  }
4311  const Expr *getArrayFiller() const {
4312    return const_cast<InitListExpr *>(this)->getArrayFiller();
4313  }
4314  void setArrayFiller(Expr *filler);
4315
4316  /// Return true if this is an array initializer and its array "filler"
4317  /// has been set.
4318  bool hasArrayFiller() const { return getArrayFiller(); }
4319
4320  /// If this initializes a union, specifies which field in the
4321  /// union to initialize.
4322  ///
4323  /// Typically, this field is the first named field within the
4324  /// union. However, a designated initializer can specify the
4325  /// initialization of a different field within the union.
4326  FieldDecl *getInitializedFieldInUnion() {
4327    return ArrayFillerOrUnionFieldInit.dyn_cast<FieldDecl *>();
4328  }
4329  const FieldDecl *getInitializedFieldInUnion() const {
4330    return const_cast<InitListExpr *>(this)->getInitializedFieldInUnion();
4331  }
4332  void setInitializedFieldInUnion(FieldDecl *FD) {
4333     (0) . __assert_fail ("(FD == nullptr || getInitializedFieldInUnion() == nullptr || getInitializedFieldInUnion() == FD) && \"Only one field of a union may be initialized at a time!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 4336, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert((FD == nullptr
4334 (0) . __assert_fail ("(FD == nullptr || getInitializedFieldInUnion() == nullptr || getInitializedFieldInUnion() == FD) && \"Only one field of a union may be initialized at a time!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 4336, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">            || getInitializedFieldInUnion() == nullptr
4335 (0) . __assert_fail ("(FD == nullptr || getInitializedFieldInUnion() == nullptr || getInitializedFieldInUnion() == FD) && \"Only one field of a union may be initialized at a time!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 4336, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">            || getInitializedFieldInUnion() == FD)
4336 (0) . __assert_fail ("(FD == nullptr || getInitializedFieldInUnion() == nullptr || getInitializedFieldInUnion() == FD) && \"Only one field of a union may be initialized at a time!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 4336, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           && "Only one field of a union may be initialized at a time!");
4337    ArrayFillerOrUnionFieldInit = FD;
4338  }
4339
4340  // Explicit InitListExpr's originate from source code (and have valid source
4341  // locations). Implicit InitListExpr's are created by the semantic analyzer.
4342  bool isExplicit() const {
4343    return LBraceLoc.isValid() && RBraceLoc.isValid();
4344  }
4345
4346  // Is this an initializer for an array of characters, initialized by a string
4347  // literal or an @encode?
4348  bool isStringLiteralInit() const;
4349
4350  /// Is this a transparent initializer list (that is, an InitListExpr that is
4351  /// purely syntactic, and whose semantics are that of the sole contained
4352  /// initializer)?
4353  bool isTransparent() const;
4354
4355  /// Is this the zero initializer {0} in a language which considers it
4356  /// idiomatic?
4357  bool isIdiomaticZeroInitializer(const LangOptions &LangOptsconst;
4358
4359  SourceLocation getLBraceLoc() const { return LBraceLoc; }
4360  void setLBraceLoc(SourceLocation Loc) { LBraceLoc = Loc; }
4361  SourceLocation getRBraceLoc() const { return RBraceLoc; }
4362  void setRBraceLoc(SourceLocation Loc) { RBraceLoc = Loc; }
4363
4364  bool isSemanticForm() const { return AltForm.getInt(); }
4365  InitListExpr *getSemanticForm() const {
4366    return isSemanticForm() ? nullptr : AltForm.getPointer();
4367  }
4368  bool isSyntacticForm() const {
4369    return !AltForm.getInt() || !AltForm.getPointer();
4370  }
4371  InitListExpr *getSyntacticForm() const {
4372    return isSemanticForm() ? AltForm.getPointer() : nullptr;
4373  }
4374
4375  void setSyntacticForm(InitListExpr *Init) {
4376    AltForm.setPointer(Init);
4377    AltForm.setInt(true);
4378    Init->AltForm.setPointer(this);
4379    Init->AltForm.setInt(false);
4380  }
4381
4382  bool hadArrayRangeDesignator() const {
4383    return InitListExprBits.HadArrayRangeDesignator != 0;
4384  }
4385  void sawArrayRangeDesignator(bool ARD = true) {
4386    InitListExprBits.HadArrayRangeDesignator = ARD;
4387  }
4388
4389  SourceLocation getBeginLoc() const LLVM_READONLY;
4390  SourceLocation getEndLoc() const LLVM_READONLY;
4391
4392  static bool classof(const Stmt *T) {
4393    return T->getStmtClass() == InitListExprClass;
4394  }
4395
4396  // Iterators
4397  child_range children() {
4398    const_child_range CCR = const_cast<const InitListExpr *>(this)->children();
4399    return child_range(cast_away_const(CCR.begin()),
4400                       cast_away_const(CCR.end()));
4401  }
4402
4403  const_child_range children() const {
4404    // FIXME: This does not include the array filler expression.
4405    if (InitExprs.empty())
4406      return const_child_range(const_child_iterator(), const_child_iterator());
4407    return const_child_range(&InitExprs[0], &InitExprs[0] + InitExprs.size());
4408  }
4409
4410  typedef InitExprsTy::iterator iterator;
4411  typedef InitExprsTy::const_iterator const_iterator;
4412  typedef InitExprsTy::reverse_iterator reverse_iterator;
4413  typedef InitExprsTy::const_reverse_iterator const_reverse_iterator;
4414
4415  iterator begin() { return InitExprs.begin(); }
4416  const_iterator begin() const { return InitExprs.begin(); }
4417  iterator end() { return InitExprs.end(); }
4418  const_iterator end() const { return InitExprs.end(); }
4419  reverse_iterator rbegin() { return InitExprs.rbegin(); }
4420  const_reverse_iterator rbegin() const { return InitExprs.rbegin(); }
4421  reverse_iterator rend() { return InitExprs.rend(); }
4422  const_reverse_iterator rend() const { return InitExprs.rend(); }
4423
4424  friend class ASTStmtReader;
4425  friend class ASTStmtWriter;
4426};
4427
4428/// Represents a C99 designated initializer expression.
4429///
4430/// A designated initializer expression (C99 6.7.8) contains one or
4431/// more designators (which can be field designators, array
4432/// designators, or GNU array-range designators) followed by an
4433/// expression that initializes the field or element(s) that the
4434/// designators refer to. For example, given:
4435///
4436/// @code
4437/// struct point {
4438///   double x;
4439///   double y;
4440/// };
4441/// struct point ptarray[10] = { [2].y = 1.0, [2].x = 2.0, [0].x = 1.0 };
4442/// @endcode
4443///
4444/// The InitListExpr contains three DesignatedInitExprs, the first of
4445/// which covers @c [2].y=1.0. This DesignatedInitExpr will have two
4446/// designators, one array designator for @c [2] followed by one field
4447/// designator for @c .y. The initialization expression will be 1.0.
4448class DesignatedInitExpr final
4449    : public Expr,
4450      private llvm::TrailingObjects<DesignatedInitExpr, Stmt *> {
4451public:
4452  /// Forward declaration of the Designator class.
4453  class Designator;
4454
4455private:
4456  /// The location of the '=' or ':' prior to the actual initializer
4457  /// expression.
4458  SourceLocation EqualOrColonLoc;
4459
4460  /// Whether this designated initializer used the GNU deprecated
4461  /// syntax rather than the C99 '=' syntax.
4462  unsigned GNUSyntax : 1;
4463
4464  /// The number of designators in this initializer expression.
4465  unsigned NumDesignators : 15;
4466
4467  /// The number of subexpressions of this initializer expression,
4468  /// which contains both the initializer and any additional
4469  /// expressions used by array and array-range designators.
4470  unsigned NumSubExprs : 16;
4471
4472  /// The designators in this designated initialization
4473  /// expression.
4474  Designator *Designators;
4475
4476  DesignatedInitExpr(const ASTContext &CQualType Ty,
4477                     llvm::ArrayRef<DesignatorDesignators,
4478                     SourceLocation EqualOrColonLocbool GNUSyntax,
4479                     ArrayRef<Expr *> IndexExprsExpr *Init);
4480
4481  explicit DesignatedInitExpr(unsigned NumSubExprs)
4482    : Expr(DesignatedInitExprClass, EmptyShell()),
4483      NumDesignators(0), NumSubExprs(NumSubExprs), Designators(nullptr) { }
4484
4485public:
4486  /// A field designator, e.g., ".x".
4487  struct FieldDesignator {
4488    /// Refers to the field that is being initialized. The low bit
4489    /// of this field determines whether this is actually a pointer
4490    /// to an IdentifierInfo (if 1) or a FieldDecl (if 0). When
4491    /// initially constructed, a field designator will store an
4492    /// IdentifierInfo*. After semantic analysis has resolved that
4493    /// name, the field designator will instead store a FieldDecl*.
4494    uintptr_t NameOrField;
4495
4496    /// The location of the '.' in the designated initializer.
4497    unsigned DotLoc;
4498
4499    /// The location of the field name in the designated initializer.
4500    unsigned FieldLoc;
4501  };
4502
4503  /// An array or GNU array-range designator, e.g., "[9]" or "[10..15]".
4504  struct ArrayOrRangeDesignator {
4505    /// Location of the first index expression within the designated
4506    /// initializer expression's list of subexpressions.
4507    unsigned Index;
4508    /// The location of the '[' starting the array range designator.
4509    unsigned LBracketLoc;
4510    /// The location of the ellipsis separating the start and end
4511    /// indices. Only valid for GNU array-range designators.
4512    unsigned EllipsisLoc;
4513    /// The location of the ']' terminating the array range designator.
4514    unsigned RBracketLoc;
4515  };
4516
4517  /// Represents a single C99 designator.
4518  ///
4519  /// @todo This class is infuriatingly similar to clang::Designator,
4520  /// but minor differences (storing indices vs. storing pointers)
4521  /// keep us from reusing it. Try harder, later, to rectify these
4522  /// differences.
4523  class Designator {
4524    /// The kind of designator this describes.
4525    enum {
4526      FieldDesignator,
4527      ArrayDesignator,
4528      ArrayRangeDesignator
4529    } Kind;
4530
4531    union {
4532      /// A field designator, e.g., ".x".
4533      struct FieldDesignator Field;
4534      /// An array or GNU array-range designator, e.g., "[9]" or "[10..15]".
4535      struct ArrayOrRangeDesignator ArrayOrRange;
4536    };
4537    friend class DesignatedInitExpr;
4538
4539  public:
4540    Designator() {}
4541
4542    /// Initializes a field designator.
4543    Designator(const IdentifierInfo *FieldNameSourceLocation DotLoc,
4544               SourceLocation FieldLoc)
4545      : Kind(FieldDesignator) {
4546      Field.NameOrField = reinterpret_cast<uintptr_t>(FieldName) | 0x01;
4547      Field.DotLoc = DotLoc.getRawEncoding();
4548      Field.FieldLoc = FieldLoc.getRawEncoding();
4549    }
4550
4551    /// Initializes an array designator.
4552    Designator(unsigned IndexSourceLocation LBracketLoc,
4553               SourceLocation RBracketLoc)
4554      : Kind(ArrayDesignator) {
4555      ArrayOrRange.Index = Index;
4556      ArrayOrRange.LBracketLoc = LBracketLoc.getRawEncoding();
4557      ArrayOrRange.EllipsisLoc = SourceLocation().getRawEncoding();
4558      ArrayOrRange.RBracketLoc = RBracketLoc.getRawEncoding();
4559    }
4560
4561    /// Initializes a GNU array-range designator.
4562    Designator(unsigned IndexSourceLocation LBracketLoc,
4563               SourceLocation EllipsisLocSourceLocation RBracketLoc)
4564      : Kind(ArrayRangeDesignator) {
4565      ArrayOrRange.Index = Index;
4566      ArrayOrRange.LBracketLoc = LBracketLoc.getRawEncoding();
4567      ArrayOrRange.EllipsisLoc = EllipsisLoc.getRawEncoding();
4568      ArrayOrRange.RBracketLoc = RBracketLoc.getRawEncoding();
4569    }
4570
4571    bool isFieldDesignator() const { return Kind == FieldDesignator; }
4572    bool isArrayDesignator() const { return Kind == ArrayDesignator; }
4573    bool isArrayRangeDesignator() const { return Kind == ArrayRangeDesignator; }
4574
4575    IdentifierInfo *getFieldName() const;
4576
4577    FieldDecl *getField() const {
4578       (0) . __assert_fail ("Kind == FieldDesignator && \"Only valid on a field designator\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 4578, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(Kind == FieldDesignator && "Only valid on a field designator");
4579      if (Field.NameOrField & 0x01)
4580        return nullptr;
4581      else
4582        return reinterpret_cast<FieldDecl *>(Field.NameOrField);
4583    }
4584
4585    void setField(FieldDecl *FD) {
4586       (0) . __assert_fail ("Kind == FieldDesignator && \"Only valid on a field designator\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 4586, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(Kind == FieldDesignator && "Only valid on a field designator");
4587      Field.NameOrField = reinterpret_cast<uintptr_t>(FD);
4588    }
4589
4590    SourceLocation getDotLoc() const {
4591       (0) . __assert_fail ("Kind == FieldDesignator && \"Only valid on a field designator\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 4591, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(Kind == FieldDesignator && "Only valid on a field designator");
4592      return SourceLocation::getFromRawEncoding(Field.DotLoc);
4593    }
4594
4595    SourceLocation getFieldLoc() const {
4596       (0) . __assert_fail ("Kind == FieldDesignator && \"Only valid on a field designator\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 4596, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(Kind == FieldDesignator && "Only valid on a field designator");
4597      return SourceLocation::getFromRawEncoding(Field.FieldLoc);
4598    }
4599
4600    SourceLocation getLBracketLoc() const {
4601       (0) . __assert_fail ("(Kind == ArrayDesignator || Kind == ArrayRangeDesignator) && \"Only valid on an array or array-range designator\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 4602, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert((Kind == ArrayDesignator || Kind == ArrayRangeDesignator) &&
4602 (0) . __assert_fail ("(Kind == ArrayDesignator || Kind == ArrayRangeDesignator) && \"Only valid on an array or array-range designator\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 4602, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">             "Only valid on an array or array-range designator");
4603      return SourceLocation::getFromRawEncoding(ArrayOrRange.LBracketLoc);
4604    }
4605
4606    SourceLocation getRBracketLoc() const {
4607       (0) . __assert_fail ("(Kind == ArrayDesignator || Kind == ArrayRangeDesignator) && \"Only valid on an array or array-range designator\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 4608, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert((Kind == ArrayDesignator || Kind == ArrayRangeDesignator) &&
4608 (0) . __assert_fail ("(Kind == ArrayDesignator || Kind == ArrayRangeDesignator) && \"Only valid on an array or array-range designator\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 4608, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">             "Only valid on an array or array-range designator");
4609      return SourceLocation::getFromRawEncoding(ArrayOrRange.RBracketLoc);
4610    }
4611
4612    SourceLocation getEllipsisLoc() const {
4613       (0) . __assert_fail ("Kind == ArrayRangeDesignator && \"Only valid on an array-range designator\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 4614, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(Kind == ArrayRangeDesignator &&
4614 (0) . __assert_fail ("Kind == ArrayRangeDesignator && \"Only valid on an array-range designator\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 4614, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">             "Only valid on an array-range designator");
4615      return SourceLocation::getFromRawEncoding(ArrayOrRange.EllipsisLoc);
4616    }
4617
4618    unsigned getFirstExprIndex() const {
4619       (0) . __assert_fail ("(Kind == ArrayDesignator || Kind == ArrayRangeDesignator) && \"Only valid on an array or array-range designator\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 4620, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert((Kind == ArrayDesignator || Kind == ArrayRangeDesignator) &&
4620 (0) . __assert_fail ("(Kind == ArrayDesignator || Kind == ArrayRangeDesignator) && \"Only valid on an array or array-range designator\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 4620, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">             "Only valid on an array or array-range designator");
4621      return ArrayOrRange.Index;
4622    }
4623
4624    SourceLocation getBeginLoc() const LLVM_READONLY {
4625      if (Kind == FieldDesignator)
4626        return getDotLoc().isInvalid()? getFieldLoc() : getDotLoc();
4627      else
4628        return getLBracketLoc();
4629    }
4630    SourceLocation getEndLoc() const LLVM_READONLY {
4631      return Kind == FieldDesignator ? getFieldLoc() : getRBracketLoc();
4632    }
4633    SourceRange getSourceRange() const LLVM_READONLY {
4634      return SourceRange(getBeginLoc(), getEndLoc());
4635    }
4636  };
4637
4638  static DesignatedInitExpr *Create(const ASTContext &C,
4639                                    llvm::ArrayRef<DesignatorDesignators,
4640                                    ArrayRef<Expr*> IndexExprs,
4641                                    SourceLocation EqualOrColonLoc,
4642                                    bool GNUSyntaxExpr *Init);
4643
4644  static DesignatedInitExpr *CreateEmpty(const ASTContext &C,
4645                                         unsigned NumIndexExprs);
4646
4647  /// Returns the number of designators in this initializer.
4648  unsigned size() const { return NumDesignators; }
4649
4650  // Iterator access to the designators.
4651  llvm::MutableArrayRef<Designatordesignators() {
4652    return {Designators, NumDesignators};
4653  }
4654
4655  llvm::ArrayRef<Designatordesignators() const {
4656    return {Designators, NumDesignators};
4657  }
4658
4659  Designator *getDesignator(unsigned Idx) { return &designators()[Idx]; }
4660  const Designator *getDesignator(unsigned Idxconst {
4661    return &designators()[Idx];
4662  }
4663
4664  void setDesignators(const ASTContext &Cconst Designator *Desigs,
4665                      unsigned NumDesigs);
4666
4667  Expr *getArrayIndex(const Designator &Dconst;
4668  Expr *getArrayRangeStart(const Designator &Dconst;
4669  Expr *getArrayRangeEnd(const Designator &Dconst;
4670
4671  /// Retrieve the location of the '=' that precedes the
4672  /// initializer value itself, if present.
4673  SourceLocation getEqualOrColonLoc() const { return EqualOrColonLoc; }
4674  void setEqualOrColonLoc(SourceLocation L) { EqualOrColonLoc = L; }
4675
4676  /// Determines whether this designated initializer used the
4677  /// deprecated GNU syntax for designated initializers.
4678  bool usesGNUSyntax() const { return GNUSyntax; }
4679  void setGNUSyntax(bool GNU) { GNUSyntax = GNU; }
4680
4681  /// Retrieve the initializer value.
4682  Expr *getInit() const {
4683    return cast<Expr>(*const_cast<DesignatedInitExpr*>(this)->child_begin());
4684  }
4685
4686  void setInit(Expr *init) {
4687    *child_begin() = init;
4688  }
4689
4690  /// Retrieve the total number of subexpressions in this
4691  /// designated initializer expression, including the actual
4692  /// initialized value and any expressions that occur within array
4693  /// and array-range designators.
4694  unsigned getNumSubExprs() const { return NumSubExprs; }
4695
4696  Expr *getSubExpr(unsigned Idxconst {
4697     (0) . __assert_fail ("Idx < NumSubExprs && \"Subscript out of range\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 4697, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(Idx < NumSubExprs && "Subscript out of range");
4698    return cast<Expr>(getTrailingObjects<Stmt *>()[Idx]);
4699  }
4700
4701  void setSubExpr(unsigned IdxExpr *E) {
4702     (0) . __assert_fail ("Idx < NumSubExprs && \"Subscript out of range\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 4702, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(Idx < NumSubExprs && "Subscript out of range");
4703    getTrailingObjects<Stmt *>()[Idx] = E;
4704  }
4705
4706  /// Replaces the designator at index @p Idx with the series
4707  /// of designators in [First, Last).
4708  void ExpandDesignator(const ASTContext &Cunsigned Idx,
4709                        const Designator *Firstconst Designator *Last);
4710
4711  SourceRange getDesignatorsSourceRange() const;
4712
4713  SourceLocation getBeginLoc() const LLVM_READONLY;
4714  SourceLocation getEndLoc() const LLVM_READONLY;
4715
4716  static bool classof(const Stmt *T) {
4717    return T->getStmtClass() == DesignatedInitExprClass;
4718  }
4719
4720  // Iterators
4721  child_range children() {
4722    Stmt **begin = getTrailingObjects<Stmt *>();
4723    return child_range(beginbegin + NumSubExprs);
4724  }
4725  const_child_range children() const {
4726    Stmt * const *begin = getTrailingObjects<Stmt *>();
4727    return const_child_range(beginbegin + NumSubExprs);
4728  }
4729
4730  friend TrailingObjects;
4731};
4732
4733/// Represents a place-holder for an object not to be initialized by
4734/// anything.
4735///
4736/// This only makes sense when it appears as part of an updater of a
4737/// DesignatedInitUpdateExpr (see below). The base expression of a DIUE
4738/// initializes a big object, and the NoInitExpr's mark the spots within the
4739/// big object not to be overwritten by the updater.
4740///
4741/// \see DesignatedInitUpdateExpr
4742class NoInitExpr : public Expr {
4743public:
4744  explicit NoInitExpr(QualType ty)
4745    : Expr(NoInitExprClass, ty, VK_RValue, OK_Ordinary,
4746           falsefalse, ty->isInstantiationDependentType(), false) { }
4747
4748  explicit NoInitExpr(EmptyShell Empty)
4749    : Expr(NoInitExprClass, Empty) { }
4750
4751  static bool classof(const Stmt *T) {
4752    return T->getStmtClass() == NoInitExprClass;
4753  }
4754
4755  SourceLocation getBeginLoc() const LLVM_READONLY { return SourceLocation(); }
4756  SourceLocation getEndLoc() const LLVM_READONLY { return SourceLocation(); }
4757
4758  // Iterators
4759  child_range children() {
4760    return child_range(child_iterator(), child_iterator());
4761  }
4762  const_child_range children() const {
4763    return const_child_range(const_child_iterator(), const_child_iterator());
4764  }
4765};
4766
4767// In cases like:
4768//   struct Q { int a, b, c; };
4769//   Q *getQ();
4770//   void foo() {
4771//     struct A { Q q; } a = { *getQ(), .q.b = 3 };
4772//   }
4773//
4774// We will have an InitListExpr for a, with type A, and then a
4775// DesignatedInitUpdateExpr for "a.q" with type Q. The "base" for this DIUE
4776// is the call expression *getQ(); the "updater" for the DIUE is ".q.b = 3"
4777//
4778class DesignatedInitUpdateExpr : public Expr {
4779  // BaseAndUpdaterExprs[0] is the base expression;
4780  // BaseAndUpdaterExprs[1] is an InitListExpr overwriting part of the base.
4781  Stmt *BaseAndUpdaterExprs[2];
4782
4783public:
4784  DesignatedInitUpdateExpr(const ASTContext &CSourceLocation lBraceLoc,
4785                           Expr *baseExprsSourceLocation rBraceLoc);
4786
4787  explicit DesignatedInitUpdateExpr(EmptyShell Empty)
4788    : Expr(DesignatedInitUpdateExprClass, Empty) { }
4789
4790  SourceLocation getBeginLoc() const LLVM_READONLY;
4791  SourceLocation getEndLoc() const LLVM_READONLY;
4792
4793  static bool classof(const Stmt *T) {
4794    return T->getStmtClass() == DesignatedInitUpdateExprClass;
4795  }
4796
4797  Expr *getBase() const { return cast<Expr>(BaseAndUpdaterExprs[0]); }
4798  void setBase(Expr *Base) { BaseAndUpdaterExprs[0] = Base; }
4799
4800  InitListExpr *getUpdater() const {
4801    return cast<InitListExpr>(BaseAndUpdaterExprs[1]);
4802  }
4803  void setUpdater(Expr *Updater) { BaseAndUpdaterExprs[1] = Updater; }
4804
4805  // Iterators
4806  // children = the base and the updater
4807  child_range children() {
4808    return child_range(&BaseAndUpdaterExprs[0], &BaseAndUpdaterExprs[0] + 2);
4809  }
4810  const_child_range children() const {
4811    return const_child_range(&BaseAndUpdaterExprs[0],
4812                             &BaseAndUpdaterExprs[0] + 2);
4813  }
4814};
4815
4816/// Represents a loop initializing the elements of an array.
4817///
4818/// The need to initialize the elements of an array occurs in a number of
4819/// contexts:
4820///
4821///  * in the implicit copy/move constructor for a class with an array member
4822///  * when a lambda-expression captures an array by value
4823///  * when a decomposition declaration decomposes an array
4824///
4825/// There are two subexpressions: a common expression (the source array)
4826/// that is evaluated once up-front, and a per-element initializer that
4827/// runs once for each array element.
4828///
4829/// Within the per-element initializer, the common expression may be referenced
4830/// via an OpaqueValueExpr, and the current index may be obtained via an
4831/// ArrayInitIndexExpr.
4832class ArrayInitLoopExpr : public Expr {
4833  Stmt *SubExprs[2];
4834
4835  explicit ArrayInitLoopExpr(EmptyShell Empty)
4836      : Expr(ArrayInitLoopExprClass, Empty), SubExprs{} {}
4837
4838public:
4839  explicit ArrayInitLoopExpr(QualType TExpr *CommonInitExpr *ElementInit)
4840      : Expr(ArrayInitLoopExprClass, T, VK_RValue, OK_Ordinary, false,
4841             CommonInit->isValueDependent() || ElementInit->isValueDependent(),
4842             T->isInstantiationDependentType(),
4843             CommonInit->containsUnexpandedParameterPack() ||
4844                 ElementInit->containsUnexpandedParameterPack()),
4845        SubExprs{CommonInitElementInit} {}
4846
4847  /// Get the common subexpression shared by all initializations (the source
4848  /// array).
4849  OpaqueValueExpr *getCommonExpr() const {
4850    return cast<OpaqueValueExpr>(SubExprs[0]);
4851  }
4852
4853  /// Get the initializer to use for each array element.
4854  Expr *getSubExpr() const { return cast<Expr>(SubExprs[1]); }
4855
4856  llvm::APInt getArraySize() const {
4857    return cast<ConstantArrayType>(getType()->castAsArrayTypeUnsafe())
4858        ->getSize();
4859  }
4860
4861  static bool classof(const Stmt *S) {
4862    return S->getStmtClass() == ArrayInitLoopExprClass;
4863  }
4864
4865  SourceLocation getBeginLoc() const LLVM_READONLY {
4866    return getCommonExpr()->getBeginLoc();
4867  }
4868  SourceLocation getEndLoc() const LLVM_READONLY {
4869    return getCommonExpr()->getEndLoc();
4870  }
4871
4872  child_range children() {
4873    return child_range(SubExprs, SubExprs + 2);
4874  }
4875  const_child_range children() const {
4876    return const_child_range(SubExprs, SubExprs + 2);
4877  }
4878
4879  friend class ASTReader;
4880  friend class ASTStmtReader;
4881  friend class ASTStmtWriter;
4882};
4883
4884/// Represents the index of the current element of an array being
4885/// initialized by an ArrayInitLoopExpr. This can only appear within the
4886/// subexpression of an ArrayInitLoopExpr.
4887class ArrayInitIndexExpr : public Expr {
4888  explicit ArrayInitIndexExpr(EmptyShell Empty)
4889      : Expr(ArrayInitIndexExprClass, Empty) {}
4890
4891public:
4892  explicit ArrayInitIndexExpr(QualType T)
4893      : Expr(ArrayInitIndexExprClass, T, VK_RValue, OK_Ordinary,
4894             falsefalsefalsefalse) {}
4895
4896  static bool classof(const Stmt *S) {
4897    return S->getStmtClass() == ArrayInitIndexExprClass;
4898  }
4899
4900  SourceLocation getBeginLoc() const LLVM_READONLY { return SourceLocation(); }
4901  SourceLocation getEndLoc() const LLVM_READONLY { return SourceLocation(); }
4902
4903  child_range children() {
4904    return child_range(child_iterator(), child_iterator());
4905  }
4906  const_child_range children() const {
4907    return const_child_range(const_child_iterator(), const_child_iterator());
4908  }
4909
4910  friend class ASTReader;
4911  friend class ASTStmtReader;
4912};
4913
4914/// Represents an implicitly-generated value initialization of
4915/// an object of a given type.
4916///
4917/// Implicit value initializations occur within semantic initializer
4918/// list expressions (InitListExpr) as placeholders for subobject
4919/// initializations not explicitly specified by the user.
4920///
4921/// \see InitListExpr
4922class ImplicitValueInitExpr : public Expr {
4923public:
4924  explicit ImplicitValueInitExpr(QualType ty)
4925    : Expr(ImplicitValueInitExprClass, ty, VK_RValue, OK_Ordinary,
4926           falsefalse, ty->isInstantiationDependentType(), false) { }
4927
4928  /// Construct an empty implicit value initialization.
4929  explicit ImplicitValueInitExpr(EmptyShell Empty)
4930    : Expr(ImplicitValueInitExprClass, Empty) { }
4931
4932  static bool classof(const Stmt *T) {
4933    return T->getStmtClass() == ImplicitValueInitExprClass;
4934  }
4935
4936  SourceLocation getBeginLoc() const LLVM_READONLY { return SourceLocation(); }
4937  SourceLocation getEndLoc() const LLVM_READONLY { return SourceLocation(); }
4938
4939  // Iterators
4940  child_range children() {
4941    return child_range(child_iterator(), child_iterator());
4942  }
4943  const_child_range children() const {
4944    return const_child_range(const_child_iterator(), const_child_iterator());
4945  }
4946};
4947
4948class ParenListExpr final
4949    : public Expr,
4950      private llvm::TrailingObjects<ParenListExpr, Stmt *> {
4951  friend class ASTStmtReader;
4952  friend TrailingObjects;
4953
4954  /// The location of the left and right parentheses.
4955  SourceLocation LParenLocRParenLoc;
4956
4957  /// Build a paren list.
4958  ParenListExpr(SourceLocation LParenLocArrayRef<Expr *> Exprs,
4959                SourceLocation RParenLoc);
4960
4961  /// Build an empty paren list.
4962  ParenListExpr(EmptyShell Emptyunsigned NumExprs);
4963
4964public:
4965  /// Create a paren list.
4966  static ParenListExpr *Create(const ASTContext &CtxSourceLocation LParenLoc,
4967                               ArrayRef<Expr *> Exprs,
4968                               SourceLocation RParenLoc);
4969
4970  /// Create an empty paren list.
4971  static ParenListExpr *CreateEmpty(const ASTContext &Ctxunsigned NumExprs);
4972
4973  /// Return the number of expressions in this paren list.
4974  unsigned getNumExprs() const { return ParenListExprBits.NumExprs; }
4975
4976  Expr *getExpr(unsigned Init) {
4977     (0) . __assert_fail ("Init < getNumExprs() && \"Initializer access out of range!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 4977, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(Init < getNumExprs() && "Initializer access out of range!");
4978    return getExprs()[Init];
4979  }
4980
4981  const Expr *getExpr(unsigned Initconst {
4982    return const_cast<ParenListExpr *>(this)->getExpr(Init);
4983  }
4984
4985  Expr **getExprs() {
4986    return reinterpret_cast<Expr **>(getTrailingObjects<Stmt *>());
4987  }
4988
4989  ArrayRef<Expr *> exprs() {
4990    return llvm::makeArrayRef(getExprs(), getNumExprs());
4991  }
4992
4993  SourceLocation getLParenLoc() const { return LParenLoc; }
4994  SourceLocation getRParenLoc() const { return RParenLoc; }
4995  SourceLocation getBeginLoc() const { return getLParenLoc(); }
4996  SourceLocation getEndLoc() const { return getRParenLoc(); }
4997
4998  static bool classof(const Stmt *T) {
4999    return T->getStmtClass() == ParenListExprClass;
5000  }
5001
5002  // Iterators
5003  child_range children() {
5004    return child_range(getTrailingObjects<Stmt *>(),
5005                       getTrailingObjects<Stmt *>() + getNumExprs());
5006  }
5007  const_child_range children() const {
5008    return const_child_range(getTrailingObjects<Stmt *>(),
5009                             getTrailingObjects<Stmt *>() + getNumExprs());
5010  }
5011};
5012
5013/// Represents a C11 generic selection.
5014///
5015/// A generic selection (C11 6.5.1.1) contains an unevaluated controlling
5016/// expression, followed by one or more generic associations.  Each generic
5017/// association specifies a type name and an expression, or "default" and an
5018/// expression (in which case it is known as a default generic association).
5019/// The type and value of the generic selection are identical to those of its
5020/// result expression, which is defined as the expression in the generic
5021/// association with a type name that is compatible with the type of the
5022/// controlling expression, or the expression in the default generic association
5023/// if no types are compatible.  For example:
5024///
5025/// @code
5026/// _Generic(X, double: 1, float: 2, default: 3)
5027/// @endcode
5028///
5029/// The above expression evaluates to 1 if 1.0 is substituted for X, 2 if 1.0f
5030/// or 3 if "hello".
5031///
5032/// As an extension, generic selections are allowed in C++, where the following
5033/// additional semantics apply:
5034///
5035/// Any generic selection whose controlling expression is type-dependent or
5036/// which names a dependent type in its association list is result-dependent,
5037/// which means that the choice of result expression is dependent.
5038/// Result-dependent generic associations are both type- and value-dependent.
5039class GenericSelectionExpr final
5040    : public Expr,
5041      private llvm::TrailingObjects<GenericSelectionExpr, Stmt *,
5042                                    TypeSourceInfo *> {
5043  friend class ASTStmtReader;
5044  friend class ASTStmtWriter;
5045  friend TrailingObjects;
5046
5047  /// The number of association expressions and the index of the result
5048  /// expression in the case where the generic selection expression is not
5049  /// result-dependent. The result index is equal to ResultDependentIndex
5050  /// if and only if the generic selection expression is result-dependent.
5051  unsigned NumAssocsResultIndex;
5052  enum : unsigned {
5053    ResultDependentIndex = std::numeric_limits<unsigned>::max(),
5054    ControllingIndex = 0,
5055    AssocExprStartIndex = 1
5056  };
5057
5058  /// The location of the "default" and of the right parenthesis.
5059  SourceLocation DefaultLocRParenLoc;
5060
5061  // GenericSelectionExpr is followed by several trailing objects.
5062  // They are (in order):
5063  //
5064  // * A single Stmt * for the controlling expression.
5065  // * An array of getNumAssocs() Stmt * for the association expressions.
5066  // * An array of getNumAssocs() TypeSourceInfo *, one for each of the
5067  //   association expressions.
5068  unsigned numTrailingObjects(OverloadToken<Stmt *>) const {
5069    // Add one to account for the controlling expression; the remainder
5070    // are the associated expressions.
5071    return 1 + getNumAssocs();
5072  }
5073
5074  unsigned numTrailingObjects(OverloadToken<TypeSourceInfo *>) const {
5075    return getNumAssocs();
5076  }
5077
5078  template <bool Const> class AssociationIteratorTy;
5079  /// Bundle together an association expression and its TypeSourceInfo.
5080  /// The Const template parameter is for the const and non-const versions
5081  /// of AssociationTy.
5082  template <bool Const> class AssociationTy {
5083    friend class GenericSelectionExpr;
5084    template <bool OtherConst> friend class AssociationIteratorTy;
5085    using ExprPtrTy =
5086        typename std::conditional<Constconst Expr *, Expr *>::type;
5087    using TSIPtrTy = typename std::conditional<Constconst TypeSourceInfo *,
5088                                               TypeSourceInfo *>::type;
5089    ExprPtrTy E;
5090    TSIPtrTy TSI;
5091    bool Selected;
5092    AssociationTy(ExprPtrTy ETSIPtrTy TSIbool Selected)
5093        : E(E), TSI(TSI), Selected(Selected) {}
5094
5095  public:
5096    ExprPtrTy getAssociationExpr() const { return E; }
5097    TSIPtrTy getTypeSourceInfo() const { return TSI; }
5098    QualType getType() const { return TSI ? TSI->getType() : QualType(); }
5099    bool isSelected() const { return Selected; }
5100    AssociationTy *operator->() { return this; }
5101    const AssociationTy *operator->() const { return this; }
5102  }; // class AssociationTy
5103
5104  /// Iterator over const and non-const Association objects. The Association
5105  /// objects are created on the fly when the iterator is dereferenced.
5106  /// This abstract over how exactly the association expressions and the
5107  /// corresponding TypeSourceInfo * are stored.
5108  template <bool Const>
5109  class AssociationIteratorTy
5110      : public llvm::iterator_facade_base<
5111            AssociationIteratorTy<Const>, std::input_iterator_tag,
5112            AssociationTy<Const>, std::ptrdiff_t, AssociationTy<Const>,
5113            AssociationTy<Const>> {
5114    friend class GenericSelectionExpr;
5115    // FIXME: This iterator could conceptually be a random access iterator, and
5116    // it would be nice if we could strengthen the iterator category someday.
5117    // However this iterator does not satisfy two requirements of forward
5118    // iterators:
5119    // a) reference = T& or reference = const T&
5120    // b) If It1 and It2 are both dereferenceable, then It1 == It2 if and only
5121    //    if *It1 and *It2 are bound to the same objects.
5122    // An alternative design approach was discussed during review;
5123    // store an Association object inside the iterator, and return a reference
5124    // to it when dereferenced. This idea was discarded beacuse of nasty
5125    // lifetime issues:
5126    //    AssociationIterator It = ...;
5127    //    const Association &Assoc = *It++; // Oops, Assoc is dangling.
5128    using BaseTy = typename AssociationIteratorTy::iterator_facade_base;
5129    using StmtPtrPtrTy =
5130        typename std::conditional<Constconst Stmt *const *, Stmt **>::type;
5131    using TSIPtrPtrTy =
5132        typename std::conditional<Constconst TypeSourceInfo *const *,
5133                                  TypeSourceInfo **>::type;
5134    StmtPtrPtrTy E// = nullptr; FIXME: Once support for gcc 4.8 is dropped.
5135    TSIPtrPtrTy TSI// Kept in sync with E.
5136    unsigned Offset = 0SelectedOffset = 0;
5137    AssociationIteratorTy(StmtPtrPtrTy ETSIPtrPtrTy TSIunsigned Offset,
5138                          unsigned SelectedOffset)
5139        : E(E), TSI(TSI), Offset(Offset), SelectedOffset(SelectedOffset) {}
5140
5141  public:
5142    AssociationIteratorTy() : E(nullptr), TSI(nullptr) {}
5143    typename BaseTy::reference operator*() const {
5144      return AssociationTy<Const>(cast<Expr>(*E), *TSI,
5145                                  Offset == SelectedOffset);
5146    }
5147    typename BaseTy::pointer operator->() const { return **this; }
5148    using BaseTy::operator++;
5149    AssociationIteratorTy &operator++() {
5150      ++E;
5151      ++TSI;
5152      ++Offset;
5153      return *this;
5154    }
5155    bool operator==(AssociationIteratorTy Otherconst { return E == Other.E; }
5156  }; // class AssociationIterator
5157
5158  /// Build a non-result-dependent generic selection expression.
5159  GenericSelectionExpr(const ASTContext &ContextSourceLocation GenericLoc,
5160                       Expr *ControllingExpr,
5161                       ArrayRef<TypeSourceInfo *> AssocTypes,
5162                       ArrayRef<Expr *> AssocExprsSourceLocation DefaultLoc,
5163                       SourceLocation RParenLoc,
5164                       bool ContainsUnexpandedParameterPack,
5165                       unsigned ResultIndex);
5166
5167  /// Build a result-dependent generic selection expression.
5168  GenericSelectionExpr(const ASTContext &ContextSourceLocation GenericLoc,
5169                       Expr *ControllingExpr,
5170                       ArrayRef<TypeSourceInfo *> AssocTypes,
5171                       ArrayRef<Expr *> AssocExprsSourceLocation DefaultLoc,
5172                       SourceLocation RParenLoc,
5173                       bool ContainsUnexpandedParameterPack);
5174
5175  /// Build an empty generic selection expression for deserialization.
5176  explicit GenericSelectionExpr(EmptyShell Emptyunsigned NumAssocs);
5177
5178public:
5179  /// Create a non-result-dependent generic selection expression.
5180  static GenericSelectionExpr *
5181  Create(const ASTContext &ContextSourceLocation GenericLoc,
5182         Expr *ControllingExprArrayRef<TypeSourceInfo *> AssocTypes,
5183         ArrayRef<Expr *> AssocExprsSourceLocation DefaultLoc,
5184         SourceLocation RParenLocbool ContainsUnexpandedParameterPack,
5185         unsigned ResultIndex);
5186
5187  /// Create a result-dependent generic selection expression.
5188  static GenericSelectionExpr *
5189  Create(const ASTContext &ContextSourceLocation GenericLoc,
5190         Expr *ControllingExprArrayRef<TypeSourceInfo *> AssocTypes,
5191         ArrayRef<Expr *> AssocExprsSourceLocation DefaultLoc,
5192         SourceLocation RParenLocbool ContainsUnexpandedParameterPack);
5193
5194  /// Create an empty generic selection expression for deserialization.
5195  static GenericSelectionExpr *CreateEmpty(const ASTContext &Context,
5196                                           unsigned NumAssocs);
5197
5198  using Association = AssociationTy<false>;
5199  using ConstAssociation = AssociationTy<true>;
5200  using AssociationIterator = AssociationIteratorTy<false>;
5201  using ConstAssociationIterator = AssociationIteratorTy<true>;
5202  using association_range = llvm::iterator_range<AssociationIterator>;
5203  using const_association_range =
5204      llvm::iterator_range<ConstAssociationIterator>;
5205
5206  /// The number of association expressions.
5207  unsigned getNumAssocs() const { return NumAssocs; }
5208
5209  /// The zero-based index of the result expression's generic association in
5210  /// the generic selection's association list.  Defined only if the
5211  /// generic selection is not result-dependent.
5212  unsigned getResultIndex() const {
5213     (0) . __assert_fail ("!isResultDependent() && \"Generic selection is result-dependent but getResultIndex called!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 5214, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(!isResultDependent() &&
5214 (0) . __assert_fail ("!isResultDependent() && \"Generic selection is result-dependent but getResultIndex called!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 5214, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "Generic selection is result-dependent but getResultIndex called!");
5215    return ResultIndex;
5216  }
5217
5218  /// Whether this generic selection is result-dependent.
5219  bool isResultDependent() const { return ResultIndex == ResultDependentIndex; }
5220
5221  /// Return the controlling expression of this generic selection expression.
5222  Expr *getControllingExpr() {
5223    return cast<Expr>(getTrailingObjects<Stmt *>()[ControllingIndex]);
5224  }
5225  const Expr *getControllingExpr() const {
5226    return cast<Expr>(getTrailingObjects<Stmt *>()[ControllingIndex]);
5227  }
5228
5229  /// Return the result expression of this controlling expression. Defined if
5230  /// and only if the generic selection expression is not result-dependent.
5231  Expr *getResultExpr() {
5232    return cast<Expr>(
5233        getTrailingObjects<Stmt *>()[AssocExprStartIndex + getResultIndex()]);
5234  }
5235  const Expr *getResultExpr() const {
5236    return cast<Expr>(
5237        getTrailingObjects<Stmt *>()[AssocExprStartIndex + getResultIndex()]);
5238  }
5239
5240  ArrayRef<Expr *> getAssocExprs() const {
5241    return {reinterpret_cast<Expr *const *>(getTrailingObjects<Stmt *>() +
5242                                            AssocExprStartIndex),
5243            NumAssocs};
5244  }
5245  ArrayRef<TypeSourceInfo *> getAssocTypeSourceInfos() const {
5246    return {getTrailingObjects<TypeSourceInfo *>(), NumAssocs};
5247  }
5248
5249  /// Return the Ith association expression with its TypeSourceInfo,
5250  /// bundled together in GenericSelectionExpr::(Const)Association.
5251  Association getAssociation(unsigned I) {
5252     (0) . __assert_fail ("I < getNumAssocs() && \"Out-of-range index in GenericSelectionExpr..getAssociation!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 5253, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(I < getNumAssocs() &&
5253 (0) . __assert_fail ("I < getNumAssocs() && \"Out-of-range index in GenericSelectionExpr..getAssociation!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 5253, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "Out-of-range index in GenericSelectionExpr::getAssociation!");
5254    return Association(
5255        cast<Expr>(getTrailingObjects<Stmt *>()[AssocExprStartIndex + I]),
5256        getTrailingObjects<TypeSourceInfo *>()[I],
5257        !isResultDependent() && (getResultIndex() == I));
5258  }
5259  ConstAssociation getAssociation(unsigned Iconst {
5260     (0) . __assert_fail ("I < getNumAssocs() && \"Out-of-range index in GenericSelectionExpr..getAssociation!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 5261, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(I < getNumAssocs() &&
5261 (0) . __assert_fail ("I < getNumAssocs() && \"Out-of-range index in GenericSelectionExpr..getAssociation!\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 5261, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">           "Out-of-range index in GenericSelectionExpr::getAssociation!");
5262    return ConstAssociation(
5263        cast<Expr>(getTrailingObjects<Stmt *>()[AssocExprStartIndex + I]),
5264        getTrailingObjects<TypeSourceInfo *>()[I],
5265        !isResultDependent() && (getResultIndex() == I));
5266  }
5267
5268  association_range associations() {
5269    AssociationIterator Begin(getTrailingObjects<Stmt *>() +
5270                                  AssocExprStartIndex,
5271                              getTrailingObjects<TypeSourceInfo *>(),
5272                              /*Offset=*/0, ResultIndex);
5273    AssociationIterator End(Begin.E + NumAssocs, Begin.TSI + NumAssocs,
5274                            /*Offset=*/NumAssocs, ResultIndex);
5275    return llvm::make_range(Begin, End);
5276  }
5277
5278  const_association_range associations() const {
5279    ConstAssociationIterator Begin(getTrailingObjects<Stmt *>() +
5280                                       AssocExprStartIndex,
5281                                   getTrailingObjects<TypeSourceInfo *>(),
5282                                   /*Offset=*/0, ResultIndex);
5283    ConstAssociationIterator End(Begin.E + NumAssocs, Begin.TSI + NumAssocs,
5284                                 /*Offset=*/NumAssocs, ResultIndex);
5285    return llvm::make_range(Begin, End);
5286  }
5287
5288  SourceLocation getGenericLoc() const {
5289    return GenericSelectionExprBits.GenericLoc;
5290  }
5291  SourceLocation getDefaultLoc() const { return DefaultLoc; }
5292  SourceLocation getRParenLoc() const { return RParenLoc; }
5293  SourceLocation getBeginLoc() const { return getGenericLoc(); }
5294  SourceLocation getEndLoc() const { return getRParenLoc(); }
5295
5296  static bool classof(const Stmt *T) {
5297    return T->getStmtClass() == GenericSelectionExprClass;
5298  }
5299
5300  child_range children() {
5301    return child_range(getTrailingObjects<Stmt *>(),
5302                       getTrailingObjects<Stmt *>() +
5303                           numTrailingObjects(OverloadToken<Stmt *>()));
5304  }
5305  const_child_range children() const {
5306    return const_child_range(getTrailingObjects<Stmt *>(),
5307                             getTrailingObjects<Stmt *>() +
5308                                 numTrailingObjects(OverloadToken<Stmt *>()));
5309  }
5310};
5311
5312//===----------------------------------------------------------------------===//
5313// Clang Extensions
5314//===----------------------------------------------------------------------===//
5315
5316/// ExtVectorElementExpr - This represents access to specific elements of a
5317/// vector, and may occur on the left hand side or right hand side.  For example
5318/// the following is legal:  "V.xy = V.zw" if V is a 4 element extended vector.
5319///
5320/// Note that the base may have either vector or pointer to vector type, just
5321/// like a struct field reference.
5322///
5323class ExtVectorElementExpr : public Expr {
5324  Stmt *Base;
5325  IdentifierInfo *Accessor;
5326  SourceLocation AccessorLoc;
5327public:
5328  ExtVectorElementExpr(QualType tyExprValueKind VKExpr *base,
5329                       IdentifierInfo &accessorSourceLocation loc)
5330    : Expr(ExtVectorElementExprClass, ty, VK,
5331           (VK == VK_RValue ? OK_Ordinary : OK_VectorComponent),
5332           base->isTypeDependent(), base->isValueDependent(),
5333           base->isInstantiationDependent(),
5334           base->containsUnexpandedParameterPack()),
5335      Base(base), Accessor(&accessor), AccessorLoc(loc) {}
5336
5337  /// Build an empty vector element expression.
5338  explicit ExtVectorElementExpr(EmptyShell Empty)
5339    : Expr(ExtVectorElementExprClass, Empty) { }
5340
5341  const Expr *getBase() const { return cast<Expr>(Base); }
5342  Expr *getBase() { return cast<Expr>(Base); }
5343  void setBase(Expr *E) { Base = E; }
5344
5345  IdentifierInfo &getAccessor() const { return *Accessor; }
5346  void setAccessor(IdentifierInfo *II) { Accessor = II; }
5347
5348  SourceLocation getAccessorLoc() const { return AccessorLoc; }
5349  void setAccessorLoc(SourceLocation L) { AccessorLoc = L; }
5350
5351  /// getNumElements - Get the number of components being selected.
5352  unsigned getNumElements() const;
5353
5354  /// containsDuplicateElements - Return true if any element access is
5355  /// repeated.
5356  bool containsDuplicateElements() const;
5357
5358  /// getEncodedElementAccess - Encode the elements accessed into an llvm
5359  /// aggregate Constant of ConstantInt(s).
5360  void getEncodedElementAccess(SmallVectorImpl<uint32_t> &Eltsconst;
5361
5362  SourceLocation getBeginLoc() const LLVM_READONLY {
5363    return getBase()->getBeginLoc();
5364  }
5365  SourceLocation getEndLoc() const LLVM_READONLY { return AccessorLoc; }
5366
5367  /// isArrow - Return true if the base expression is a pointer to vector,
5368  /// return false if the base expression is a vector.
5369  bool isArrow() const;
5370
5371  static bool classof(const Stmt *T) {
5372    return T->getStmtClass() == ExtVectorElementExprClass;
5373  }
5374
5375  // Iterators
5376  child_range children() { return child_range(&Base, &Base+1); }
5377  const_child_range children() const {
5378    return const_child_range(&Base, &Base + 1);
5379  }
5380};
5381
5382/// BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
5383/// ^{ statement-body }   or   ^(int arg1, float arg2){ statement-body }
5384class BlockExpr : public Expr {
5385protected:
5386  BlockDecl *TheBlock;
5387public:
5388  BlockExpr(BlockDecl *BDQualType ty)
5389    : Expr(BlockExprClass, ty, VK_RValue, OK_Ordinary,
5390           ty->isDependentType(), ty->isDependentType(),
5391           ty->isInstantiationDependentType() || BD->isDependentContext(),
5392           false),
5393      TheBlock(BD) {}
5394
5395  /// Build an empty block expression.
5396  explicit BlockExpr(EmptyShell Empty) : Expr(BlockExprClass, Empty) { }
5397
5398  const BlockDecl *getBlockDecl() const { return TheBlock; }
5399  BlockDecl *getBlockDecl() { return TheBlock; }
5400  void setBlockDecl(BlockDecl *BD) { TheBlock = BD; }
5401
5402  // Convenience functions for probing the underlying BlockDecl.
5403  SourceLocation getCaretLocation() const;
5404  const Stmt *getBody() const;
5405  Stmt *getBody();
5406
5407  SourceLocation getBeginLoc() const LLVM_READONLY {
5408    return getCaretLocation();
5409  }
5410  SourceLocation getEndLoc() const LLVM_READONLY {
5411    return getBody()->getEndLoc();
5412  }
5413
5414  /// getFunctionType - Return the underlying function type for this block.
5415  const FunctionProtoType *getFunctionType() const;
5416
5417  static bool classof(const Stmt *T) {
5418    return T->getStmtClass() == BlockExprClass;
5419  }
5420
5421  // Iterators
5422  child_range children() {
5423    return child_range(child_iterator(), child_iterator());
5424  }
5425  const_child_range children() const {
5426    return const_child_range(const_child_iterator(), const_child_iterator());
5427  }
5428};
5429
5430/// AsTypeExpr - Clang builtin function __builtin_astype [OpenCL 6.2.4.2]
5431/// This AST node provides support for reinterpreting a type to another
5432/// type of the same size.
5433class AsTypeExpr : public Expr {
5434private:
5435  Stmt *SrcExpr;
5436  SourceLocation BuiltinLocRParenLoc;
5437
5438  friend class ASTReader;
5439  friend class ASTStmtReader;
5440  explicit AsTypeExpr(EmptyShell Empty) : Expr(AsTypeExprClass, Empty) {}
5441
5442public:
5443  AsTypeExpr(ExprSrcExprQualType DstType,
5444             ExprValueKind VKExprObjectKind OK,
5445             SourceLocation BuiltinLocSourceLocation RParenLoc)
5446    : Expr(AsTypeExprClass, DstType, VK, OK,
5447           DstType->isDependentType(),
5448           DstType->isDependentType() || SrcExpr->isValueDependent(),
5449           (DstType->isInstantiationDependentType() ||
5450            SrcExpr->isInstantiationDependent()),
5451           (DstType->containsUnexpandedParameterPack() ||
5452            SrcExpr->containsUnexpandedParameterPack())),
5453  SrcExpr(SrcExpr), BuiltinLoc(BuiltinLoc), RParenLoc(RParenLoc) {}
5454
5455  /// getSrcExpr - Return the Expr to be converted.
5456  Expr *getSrcExpr() const { return cast<Expr>(SrcExpr); }
5457
5458  /// getBuiltinLoc - Return the location of the __builtin_astype token.
5459  SourceLocation getBuiltinLoc() const { return BuiltinLoc; }
5460
5461  /// getRParenLoc - Return the location of final right parenthesis.
5462  SourceLocation getRParenLoc() const { return RParenLoc; }
5463
5464  SourceLocation getBeginLoc() const LLVM_READONLY { return BuiltinLoc; }
5465  SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; }
5466
5467  static bool classof(const Stmt *T) {
5468    return T->getStmtClass() == AsTypeExprClass;
5469  }
5470
5471  // Iterators
5472  child_range children() { return child_range(&SrcExpr, &SrcExpr+1); }
5473  const_child_range children() const {
5474    return const_child_range(&SrcExpr, &SrcExpr + 1);
5475  }
5476};
5477
5478/// PseudoObjectExpr - An expression which accesses a pseudo-object
5479/// l-value.  A pseudo-object is an abstract object, accesses to which
5480/// are translated to calls.  The pseudo-object expression has a
5481/// syntactic form, which shows how the expression was actually
5482/// written in the source code, and a semantic form, which is a series
5483/// of expressions to be executed in order which detail how the
5484/// operation is actually evaluated.  Optionally, one of the semantic
5485/// forms may also provide a result value for the expression.
5486///
5487/// If any of the semantic-form expressions is an OpaqueValueExpr,
5488/// that OVE is required to have a source expression, and it is bound
5489/// to the result of that source expression.  Such OVEs may appear
5490/// only in subsequent semantic-form expressions and as
5491/// sub-expressions of the syntactic form.
5492///
5493/// PseudoObjectExpr should be used only when an operation can be
5494/// usefully described in terms of fairly simple rewrite rules on
5495/// objects and functions that are meant to be used by end-developers.
5496/// For example, under the Itanium ABI, dynamic casts are implemented
5497/// as a call to a runtime function called __dynamic_cast; using this
5498/// class to describe that would be inappropriate because that call is
5499/// not really part of the user-visible semantics, and instead the
5500/// cast is properly reflected in the AST and IR-generation has been
5501/// taught to generate the call as necessary.  In contrast, an
5502/// Objective-C property access is semantically defined to be
5503/// equivalent to a particular message send, and this is very much
5504/// part of the user model.  The name of this class encourages this
5505/// modelling design.
5506class PseudoObjectExpr final
5507    : public Expr,
5508      private llvm::TrailingObjects<PseudoObjectExpr, Expr *> {
5509  // PseudoObjectExprBits.NumSubExprs - The number of sub-expressions.
5510  // Always at least two, because the first sub-expression is the
5511  // syntactic form.
5512
5513  // PseudoObjectExprBits.ResultIndex - The index of the
5514  // sub-expression holding the result.  0 means the result is void,
5515  // which is unambiguous because it's the index of the syntactic
5516  // form.  Note that this is therefore 1 higher than the value passed
5517  // in to Create, which is an index within the semantic forms.
5518  // Note also that ASTStmtWriter assumes this encoding.
5519
5520  Expr **getSubExprsBuffer() { return getTrailingObjects<Expr *>(); }
5521  const Expr * const *getSubExprsBuffer() const {
5522    return getTrailingObjects<Expr *>();
5523  }
5524
5525  PseudoObjectExpr(QualType typeExprValueKind VK,
5526                   Expr *syntacticArrayRef<Expr*> semantic,
5527                   unsigned resultIndex);
5528
5529  PseudoObjectExpr(EmptyShell shellunsigned numSemanticExprs);
5530
5531  unsigned getNumSubExprs() const {
5532    return PseudoObjectExprBits.NumSubExprs;
5533  }
5534
5535public:
5536  /// NoResult - A value for the result index indicating that there is
5537  /// no semantic result.
5538  enum : unsigned { NoResult = ~0U };
5539
5540  static PseudoObjectExpr *Create(const ASTContext &ContextExpr *syntactic,
5541                                  ArrayRef<Expr*> semantic,
5542                                  unsigned resultIndex);
5543
5544  static PseudoObjectExpr *Create(const ASTContext &ContextEmptyShell shell,
5545                                  unsigned numSemanticExprs);
5546
5547  /// Return the syntactic form of this expression, i.e. the
5548  /// expression it actually looks like.  Likely to be expressed in
5549  /// terms of OpaqueValueExprs bound in the semantic form.
5550  Expr *getSyntacticForm() { return getSubExprsBuffer()[0]; }
5551  const Expr *getSyntacticForm() const { return getSubExprsBuffer()[0]; }
5552
5553  /// Return the index of the result-bearing expression into the semantics
5554  /// expressions, or PseudoObjectExpr::NoResult if there is none.
5555  unsigned getResultExprIndex() const {
5556    if (PseudoObjectExprBits.ResultIndex == 0return NoResult;
5557    return PseudoObjectExprBits.ResultIndex - 1;
5558  }
5559
5560  /// Return the result-bearing expression, or null if there is none.
5561  Expr *getResultExpr() {
5562    if (PseudoObjectExprBits.ResultIndex == 0)
5563      return nullptr;
5564    return getSubExprsBuffer()[PseudoObjectExprBits.ResultIndex];
5565  }
5566  const Expr *getResultExpr() const {
5567    return const_cast<PseudoObjectExpr*>(this)->getResultExpr();
5568  }
5569
5570  unsigned getNumSemanticExprs() const { return getNumSubExprs() - 1; }
5571
5572  typedef Expr * const *semantics_iterator;
5573  typedef const Expr * const *const_semantics_iterator;
5574  semantics_iterator semantics_begin() {
5575    return getSubExprsBuffer() + 1;
5576  }
5577  const_semantics_iterator semantics_begin() const {
5578    return getSubExprsBuffer() + 1;
5579  }
5580  semantics_iterator semantics_end() {
5581    return getSubExprsBuffer() + getNumSubExprs();
5582  }
5583  const_semantics_iterator semantics_end() const {
5584    return getSubExprsBuffer() + getNumSubExprs();
5585  }
5586
5587  llvm::iterator_range<semantics_iterator> semantics() {
5588    return llvm::make_range(semantics_begin(), semantics_end());
5589  }
5590  llvm::iterator_range<const_semantics_iterator> semantics() const {
5591    return llvm::make_range(semantics_begin(), semantics_end());
5592  }
5593
5594  Expr *getSemanticExpr(unsigned index) {
5595    assert(index + 1 < getNumSubExprs());
5596    return getSubExprsBuffer()[index + 1];
5597  }
5598  const Expr *getSemanticExpr(unsigned indexconst {
5599    return const_cast<PseudoObjectExpr*>(this)->getSemanticExpr(index);
5600  }
5601
5602  SourceLocation getExprLoc() const LLVM_READONLY {
5603    return getSyntacticForm()->getExprLoc();
5604  }
5605
5606  SourceLocation getBeginLoc() const LLVM_READONLY {
5607    return getSyntacticForm()->getBeginLoc();
5608  }
5609  SourceLocation getEndLoc() const LLVM_READONLY {
5610    return getSyntacticForm()->getEndLoc();
5611  }
5612
5613  child_range children() {
5614    const_child_range CCR =
5615        const_cast<const PseudoObjectExpr *>(this)->children();
5616    return child_range(cast_away_const(CCR.begin()),
5617                       cast_away_const(CCR.end()));
5618  }
5619  const_child_range children() const {
5620    Stmt *const *cs = const_cast<Stmt *const *>(
5621        reinterpret_cast<const Stmt *const *>(getSubExprsBuffer()));
5622    return const_child_range(cs, cs + getNumSubExprs());
5623  }
5624
5625  static bool classof(const Stmt *T) {
5626    return T->getStmtClass() == PseudoObjectExprClass;
5627  }
5628
5629  friend TrailingObjects;
5630  friend class ASTStmtReader;
5631};
5632
5633/// AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*,
5634/// __atomic_load, __atomic_store, and __atomic_compare_exchange_*, for the
5635/// similarly-named C++11 instructions, and __c11 variants for <stdatomic.h>,
5636/// and corresponding __opencl_atomic_* for OpenCL 2.0.
5637/// All of these instructions take one primary pointer, at least one memory
5638/// order. The instructions for which getScopeModel returns non-null value
5639/// take one synch scope.
5640class AtomicExpr : public Expr {
5641public:
5642  enum AtomicOp {
5643#define BUILTIN(ID, TYPE, ATTRS)
5644#define ATOMIC_BUILTIN(ID, TYPE, ATTRS) AO ## ID,
5645#include "clang/Basic/Builtins.def"
5646    // Avoid trailing comma
5647    BI_First = 0
5648  };
5649
5650private:
5651  /// Location of sub-expressions.
5652  /// The location of Scope sub-expression is NumSubExprs - 1, which is
5653  /// not fixed, therefore is not defined in enum.
5654  enum { PTRORDERVAL1ORDER_FAILVAL2WEAKEND_EXPR };
5655  Stmt *SubExprs[END_EXPR + 1];
5656  unsigned NumSubExprs;
5657  SourceLocation BuiltinLocRParenLoc;
5658  AtomicOp Op;
5659
5660  friend class ASTStmtReader;
5661public:
5662  AtomicExpr(SourceLocation BLocArrayRef<Expr*> argsQualType t,
5663             AtomicOp opSourceLocation RP);
5664
5665  /// Determine the number of arguments the specified atomic builtin
5666  /// should have.
5667  static unsigned getNumSubExprs(AtomicOp Op);
5668
5669  /// Build an empty AtomicExpr.
5670  explicit AtomicExpr(EmptyShell Empty) : Expr(AtomicExprClass, Empty) { }
5671
5672  Expr *getPtr() const {
5673    return cast<Expr>(SubExprs[PTR]);
5674  }
5675  Expr *getOrder() const {
5676    return cast<Expr>(SubExprs[ORDER]);
5677  }
5678  Expr *getScope() const {
5679     (0) . __assert_fail ("getScopeModel() && \"No scope\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 5679, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(getScopeModel() && "No scope");
5680    return cast<Expr>(SubExprs[NumSubExprs - 1]);
5681  }
5682  Expr *getVal1() const {
5683    if (Op == AO__c11_atomic_init || Op == AO__opencl_atomic_init)
5684      return cast<Expr>(SubExprs[ORDER]);
5685     VAL1", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 5685, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(NumSubExprs > VAL1);
5686    return cast<Expr>(SubExprs[VAL1]);
5687  }
5688  Expr *getOrderFail() const {
5689     ORDER_FAIL", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 5689, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(NumSubExprs > ORDER_FAIL);
5690    return cast<Expr>(SubExprs[ORDER_FAIL]);
5691  }
5692  Expr *getVal2() const {
5693    if (Op == AO__atomic_exchange)
5694      return cast<Expr>(SubExprs[ORDER_FAIL]);
5695     VAL2", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 5695, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(NumSubExprs > VAL2);
5696    return cast<Expr>(SubExprs[VAL2]);
5697  }
5698  Expr *getWeak() const {
5699     WEAK", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 5699, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(NumSubExprs > WEAK);
5700    return cast<Expr>(SubExprs[WEAK]);
5701  }
5702  QualType getValueType() const;
5703
5704  AtomicOp getOp() const { return Op; }
5705  unsigned getNumSubExprs() const { return NumSubExprs; }
5706
5707  Expr **getSubExprs() { return reinterpret_cast<Expr **>(SubExprs); }
5708  const Expr * const *getSubExprs() const {
5709    return reinterpret_cast<Expr * const *>(SubExprs);
5710  }
5711
5712  bool isVolatile() const {
5713    return getPtr()->getType()->getPointeeType().isVolatileQualified();
5714  }
5715
5716  bool isCmpXChg() const {
5717    return getOp() == AO__c11_atomic_compare_exchange_strong ||
5718           getOp() == AO__c11_atomic_compare_exchange_weak ||
5719           getOp() == AO__opencl_atomic_compare_exchange_strong ||
5720           getOp() == AO__opencl_atomic_compare_exchange_weak ||
5721           getOp() == AO__atomic_compare_exchange ||
5722           getOp() == AO__atomic_compare_exchange_n;
5723  }
5724
5725  bool isOpenCL() const {
5726    return getOp() >= AO__opencl_atomic_init &&
5727           getOp() <= AO__opencl_atomic_fetch_max;
5728  }
5729
5730  SourceLocation getBuiltinLoc() const { return BuiltinLoc; }
5731  SourceLocation getRParenLoc() const { return RParenLoc; }
5732
5733  SourceLocation getBeginLoc() const LLVM_READONLY { return BuiltinLoc; }
5734  SourceLocation getEndLoc() const LLVM_READONLY { return RParenLoc; }
5735
5736  static bool classof(const Stmt *T) {
5737    return T->getStmtClass() == AtomicExprClass;
5738  }
5739
5740  // Iterators
5741  child_range children() {
5742    return child_range(SubExprs, SubExprs+NumSubExprs);
5743  }
5744  const_child_range children() const {
5745    return const_child_range(SubExprs, SubExprs + NumSubExprs);
5746  }
5747
5748  /// Get atomic scope model for the atomic op code.
5749  /// \return empty atomic scope model if the atomic op code does not have
5750  ///   scope operand.
5751  static std::unique_ptr<AtomicScopeModel> getScopeModel(AtomicOp Op) {
5752    auto Kind =
5753        (Op >= AO__opencl_atomic_load && Op <= AO__opencl_atomic_fetch_max)
5754            ? AtomicScopeModelKind::OpenCL
5755            : AtomicScopeModelKind::None;
5756    return AtomicScopeModel::create(Kind);
5757  }
5758
5759  /// Get atomic scope model.
5760  /// \return empty atomic scope model if this atomic expression does not have
5761  ///   scope operand.
5762  std::unique_ptr<AtomicScopeModel> getScopeModel() const {
5763    return getScopeModel(getOp());
5764  }
5765};
5766
5767/// TypoExpr - Internal placeholder for expressions where typo correction
5768/// still needs to be performed and/or an error diagnostic emitted.
5769class TypoExpr : public Expr {
5770public:
5771  TypoExpr(QualType T)
5772      : Expr(TypoExprClass, T, VK_LValue, OK_Ordinary,
5773             /*isTypeDependent*/ true,
5774             /*isValueDependent*/ true,
5775             /*isInstantiationDependent*/ true,
5776             /*containsUnexpandedParameterPack*/ false) {
5777     (0) . __assert_fail ("T->isDependentType() && \"TypoExpr given a non-dependent type\"", "/home/seafit/code_projects/clang_source/clang/include/clang/AST/Expr.h", 5777, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(T->isDependentType() && "TypoExpr given a non-dependent type");
5778  }
5779
5780  child_range children() {
5781    return child_range(child_iterator(), child_iterator());
5782  }
5783  const_child_range children() const {
5784    return const_child_range(const_child_iterator(), const_child_iterator());
5785  }
5786
5787  SourceLocation getBeginLoc() const LLVM_READONLY { return SourceLocation(); }
5788  SourceLocation getEndLoc() const LLVM_READONLY { return SourceLocation(); }
5789
5790  static bool classof(const Stmt *T) {
5791    return T->getStmtClass() == TypoExprClass;
5792  }
5793
5794};
5795// end namespace clang
5796
5797#endif // LLVM_CLANG_AST_EXPR_H
5798
clang::SubobjectAdjustment::Kind
clang::SubobjectAdjustment::DTB
clang::SubobjectAdjustment::DTB::BasePath
clang::SubobjectAdjustment::DTB::DerivedClass
clang::SubobjectAdjustment::P
clang::SubobjectAdjustment::P::MPT
clang::SubobjectAdjustment::P::RHS
clang::SubobjectAdjustment::(anonymous union)::DerivedToBase
clang::SubobjectAdjustment::(anonymous union)::Field
clang::SubobjectAdjustment::(anonymous union)::Ptr
clang::Expr::TR
clang::Expr::getType
clang::Expr::setType
clang::Expr::isValueDependent
clang::Expr::setValueDependent
clang::Expr::isTypeDependent
clang::Expr::setTypeDependent
clang::Expr::isInstantiationDependent
clang::Expr::setInstantiationDependent
clang::Expr::containsUnexpandedParameterPack
clang::Expr::setContainsUnexpandedParameterPack
clang::Expr::getExprLoc
clang::Expr::isUnusedResultAWarning
clang::Expr::isLValue
clang::Expr::isRValue
clang::Expr::isXValue
clang::Expr::isGLValue
clang::Expr::LValueClassification
clang::Expr::ClassifyLValue
clang::Expr::isModifiableLvalueResult
clang::Expr::isModifiableLvalue
clang::Expr::Classification
clang::Expr::Classification::Kinds
clang::Expr::Classification::ModifiableType
clang::Expr::Classification::Kind
clang::Expr::Classification::Modifiable
clang::Expr::Classification::getKind
clang::Expr::Classification::getModifiable
clang::Expr::Classification::isLValue
clang::Expr::Classification::isXValue
clang::Expr::Classification::isGLValue
clang::Expr::Classification::isPRValue
clang::Expr::Classification::isRValue
clang::Expr::Classification::isModifiable
clang::Expr::Classification::makeSimpleLValue
clang::Expr::Classify
clang::Expr::ClassifyModifiable
clang::Expr::getValueKindForType
clang::Expr::getValueKind
clang::Expr::getObjectKind
clang::Expr::isOrdinaryOrBitFieldObject
clang::Expr::setValueKind
clang::Expr::setObjectKind
clang::Expr::ClassifyImpl
clang::Expr::refersToBitField
clang::Expr::getSourceBitField
clang::Expr::getSourceBitField
clang::Expr::getReferencedDeclOfCallee
clang::Expr::getReferencedDeclOfCallee
clang::Expr::getObjCProperty
clang::Expr::isObjCSelfExpr
clang::Expr::refersToVectorElement
clang::Expr::refersToGlobalRegisterVar
clang::Expr::hasPlaceholderType
clang::Expr::hasPlaceholderType
clang::Expr::isKnownToHaveBooleanValue
clang::Expr::isIntegerConstantExpr
clang::Expr::isIntegerConstantExpr
clang::Expr::isCXX98IntegralConstantExpr
clang::Expr::isCXX11ConstantExpr
clang::Expr::isPotentialConstantExpr
clang::Expr::isPotentialConstantExprUnevaluated
clang::Expr::isConstantInitializer
clang::Expr::EvalStatus
clang::Expr::EvalStatus::HasSideEffects
clang::Expr::EvalStatus::HasUndefinedBehavior
clang::Expr::EvalStatus::Diag
clang::Expr::EvalStatus::hasSideEffects
clang::Expr::EvalResult
clang::Expr::EvalResult::Val
clang::Expr::EvalResult::isGlobalLValue
clang::Expr::EvaluateAsRValue
clang::Expr::EvaluateAsBooleanCondition
clang::Expr::SideEffectsKind
clang::Expr::EvaluateAsInt
clang::Expr::EvaluateAsFloat
clang::Expr::EvaluateAsFixedPoint
clang::Expr::isEvaluatable
clang::Expr::HasSideEffects
clang::Expr::hasNonTrivialCall
clang::Expr::EvaluateKnownConstInt
clang::Expr::EvaluateKnownConstIntCheckOverflow
clang::Expr::EvaluateForOverflow
clang::Expr::EvaluateAsLValue
clang::Expr::EvaluateAsInitializer
clang::Expr::EvaluateWithSubstitution
clang::Expr::ConstExprUsage
clang::Expr::EvaluateAsConstantExpr
clang::Expr::tryEvaluateObjectSize
clang::Expr::NullPointerConstantKind
clang::Expr::NullPointerConstantValueDependence
clang::Expr::isNullPointerConstant
clang::Expr::isOBJCGCCandidate
clang::Expr::isBoundMemberFunction
clang::Expr::findBoundMemberType
clang::Expr::IgnoreImpCasts
clang::Expr::IgnoreImpCasts
clang::Expr::IgnoreCasts
clang::Expr::IgnoreCasts
clang::Expr::IgnoreImplicit
clang::Expr::IgnoreImplicit
clang::Expr::IgnoreParens
clang::Expr::IgnoreParens
clang::Expr::IgnoreParenImpCasts
clang::Expr::IgnoreParenImpCasts
clang::Expr::IgnoreParenCasts
clang::Expr::IgnoreParenCasts
clang::Expr::IgnoreConversionOperator
clang::Expr::IgnoreConversionOperator
clang::Expr::IgnoreParenLValueCasts
clang::Expr::IgnoreParenLValueCasts
clang::Expr::IgnoreParenNoopCasts
clang::Expr::IgnoreParenNoopCasts
clang::Expr::ignoreParenBaseCasts
clang::Expr::ignoreParenBaseCasts
clang::Expr::isDefaultArgument
clang::Expr::isTemporaryObject
clang::Expr::isImplicitCXXThis
clang::Expr::hasAnyTypeDependentArguments
clang::Expr::getBestDynamicClassType
clang::Expr::getBestDynamicClassTypeExpr
clang::Expr::skipRValueSubobjectAdjustments
clang::Expr::skipRValueSubobjectAdjustments
clang::Expr::classof
clang::FullExpr::SubExpr
clang::FullExpr::getSubExpr
clang::FullExpr::getSubExpr
clang::FullExpr::setSubExpr
clang::FullExpr::classof
clang::ConstantExpr::Create
clang::ConstantExpr::getBeginLoc
clang::OpaqueValueExpr::SourceExpr
clang::OpaqueValueExpr::findInCopyConstruct
clang::OpaqueValueExpr::getLocation
clang::OpaqueValueExpr::getBeginLoc
clang::DeclRefExpr::D
clang::DeclRefExpr::DNLoc
clang::DeclRefExpr::numTrailingObjects
clang::DeclRefExpr::hasFoundDecl
clang::DeclRefExpr::computeDependence
clang::DeclRefExpr::Create
clang::DeclRefExpr::Create
clang::DeclRefExpr::CreateEmpty
clang::DeclRefExpr::getDecl
clang::DeclRefExpr::getDecl
clang::DeclRefExpr::setDecl
clang::DeclRefExpr::getNameInfo
clang::DeclRefExpr::getLocation
clang::DeclRefExpr::setLocation
clang::DeclRefExpr::getBeginLoc
clang::DeclRefExpr::getEndLoc
clang::DeclRefExpr::hasQualifier
clang::DeclRefExpr::getQualifierLoc
clang::DeclRefExpr::getQualifier
clang::DeclRefExpr::getFoundDecl
clang::DeclRefExpr::getFoundDecl
clang::DeclRefExpr::hasTemplateKWAndArgsInfo
clang::DeclRefExpr::getTemplateKeywordLoc
clang::DeclRefExpr::getLAngleLoc
clang::DeclRefExpr::getRAngleLoc
clang::DeclRefExpr::hasTemplateKeyword
clang::DeclRefExpr::hasExplicitTemplateArgs
clang::DeclRefExpr::copyTemplateArgumentsInto
clang::DeclRefExpr::getTemplateArgs
clang::DeclRefExpr::getNumTemplateArgs
clang::DeclRefExpr::template_arguments
clang::DeclRefExpr::hadMultipleCandidates
clang::DeclRefExpr::setHadMultipleCandidates
clang::DeclRefExpr::refersToEnclosingVariableOrCapture
clang::DeclRefExpr::classof
clang::DeclRefExpr::children
clang::DeclRefExpr::children
clang::APNumericStorage::(anonymous union)::VAL
clang::APNumericStorage::(anonymous union)::pVal
clang::APNumericStorage::BitWidth
clang::APNumericStorage::hasAllocation
clang::APNumericStorage::getIntValue
clang::APNumericStorage::setIntValue
clang::APIntStorage::getValue
clang::APIntStorage::setValue
clang::APFloatStorage::getValue
clang::APFloatStorage::setValue
clang::IntegerLiteral::Loc
clang::IntegerLiteral::Create
clang::IntegerLiteral::Create
clang::IntegerLiteral::getBeginLoc
clang::FixedPointLiteral::Loc
clang::FixedPointLiteral::Scale
clang::FixedPointLiteral::CreateFromRawInt
clang::FixedPointLiteral::getBeginLoc
clang::FixedPointLiteral::children
clang::FixedPointLiteral::children
clang::CharacterLiteral::CharacterKind
clang::CharacterLiteral::Value
clang::CharacterLiteral::Loc
clang::CharacterLiteral::getLocation
clang::CharacterLiteral::getKind
clang::CharacterLiteral::getBeginLoc
clang::FloatingLiteral::Loc
clang::FloatingLiteral::Create
clang::FloatingLiteral::Create
clang::FloatingLiteral::getValue
clang::FloatingLiteral::setValue
clang::FloatingLiteral::getRawSemantics
clang::FloatingLiteral::setRawSemantics
clang::FloatingLiteral::getSemantics
clang::FloatingLiteral::setSemantics
clang::FloatingLiteral::isExact
clang::FloatingLiteral::setExact
clang::FloatingLiteral::getValueAsApproximateDouble
clang::FloatingLiteral::getLocation
clang::FloatingLiteral::setLocation
clang::FloatingLiteral::getBeginLoc
clang::ImaginaryLiteral::Val
clang::ImaginaryLiteral::getSubExpr
clang::ImaginaryLiteral::getSubExpr
clang::ImaginaryLiteral::setSubExpr
clang::ImaginaryLiteral::getBeginLoc
clang::StringLiteral::StringKind
clang::StringLiteral::numTrailingObjects
clang::StringLiteral::getStrDataAsChar
clang::StringLiteral::getStrDataAsChar
clang::StringLiteral::getStrDataAsUInt16
clang::StringLiteral::getStrDataAsUInt32
clang::StringLiteral::mapCharByteWidth
clang::StringLiteral::setStrTokenLoc
clang::StringLiteral::Create
clang::StringLiteral::Create
clang::StringLiteral::CreateEmpty
clang::StringLiteral::getString
clang::StringLiteral::getBytes
clang::StringLiteral::outputString
clang::StringLiteral::getCodeUnit
clang::StringLiteral::getByteLength
clang::StringLiteral::getLength
clang::StringLiteral::getCharByteWidth
clang::StringLiteral::getKind
clang::StringLiteral::isAscii
clang::StringLiteral::isWide
clang::StringLiteral::isUTF8
clang::StringLiteral::isUTF16
clang::StringLiteral::isUTF32
clang::StringLiteral::isPascal
clang::StringLiteral::containsNonAscii
clang::StringLiteral::containsNonAsciiOrNull
clang::StringLiteral::getNumConcatenated
clang::StringLiteral::getStrTokenLoc
clang::StringLiteral::getLocationOfByte
clang::StringLiteral::tokloc_begin
clang::StringLiteral::tokloc_end
clang::StringLiteral::getBeginLoc
clang::PredefinedExpr::IdentKind
clang::PredefinedExpr::hasFunctionName
clang::PredefinedExpr::setFunctionName
clang::PredefinedExpr::Create
clang::PredefinedExpr::CreateEmpty
clang::PredefinedExpr::getIdentKind
clang::PredefinedExpr::getLocation
clang::PredefinedExpr::setLocation
clang::PredefinedExpr::getFunctionName
clang::PredefinedExpr::getFunctionName
clang::PredefinedExpr::getIdentKindName
clang::PredefinedExpr::ComputeName
clang::PredefinedExpr::getBeginLoc
clang::PredefinedExpr::getEndLoc
clang::PredefinedExpr::classof
clang::PredefinedExpr::children
clang::ParenExpr::L
clang::ParenExpr::R
clang::ParenExpr::Val
clang::ParenExpr::getSubExpr
clang::ParenExpr::getSubExpr
clang::ParenExpr::setSubExpr
clang::ParenExpr::getBeginLoc
clang::UnaryOperator::Val
clang::UnaryOperator::getOpcode
clang::UnaryOperator::setOpcode
clang::UnaryOperator::getSubExpr
clang::UnaryOperator::setSubExpr
clang::UnaryOperator::getOperatorLoc
clang::UnaryOperator::setOperatorLoc
clang::UnaryOperator::canOverflow
clang::UnaryOperator::setCanOverflow
clang::UnaryOperator::isPostfix
clang::UnaryOperator::isPrefix
clang::UnaryOperator::isPrefix
clang::UnaryOperator::isPostfix
clang::UnaryOperator::isIncrementOp
clang::UnaryOperator::isIncrementOp
clang::UnaryOperator::isDecrementOp
clang::UnaryOperator::isDecrementOp
clang::UnaryOperator::isIncrementDecrementOp
clang::UnaryOperator::isIncrementDecrementOp
clang::UnaryOperator::isArithmeticOp
clang::UnaryOperator::isArithmeticOp
clang::UnaryOperator::getOpcodeStr
clang::UnaryOperator::getOverloadedOpcode
clang::UnaryOperator::getOverloadedOperator
clang::UnaryOperator::getBeginLoc
clang::OffsetOfNode::Kind
clang::OffsetOfNode::Range
clang::OffsetOfNode::Data
clang::OffsetOfNode::getKind
clang::OffsetOfNode::getArrayExprIndex
clang::OffsetOfNode::getField
clang::OffsetOfNode::getFieldName
clang::OffsetOfNode::getBase
clang::OffsetOfNode::getSourceRange
clang::OffsetOfExpr::OperatorLoc
clang::OffsetOfExpr::RParenLoc
clang::OffsetOfExpr::TSInfo
clang::OffsetOfExpr::NumComps
clang::OffsetOfExpr::NumExprs
clang::OffsetOfExpr::numTrailingObjects
clang::OffsetOfExpr::Create
clang::OffsetOfExpr::CreateEmpty
clang::OffsetOfExpr::getOperatorLoc
clang::OffsetOfExpr::setOperatorLoc
clang::OffsetOfExpr::getRParenLoc
clang::OffsetOfExpr::setRParenLoc
clang::OffsetOfExpr::getTypeSourceInfo
clang::OffsetOfExpr::setTypeSourceInfo
clang::OffsetOfExpr::getComponent
clang::OffsetOfExpr::setComponent
clang::OffsetOfExpr::getNumComponents
clang::OffsetOfExpr::getIndexExpr
clang::OffsetOfExpr::getIndexExpr
clang::OffsetOfExpr::setIndexExpr
clang::OffsetOfExpr::getNumExpressions
clang::OffsetOfExpr::getBeginLoc
clang::UnaryExprOrTypeTraitExpr::(anonymous union)::Ty
clang::UnaryExprOrTypeTraitExpr::(anonymous union)::Ex
clang::UnaryExprOrTypeTraitExpr::Argument
clang::UnaryExprOrTypeTraitExpr::OpLoc
clang::UnaryExprOrTypeTraitExpr::RParenLoc
clang::UnaryExprOrTypeTraitExpr::getKind
clang::UnaryExprOrTypeTraitExpr::setKind
clang::UnaryExprOrTypeTraitExpr::isArgumentType
clang::UnaryExprOrTypeTraitExpr::getArgumentType
clang::UnaryExprOrTypeTraitExpr::getArgumentTypeInfo
clang::UnaryExprOrTypeTraitExpr::getArgumentExpr
clang::UnaryExprOrTypeTraitExpr::getArgumentExpr
clang::UnaryExprOrTypeTraitExpr::setArgument
clang::UnaryExprOrTypeTraitExpr::setArgument
clang::UnaryExprOrTypeTraitExpr::getTypeOfArgument
clang::UnaryExprOrTypeTraitExpr::getOperatorLoc
clang::UnaryExprOrTypeTraitExpr::setOperatorLoc
clang::UnaryExprOrTypeTraitExpr::getRParenLoc
clang::UnaryExprOrTypeTraitExpr::setRParenLoc
clang::UnaryExprOrTypeTraitExpr::getBeginLoc
clang::UnaryExprOrTypeTraitExpr::children
clang::ArraySubscriptExpr::SubExprs
clang::ArraySubscriptExpr::lhsIsBase
clang::ArraySubscriptExpr::getLHS
clang::ArraySubscriptExpr::getLHS
clang::ArraySubscriptExpr::setLHS
clang::ArraySubscriptExpr::getRHS
clang::ArraySubscriptExpr::getRHS
clang::ArraySubscriptExpr::setRHS
clang::ArraySubscriptExpr::getBase
clang::ArraySubscriptExpr::getBase
clang::ArraySubscriptExpr::getIdx
clang::ArraySubscriptExpr::getIdx
clang::ArraySubscriptExpr::getBeginLoc
clang::CallExpr::NumArgs
clang::CallExpr::RParenLoc
clang::CallExpr::updateDependenciesFromArg
clang::CallExpr::getTrailingStmts
clang::CallExpr::getTrailingStmts
clang::CallExpr::offsetToTrailingObjects
clang::CallExpr::ADLCallKind
clang::CallExpr::NotADL
clang::CallExpr::UsesADL
clang::CallExpr::sizeOfTrailingObjects
clang::CallExpr::getPreArg
clang::CallExpr::getPreArg
clang::CallExpr::setPreArg
clang::CallExpr::getNumPreArgs
clang::CallExpr::Create
clang::CallExpr::CreateTemporary
clang::CallExpr::CreateEmpty
clang::CallExpr::getCallee
clang::CallExpr::getCallee
clang::CallExpr::setCallee
clang::CallExpr::getADLCallKind
clang::CallExpr::setADLCallKind
clang::CallExpr::usesADL
clang::CallExpr::getCalleeDecl
clang::CallExpr::getCalleeDecl
clang::CallExpr::getDirectCallee
clang::CallExpr::getDirectCallee
clang::CallExpr::getNumArgs
clang::CallExpr::getArgs
clang::CallExpr::getArgs
clang::CallExpr::getArg
clang::CallExpr::getArg
clang::CallExpr::setArg
clang::CallExpr::shrinkNumArgs
clang::CallExpr::setNumArgsUnsafe
clang::CallExpr::arguments
clang::CallExpr::arguments
clang::CallExpr::arg_begin
clang::CallExpr::arg_end
clang::CallExpr::arg_begin
clang::CallExpr::arg_end
clang::CallExpr::getRawSubExprs
clang::CallExpr::getNumCommas
clang::CallExpr::getBuiltinCallee
clang::CallExpr::isUnevaluatedBuiltinCall
clang::CallExpr::getCallReturnType
clang::CallExpr::getUnusedResultAttr
clang::CallExpr::hasUnusedResultAttr
clang::CallExpr::getRParenLoc
clang::CallExpr::setRParenLoc
clang::CallExpr::getBeginLoc
clang::CallExpr::getEndLoc
clang::CallExpr::isBuiltinAssumeFalse
clang::CallExpr::isCallToStdMove
clang::CallExpr::classof
clang::CallExpr::children
clang::CallExpr::children
clang::MemberExprNameQualifier::QualifierLoc
clang::MemberExprNameQualifier::FoundDecl
clang::MemberExpr::Base
clang::MemberExpr::MemberDecl
clang::MemberExpr::MemberDNLoc
clang::MemberExpr::MemberLoc
clang::MemberExpr::numTrailingObjects
clang::MemberExpr::hasQualifierOrFoundDecl
clang::MemberExpr::hasTemplateKWAndArgsInfo
clang::MemberExpr::Create
clang::MemberExpr::setBase
clang::MemberExpr::getBase
clang::MemberExpr::getMemberDecl
clang::MemberExpr::setMemberDecl
clang::MemberExpr::getFoundDecl
clang::MemberExpr::hasQualifier
clang::MemberExpr::getQualifierLoc
clang::MemberExpr::getQualifier
clang::MemberExpr::getTemplateKeywordLoc
clang::MemberExpr::getLAngleLoc
clang::MemberExpr::getRAngleLoc
clang::MemberExpr::hasTemplateKeyword
clang::MemberExpr::hasExplicitTemplateArgs
clang::MemberExpr::copyTemplateArgumentsInto
clang::MemberExpr::getTemplateArgs
clang::MemberExpr::getNumTemplateArgs
clang::MemberExpr::template_arguments
clang::MemberExpr::getMemberNameInfo
clang::MemberExpr::getOperatorLoc
clang::MemberExpr::isArrow
clang::MemberExpr::setArrow
clang::MemberExpr::getMemberLoc
clang::MemberExpr::setMemberLoc
clang::MemberExpr::getBeginLoc
clang::MemberExpr::getEndLoc
clang::MemberExpr::getExprLoc
clang::CompoundLiteralExpr::LParenLoc
clang::CompoundLiteralExpr::TInfoAndScope
clang::CompoundLiteralExpr::Init
clang::CompoundLiteralExpr::getInitializer
clang::CompoundLiteralExpr::getInitializer
clang::CompoundLiteralExpr::setInitializer
clang::CompoundLiteralExpr::isFileScope
clang::CompoundLiteralExpr::setFileScope
clang::CompoundLiteralExpr::getLParenLoc
clang::CompoundLiteralExpr::setLParenLoc
clang::CompoundLiteralExpr::getTypeSourceInfo
clang::CompoundLiteralExpr::setTypeSourceInfo
clang::CompoundLiteralExpr::getBeginLoc
clang::CastExpr::Op
clang::CastExpr::CastConsistency
clang::CastExpr::path_buffer
clang::CastExpr::path_buffer
clang::CastExpr::getCastKind
clang::CastExpr::setCastKind
clang::CastExpr::getCastKindName
clang::CastExpr::getCastKindName
clang::CastExpr::getSubExpr
clang::CastExpr::getSubExpr
clang::CastExpr::setSubExpr
clang::CastExpr::getSubExprAsWritten
clang::CastExpr::getSubExprAsWritten
clang::CastExpr::getConversionFunction
clang::CastExpr::path_empty
clang::CastExpr::path_size
clang::CastExpr::path_begin
clang::CastExpr::path_end
clang::CastExpr::path_begin
clang::CastExpr::path_end
clang::CastExpr::getTargetUnionField
clang::CastExpr::getTargetFieldForToUnionCast
clang::CastExpr::getTargetFieldForToUnionCast
clang::CastExpr::classof
clang::CastExpr::children
clang::CastExpr::children
clang::ImplicitCastExpr::OnStack_t
clang::ImplicitCastExpr::isPartOfExplicitCast
clang::ImplicitCastExpr::setIsPartOfExplicitCast
clang::ImplicitCastExpr::Create
clang::ImplicitCastExpr::CreateEmpty
clang::ImplicitCastExpr::getBeginLoc
clang::ExplicitCastExpr::TInfo
clang::ExplicitCastExpr::getTypeInfoAsWritten
clang::ExplicitCastExpr::setTypeInfoAsWritten
clang::ExplicitCastExpr::getTypeAsWritten
clang::ExplicitCastExpr::classof
clang::CStyleCastExpr::LPLoc
clang::CStyleCastExpr::RPLoc
clang::CStyleCastExpr::Create
clang::CStyleCastExpr::CreateEmpty
clang::CStyleCastExpr::getLParenLoc
clang::CStyleCastExpr::setLParenLoc
clang::CStyleCastExpr::getRParenLoc
clang::CStyleCastExpr::setRParenLoc
clang::CStyleCastExpr::getBeginLoc
clang::BinaryOperator::SubExprs
clang::BinaryOperator::getExprLoc
clang::BinaryOperator::getOperatorLoc
clang::BinaryOperator::setOperatorLoc
clang::BinaryOperator::getOpcode
clang::BinaryOperator::setOpcode
clang::BinaryOperator::getLHS
clang::BinaryOperator::setLHS
clang::BinaryOperator::getRHS
clang::BinaryOperator::setRHS
clang::BinaryOperator::getBeginLoc
clang::BinaryOperator::getOpcodeStr
clang::BinaryOperator::getOverloadedOpcode
clang::BinaryOperator::getOverloadedOperator
clang::BinaryOperator::isPtrMemOp
clang::BinaryOperator::isPtrMemOp
clang::BinaryOperator::isMultiplicativeOp
clang::BinaryOperator::isMultiplicativeOp
clang::BinaryOperator::isAdditiveOp
clang::BinaryOperator::isAdditiveOp
clang::BinaryOperator::isShiftOp
clang::BinaryOperator::isShiftOp
clang::BinaryOperator::isBitwiseOp
clang::BinaryOperator::isBitwiseOp
clang::BinaryOperator::isRelationalOp
clang::BinaryOperator::isRelationalOp
clang::BinaryOperator::isEqualityOp
clang::BinaryOperator::isEqualityOp
clang::BinaryOperator::isComparisonOp
clang::BinaryOperator::isComparisonOp
clang::BinaryOperator::isCommaOp
clang::BinaryOperator::isCommaOp
clang::BinaryOperator::negateComparisonOp
clang::BinaryOperator::reverseComparisonOp
clang::BinaryOperator::isLogicalOp
clang::BinaryOperator::isLogicalOp
clang::BinaryOperator::isAssignmentOp
clang::BinaryOperator::isAssignmentOp
clang::BinaryOperator::isCompoundAssignmentOp
clang::BinaryOperator::isCompoundAssignmentOp
clang::BinaryOperator::getOpForCompoundAssignment
clang::BinaryOperator::isShiftAssignOp
clang::BinaryOperator::isShiftAssignOp
clang::BinaryOperator::isNullPointerArithmeticExtension
clang::BinaryOperator::classof
clang::BinaryOperator::children
clang::BinaryOperator::children
clang::BinaryOperator::setFPFeatures
clang::BinaryOperator::getFPFeatures
clang::BinaryOperator::isFPContractableWithinStatement
clang::BinaryOperator::isFEnvAccessOn
clang::CompoundAssignOperator::ComputationLHSType
clang::CompoundAssignOperator::ComputationResultType
clang::CompoundAssignOperator::getComputationLHSType
clang::CompoundAssignOperator::setComputationLHSType
clang::CompoundAssignOperator::getComputationResultType
clang::CompoundAssignOperator::setComputationResultType
clang::CompoundAssignOperator::classof
clang::AbstractConditionalOperator::QuestionLoc
clang::AbstractConditionalOperator::ColonLoc
clang::AbstractConditionalOperator::getCond
clang::AbstractConditionalOperator::getTrueExpr
clang::AbstractConditionalOperator::getFalseExpr
clang::AbstractConditionalOperator::getQuestionLoc
clang::AbstractConditionalOperator::getColonLoc
clang::AbstractConditionalOperator::classof
clang::ConditionalOperator::SubExprs
clang::ConditionalOperator::getCond
clang::ConditionalOperator::getTrueExpr
clang::ConditionalOperator::getFalseExpr
clang::ConditionalOperator::getLHS
clang::ConditionalOperator::getRHS
clang::ConditionalOperator::getBeginLoc
clang::BinaryConditionalOperator::SubExprs
clang::BinaryConditionalOperator::OpaqueValue
clang::BinaryConditionalOperator::getCommon
clang::BinaryConditionalOperator::getOpaqueValue
clang::BinaryConditionalOperator::getCond
clang::BinaryConditionalOperator::getTrueExpr
clang::BinaryConditionalOperator::getFalseExpr
clang::BinaryConditionalOperator::getBeginLoc
clang::AbstractConditionalOperator::getCond
clang::AbstractConditionalOperator::getTrueExpr
clang::AbstractConditionalOperator::getFalseExpr
clang::AddrLabelExpr::AmpAmpLoc
clang::AddrLabelExpr::LabelLoc
clang::AddrLabelExpr::Label
clang::AddrLabelExpr::getAmpAmpLoc
clang::AddrLabelExpr::setAmpAmpLoc
clang::AddrLabelExpr::getLabelLoc
clang::AddrLabelExpr::setLabelLoc
clang::AddrLabelExpr::getBeginLoc
clang::StmtExpr::SubStmt
clang::StmtExpr::LParenLoc
clang::StmtExpr::RParenLoc
clang::StmtExpr::getSubStmt
clang::StmtExpr::getSubStmt
clang::StmtExpr::setSubStmt
clang::StmtExpr::getBeginLoc
clang::ShuffleVectorExpr::BuiltinLoc
clang::ShuffleVectorExpr::RParenLoc
clang::ShuffleVectorExpr::SubExprs
clang::ShuffleVectorExpr::NumExprs
clang::ShuffleVectorExpr::getBuiltinLoc
clang::ShuffleVectorExpr::setBuiltinLoc
clang::ShuffleVectorExpr::getRParenLoc
clang::ShuffleVectorExpr::setRParenLoc
clang::ShuffleVectorExpr::getBeginLoc
clang::ShuffleVectorExpr::getShuffleMaskIdx
clang::ShuffleVectorExpr::children
clang::ShuffleVectorExpr::children
clang::ConvertVectorExpr::SrcExpr
clang::ConvertVectorExpr::TInfo
clang::ConvertVectorExpr::BuiltinLoc
clang::ConvertVectorExpr::RParenLoc
clang::ConvertVectorExpr::getSrcExpr
clang::ConvertVectorExpr::getTypeSourceInfo
clang::ConvertVectorExpr::setTypeSourceInfo
clang::ConvertVectorExpr::getBuiltinLoc
clang::ConvertVectorExpr::getRParenLoc
clang::ConvertVectorExpr::getBeginLoc
clang::ChooseExpr::SubExprs
clang::ChooseExpr::BuiltinLoc
clang::ChooseExpr::RParenLoc
clang::ChooseExpr::CondIsTrue
clang::ChooseExpr::isConditionTrue
clang::ChooseExpr::setIsConditionTrue
clang::ChooseExpr::isConditionDependent
clang::ChooseExpr::getChosenSubExpr
clang::ChooseExpr::getCond
clang::ChooseExpr::setCond
clang::ChooseExpr::getLHS
clang::ChooseExpr::setLHS
clang::ChooseExpr::getRHS
clang::ChooseExpr::setRHS
clang::ChooseExpr::getBuiltinLoc
clang::ChooseExpr::setBuiltinLoc
clang::ChooseExpr::getRParenLoc
clang::ChooseExpr::setRParenLoc
clang::ChooseExpr::getBeginLoc
clang::GNUNullExpr::TokenLoc
clang::GNUNullExpr::getTokenLocation
clang::GNUNullExpr::setTokenLocation
clang::GNUNullExpr::getBeginLoc
clang::VAArgExpr::Val
clang::VAArgExpr::TInfo
clang::VAArgExpr::BuiltinLoc
clang::VAArgExpr::RParenLoc
clang::VAArgExpr::getSubExpr
clang::VAArgExpr::getSubExpr
clang::VAArgExpr::setSubExpr
clang::VAArgExpr::isMicrosoftABI
clang::VAArgExpr::setIsMicrosoftABI
clang::VAArgExpr::getWrittenTypeInfo
clang::VAArgExpr::setWrittenTypeInfo
clang::VAArgExpr::getBuiltinLoc
clang::VAArgExpr::setBuiltinLoc
clang::VAArgExpr::getRParenLoc
clang::VAArgExpr::setRParenLoc
clang::VAArgExpr::getBeginLoc
clang::InitListExpr::InitExprs
clang::InitListExpr::LBraceLoc
clang::InitListExpr::RBraceLoc
clang::InitListExpr::AltForm
clang::InitListExpr::ArrayFillerOrUnionFieldInit
clang::InitListExpr::getNumInits
clang::InitListExpr::getInits
clang::InitListExpr::getInits
clang::InitListExpr::inits
clang::InitListExpr::inits
clang::InitListExpr::getInit
clang::InitListExpr::getInit
clang::InitListExpr::setInit
clang::InitListExpr::reserveInits
clang::InitListExpr::resizeInits
clang::InitListExpr::updateInit
clang::InitListExpr::getArrayFiller
clang::InitListExpr::getArrayFiller
clang::InitListExpr::setArrayFiller
clang::InitListExpr::hasArrayFiller
clang::InitListExpr::getInitializedFieldInUnion
clang::InitListExpr::getInitializedFieldInUnion
clang::InitListExpr::setInitializedFieldInUnion
clang::InitListExpr::isExplicit
clang::InitListExpr::isStringLiteralInit
clang::InitListExpr::isTransparent
clang::InitListExpr::isIdiomaticZeroInitializer
clang::InitListExpr::getLBraceLoc
clang::InitListExpr::setLBraceLoc
clang::InitListExpr::getRBraceLoc
clang::InitListExpr::setRBraceLoc
clang::InitListExpr::isSemanticForm
clang::InitListExpr::getSemanticForm
clang::InitListExpr::isSyntacticForm
clang::InitListExpr::getSyntacticForm
clang::InitListExpr::setSyntacticForm
clang::InitListExpr::hadArrayRangeDesignator
clang::InitListExpr::sawArrayRangeDesignator
clang::InitListExpr::getBeginLoc
clang::InitListExpr::getEndLoc
clang::InitListExpr::classof
clang::InitListExpr::children
clang::InitListExpr::children
clang::InitListExpr::begin
clang::InitListExpr::begin
clang::InitListExpr::end
clang::InitListExpr::end
clang::InitListExpr::rbegin
clang::InitListExpr::rbegin
clang::InitListExpr::rend
clang::InitListExpr::rend
clang::DesignatedInitExpr::EqualOrColonLoc
clang::DesignatedInitExpr::GNUSyntax
clang::DesignatedInitExpr::NumDesignators
clang::DesignatedInitExpr::NumSubExprs
clang::DesignatedInitExpr::Designators
clang::DesignatedInitExpr::FieldDesignator
clang::DesignatedInitExpr::FieldDesignator::NameOrField
clang::DesignatedInitExpr::FieldDesignator::DotLoc
clang::DesignatedInitExpr::FieldDesignator::FieldLoc
clang::DesignatedInitExpr::ArrayOrRangeDesignator
clang::DesignatedInitExpr::ArrayOrRangeDesignator::Index
clang::DesignatedInitExpr::ArrayOrRangeDesignator::LBracketLoc
clang::DesignatedInitExpr::ArrayOrRangeDesignator::EllipsisLoc
clang::DesignatedInitExpr::ArrayOrRangeDesignator::RBracketLoc
clang::DesignatedInitExpr::Designator
clang::DesignatedInitExpr::Designator::Kind
clang::DesignatedInitExpr::Designator::(anonymous union)::Field
clang::DesignatedInitExpr::Designator::(anonymous union)::ArrayOrRange
clang::DesignatedInitExpr::Designator::isFieldDesignator
clang::DesignatedInitExpr::Designator::isArrayDesignator
clang::DesignatedInitExpr::Designator::isArrayRangeDesignator
clang::DesignatedInitExpr::Designator::getFieldName
clang::DesignatedInitExpr::Designator::getField
clang::DesignatedInitExpr::Designator::setField
clang::DesignatedInitExpr::Designator::getDotLoc
clang::DesignatedInitExpr::Designator::getFieldLoc
clang::DesignatedInitExpr::Designator::getLBracketLoc
clang::DesignatedInitExpr::Designator::getRBracketLoc
clang::DesignatedInitExpr::Designator::getEllipsisLoc
clang::DesignatedInitExpr::Designator::getFirstExprIndex
clang::DesignatedInitExpr::Designator::getBeginLoc
clang::DesignatedInitExpr::Create
clang::DesignatedInitExpr::CreateEmpty
clang::DesignatedInitExpr::size
clang::DesignatedInitExpr::designators
clang::DesignatedInitExpr::designators
clang::DesignatedInitExpr::getDesignator
clang::DesignatedInitExpr::getDesignator
clang::DesignatedInitExpr::setDesignators
clang::DesignatedInitExpr::getArrayIndex
clang::DesignatedInitExpr::getArrayRangeStart
clang::DesignatedInitExpr::getArrayRangeEnd
clang::DesignatedInitExpr::getEqualOrColonLoc
clang::DesignatedInitExpr::setEqualOrColonLoc
clang::DesignatedInitExpr::usesGNUSyntax
clang::DesignatedInitExpr::setGNUSyntax
clang::DesignatedInitExpr::getInit
clang::DesignatedInitExpr::setInit
clang::DesignatedInitExpr::getNumSubExprs
clang::DesignatedInitExpr::getSubExpr
clang::DesignatedInitExpr::setSubExpr
clang::DesignatedInitExpr::ExpandDesignator
clang::DesignatedInitExpr::getDesignatorsSourceRange
clang::DesignatedInitExpr::getBeginLoc
clang::DesignatedInitExpr::getEndLoc
clang::DesignatedInitExpr::classof
clang::DesignatedInitExpr::children
clang::DesignatedInitExpr::children
clang::NoInitExpr::classof
clang::NoInitExpr::getBeginLoc
clang::DesignatedInitUpdateExpr::BaseAndUpdaterExprs
clang::DesignatedInitUpdateExpr::getBeginLoc
clang::DesignatedInitUpdateExpr::getEndLoc
clang::DesignatedInitUpdateExpr::classof
clang::DesignatedInitUpdateExpr::getBase
clang::DesignatedInitUpdateExpr::setBase
clang::DesignatedInitUpdateExpr::getUpdater
clang::DesignatedInitUpdateExpr::setUpdater
clang::DesignatedInitUpdateExpr::children
clang::DesignatedInitUpdateExpr::children
clang::ArrayInitLoopExpr::SubExprs
clang::ArrayInitLoopExpr::getCommonExpr
clang::ArrayInitLoopExpr::getSubExpr
clang::ArrayInitLoopExpr::getArraySize
clang::ArrayInitLoopExpr::classof
clang::ArrayInitLoopExpr::getBeginLoc
clang::ArrayInitIndexExpr::classof
clang::ArrayInitIndexExpr::getBeginLoc
clang::ImplicitValueInitExpr::classof
clang::ImplicitValueInitExpr::getBeginLoc
clang::ParenListExpr::LParenLoc
clang::ParenListExpr::RParenLoc
clang::ParenListExpr::Create
clang::ParenListExpr::CreateEmpty
clang::ParenListExpr::getNumExprs
clang::ParenListExpr::getExpr
clang::ParenListExpr::getExpr
clang::ParenListExpr::getExprs
clang::ParenListExpr::exprs
clang::ParenListExpr::getLParenLoc
clang::ParenListExpr::getRParenLoc
clang::ParenListExpr::getBeginLoc
clang::ParenListExpr::getEndLoc
clang::ParenListExpr::classof
clang::ParenListExpr::children
clang::ParenListExpr::children
clang::GenericSelectionExpr::NumAssocs
clang::GenericSelectionExpr::ResultIndex
clang::GenericSelectionExpr::DefaultLoc
clang::GenericSelectionExpr::RParenLoc
clang::GenericSelectionExpr::numTrailingObjects
clang::GenericSelectionExpr::AssociationTy
clang::GenericSelectionExpr::AssociationTy::E
clang::GenericSelectionExpr::AssociationTy::TSI
clang::GenericSelectionExpr::AssociationTy::Selected
clang::GenericSelectionExpr::AssociationTy::getAssociationExpr
clang::GenericSelectionExpr::AssociationTy::getTypeSourceInfo
clang::GenericSelectionExpr::AssociationTy::getType
clang::GenericSelectionExpr::AssociationTy::isSelected
clang::GenericSelectionExpr::AssociationIteratorTy
clang::GenericSelectionExpr::AssociationIteratorTy::E
clang::GenericSelectionExpr::AssociationIteratorTy::TSI
clang::GenericSelectionExpr::AssociationIteratorTy::Offset
clang::GenericSelectionExpr::AssociationIteratorTy::SelectedOffset
clang::GenericSelectionExpr::Create
clang::GenericSelectionExpr::Create
clang::GenericSelectionExpr::CreateEmpty
clang::GenericSelectionExpr::getNumAssocs
clang::GenericSelectionExpr::getResultIndex
clang::GenericSelectionExpr::isResultDependent
clang::GenericSelectionExpr::getControllingExpr
clang::GenericSelectionExpr::getControllingExpr
clang::GenericSelectionExpr::getResultExpr
clang::GenericSelectionExpr::getResultExpr
clang::GenericSelectionExpr::getAssocExprs
clang::GenericSelectionExpr::getAssocTypeSourceInfos
clang::GenericSelectionExpr::getAssociation
clang::GenericSelectionExpr::getAssociation
clang::GenericSelectionExpr::associations
clang::GenericSelectionExpr::associations
clang::GenericSelectionExpr::getGenericLoc
clang::GenericSelectionExpr::getDefaultLoc
clang::GenericSelectionExpr::getRParenLoc
clang::GenericSelectionExpr::getBeginLoc
clang::GenericSelectionExpr::getEndLoc
clang::GenericSelectionExpr::classof
clang::GenericSelectionExpr::children
clang::GenericSelectionExpr::children
clang::ExtVectorElementExpr::Base
clang::ExtVectorElementExpr::Accessor
clang::ExtVectorElementExpr::AccessorLoc
clang::ExtVectorElementExpr::getBase
clang::ExtVectorElementExpr::getBase
clang::ExtVectorElementExpr::setBase
clang::ExtVectorElementExpr::getAccessor
clang::ExtVectorElementExpr::setAccessor
clang::ExtVectorElementExpr::getAccessorLoc
clang::ExtVectorElementExpr::setAccessorLoc
clang::ExtVectorElementExpr::getNumElements
clang::ExtVectorElementExpr::containsDuplicateElements
clang::ExtVectorElementExpr::getEncodedElementAccess
clang::ExtVectorElementExpr::getBeginLoc
clang::ExtVectorElementExpr::classof
clang::ExtVectorElementExpr::children
clang::ExtVectorElementExpr::children
clang::BlockExpr::TheBlock
clang::BlockExpr::getBlockDecl
clang::BlockExpr::getBlockDecl
clang::BlockExpr::setBlockDecl
clang::BlockExpr::getCaretLocation
clang::BlockExpr::getBody
clang::BlockExpr::getBody
clang::BlockExpr::getBeginLoc
clang::BlockExpr::classof
clang::BlockExpr::children
clang::BlockExpr::children
clang::AsTypeExpr::SrcExpr
clang::AsTypeExpr::BuiltinLoc
clang::AsTypeExpr::RParenLoc
clang::AsTypeExpr::getSrcExpr
clang::AsTypeExpr::getBuiltinLoc
clang::AsTypeExpr::getRParenLoc
clang::AsTypeExpr::getBeginLoc
clang::PseudoObjectExpr::getSubExprsBuffer
clang::PseudoObjectExpr::getSubExprsBuffer
clang::PseudoObjectExpr::getNumSubExprs
clang::PseudoObjectExpr::Create
clang::PseudoObjectExpr::Create
clang::PseudoObjectExpr::getSyntacticForm
clang::PseudoObjectExpr::getSyntacticForm
clang::PseudoObjectExpr::getResultExprIndex
clang::PseudoObjectExpr::getResultExpr
clang::PseudoObjectExpr::getResultExpr
clang::PseudoObjectExpr::getNumSemanticExprs
clang::PseudoObjectExpr::semantics_begin
clang::PseudoObjectExpr::semantics_begin
clang::PseudoObjectExpr::semantics_end
clang::PseudoObjectExpr::semantics_end
clang::PseudoObjectExpr::semantics
clang::PseudoObjectExpr::semantics
clang::PseudoObjectExpr::getSemanticExpr
clang::PseudoObjectExpr::getSemanticExpr
clang::PseudoObjectExpr::getExprLoc
clang::AtomicExpr::AtomicOp
clang::AtomicExpr::SubExprs
clang::AtomicExpr::NumSubExprs
clang::AtomicExpr::BuiltinLoc
clang::AtomicExpr::RParenLoc
clang::AtomicExpr::Op
clang::AtomicExpr::getNumSubExprs
clang::AtomicExpr::getPtr
clang::AtomicExpr::getOrder
clang::AtomicExpr::getScope
clang::AtomicExpr::getVal1
clang::AtomicExpr::getOrderFail
clang::AtomicExpr::getVal2
clang::AtomicExpr::getWeak
clang::AtomicExpr::getValueType
clang::AtomicExpr::getOp
clang::AtomicExpr::getNumSubExprs
clang::AtomicExpr::getSubExprs
clang::AtomicExpr::getSubExprs
clang::AtomicExpr::isVolatile
clang::AtomicExpr::isCmpXChg
clang::AtomicExpr::isOpenCL
clang::AtomicExpr::getBuiltinLoc
clang::AtomicExpr::getRParenLoc
clang::AtomicExpr::getBeginLoc
clang::TypoExpr::children
clang::TypoExpr::children
clang::TypoExpr::getBeginLoc
clang::APFloatStorage::getValue
clang::FloatingLiteral::setSemantics
clang::Expr::isIntegerConstantExpr