diff options
Diffstat (limited to 'include/clang/AST/DeclCXX.h')
-rw-r--r-- | include/clang/AST/DeclCXX.h | 468 |
1 files changed, 234 insertions, 234 deletions
diff --git a/include/clang/AST/DeclCXX.h b/include/clang/AST/DeclCXX.h index ce6e925a9a..23da3e0283 100644 --- a/include/clang/AST/DeclCXX.h +++ b/include/clang/AST/DeclCXX.h @@ -28,33 +28,33 @@ class CXXConversionDecl; class CXXMethodDecl; class ClassTemplateSpecializationDecl; -/// \brief Represents any kind of function declaration, whether it is a +/// \brief Represents any kind of function declaration, whether it is a /// concrete function or a function template. class AnyFunctionDecl { NamedDecl *Function; - + AnyFunctionDecl(NamedDecl *ND) : Function(ND) { } - + public: AnyFunctionDecl(FunctionDecl *FD) : Function(FD) { } AnyFunctionDecl(FunctionTemplateDecl *FTD); - - /// \brief Implicily converts any function or function template into a + + /// \brief Implicily converts any function or function template into a /// named declaration. operator NamedDecl *() const { return Function; } - + /// \brief Retrieve the underlying function or function template. NamedDecl *get() const { return Function; } - - static AnyFunctionDecl getFromNamedDecl(NamedDecl *ND) { + + static AnyFunctionDecl getFromNamedDecl(NamedDecl *ND) { return AnyFunctionDecl(ND); } }; - + } // end namespace clang namespace llvm { - /// Implement simplify_type for AnyFunctionDecl, so that we can dyn_cast from + /// Implement simplify_type for AnyFunctionDecl, so that we can dyn_cast from /// AnyFunctionDecl to any function or function template declaration. template<> struct simplify_type<const ::clang::AnyFunctionDecl> { typedef ::clang::NamedDecl* SimpleType; @@ -64,26 +64,26 @@ namespace llvm { }; template<> struct simplify_type< ::clang::AnyFunctionDecl> : public simplify_type<const ::clang::AnyFunctionDecl> {}; - + // Provide PointerLikeTypeTraits for non-cvr pointers. template<> class PointerLikeTypeTraits< ::clang::AnyFunctionDecl> { public: static inline void *getAsVoidPointer(::clang::AnyFunctionDecl F) { - return F.get(); + return F.get(); } static inline ::clang::AnyFunctionDecl getFromVoidPointer(void *P) { return ::clang::AnyFunctionDecl::getFromNamedDecl( static_cast< ::clang::NamedDecl*>(P)); } - + enum { NumLowBitsAvailable = 2 }; }; - + } // end namespace llvm namespace clang { - + /// OverloadedFunctionDecl - An instance of this class represents a /// set of overloaded functions. All of the functions have the same /// name and occur within the same scope. @@ -128,56 +128,56 @@ public: unsigned size() const { return Functions.size(); } // Implement isa/cast/dyncast/etc. - static bool classof(const Decl *D) { - return D->getKind() == OverloadedFunction; + static bool classof(const Decl *D) { + return D->getKind() == OverloadedFunction; } static bool classof(const OverloadedFunctionDecl *D) { return true; } }; - -/// \brief Provides uniform iteration syntax for an overload set, function, + +/// \brief Provides uniform iteration syntax for an overload set, function, /// or function template. class OverloadIterator { /// \brief An overloaded function set, function declaration, or /// function template declaration. NamedDecl *D; - + /// \brief If the declaration is an overloaded function set, this is the /// iterator pointing to the current position within that overloaded /// function set. OverloadedFunctionDecl::function_iterator Iter; - + public: typedef AnyFunctionDecl value_type; typedef value_type reference; typedef NamedDecl *pointer; typedef int difference_type; typedef std::forward_iterator_tag iterator_category; - + OverloadIterator() : D(0) { } - + OverloadIterator(FunctionDecl *FD) : D(FD) { } - OverloadIterator(FunctionTemplateDecl *FTD) + OverloadIterator(FunctionTemplateDecl *FTD) : D(reinterpret_cast<NamedDecl*>(FTD)) { } - OverloadIterator(OverloadedFunctionDecl *Ovl) + OverloadIterator(OverloadedFunctionDecl *Ovl) : D(Ovl), Iter(Ovl->function_begin()) { } - + OverloadIterator(NamedDecl *ND); - + reference operator*() const; - + pointer operator->() const { return (**this).get(); } - + OverloadIterator &operator++(); - + OverloadIterator operator++(int) { OverloadIterator Temp(*this); ++(*this); return Temp; } - + bool Equals(const OverloadIterator &Other) const; }; - + inline bool operator==(const OverloadIterator &X, const OverloadIterator &Y) { return X.Equals(Y); } @@ -215,7 +215,7 @@ class CXXBaseSpecifier { /// struct (false). This determines the mapping from the access /// specifier as written in the source code to the access specifier /// used for semantic analysis. - bool BaseOfClass : 1; + bool BaseOfClass : 1; /// Access - Access specifier as written in the source code (which /// may be AS_none). The actual type of data stored here is an @@ -226,7 +226,7 @@ class CXXBaseSpecifier { /// BaseType - The type of the base class. This will be a class or /// struct (or a typedef of such). QualType BaseType; - + public: CXXBaseSpecifier() { } @@ -236,7 +236,7 @@ public: /// getSourceRange - Retrieves the source range that contains the /// entire base specifier. SourceRange getSourceRange() const { return Range; } - + /// isVirtual - Determines whether the base class is a virtual base /// class (or not). bool isVirtual() const { return Virtual; } @@ -246,11 +246,11 @@ public: /// semantic analysis, so the result can never be AS_none. To /// retrieve the access specifier as written in the source code, use /// getAccessSpecifierAsWritten(). - AccessSpecifier getAccessSpecifier() const { + AccessSpecifier getAccessSpecifier() const { if ((AccessSpecifier)Access == AS_none) return BaseOfClass? AS_private : AS_public; else - return (AccessSpecifier)Access; + return (AccessSpecifier)Access; } /// getAccessSpecifierAsWritten - Retrieves the access specifier as @@ -271,7 +271,7 @@ public: /// to deal with C++-specific things. class CXXRecordDecl : public RecordDecl { /// UserDeclaredConstructor - True when this class has a - /// user-declared constructor. + /// user-declared constructor. bool UserDeclaredConstructor : 1; /// UserDeclaredCopyConstructor - True when this class has a @@ -315,7 +315,7 @@ class CXXRecordDecl : public RecordDecl { /// * for all the nonstatic data members of its class that are of class type /// (or array thereof), each such class has a trivial constructor. bool HasTrivialConstructor : 1; - + /// HasTrivialCopyConstructor - True when this class has a trivial copy /// constructor. /// @@ -340,7 +340,7 @@ class CXXRecordDecl : public RecordDecl { /// operator; /// otherwise the copy assignment operator is non-trivial. bool HasTrivialCopyAssignment : 1; - + /// HasTrivialDestructor - True when this class has a trivial destructor. /// /// C++ [class.dtor]p3. A destructor is trivial if it is an @@ -360,10 +360,10 @@ class CXXRecordDecl : public RecordDecl { /// VBases - direct and indirect virtual base classes of this class. CXXBaseSpecifier *VBases; - + /// NumVBases - The number of virtual base class specifiers in VBases. unsigned NumVBases; - + /// Conversions - Overload set containing the conversion functions /// of this C++ class (but not its inherited conversion /// functions). Each of the entries in this overload set is a @@ -372,7 +372,7 @@ class CXXRecordDecl : public RecordDecl { /// \brief The template or declaration that this declaration /// describes or was instantiated from, respectively. - /// + /// /// For non-templates, this value will be NULL. For record /// declarations that describe a class template, this will be a /// pointer to a ClassTemplateDecl. For member @@ -417,9 +417,9 @@ public: SourceLocation TKL = SourceLocation(), CXXRecordDecl* PrevDecl=0, bool DelayTypeCreation = false); - + virtual void Destroy(ASTContext& C); - + bool isDynamicClass() const { return Polymorphic || NumVBases!=0; } @@ -448,11 +448,11 @@ public: reverse_base_class_const_iterator bases_rend() const { return reverse_base_class_const_iterator(bases_begin()); } - + /// getNumVBases - Retrieves the number of virtual base classes of this /// class. unsigned getNumVBases() const { return NumVBases; } - + base_class_iterator vbases_begin() { return VBases; } base_class_const_iterator vbases_begin() const { return VBases; } base_class_iterator vbases_end() { return VBases + NumVBases; } @@ -474,7 +474,7 @@ public: /// all method members of the class, including non-instance methods, /// special methods, etc. typedef specific_decl_iterator<CXXMethodDecl> method_iterator; - + /// method_begin - Method begin iterator. Iterates in the order the methods /// were declared. method_iterator method_begin() const { @@ -487,7 +487,7 @@ public: /// Iterator access to constructor members. typedef specific_decl_iterator<CXXConstructorDecl> ctor_iterator; - + ctor_iterator ctor_begin() const { return ctor_iterator(decls_begin()); } @@ -500,13 +500,13 @@ public: bool hasConstCopyConstructor(ASTContext &Context) const; /// getCopyConstructor - Returns the copy constructor for this class - CXXConstructorDecl *getCopyConstructor(ASTContext &Context, + CXXConstructorDecl *getCopyConstructor(ASTContext &Context, unsigned TypeQuals) const; /// hasConstCopyAssignment - Determines whether this class has a /// copy assignment operator that accepts a const-qualified argument. /// It returns its decl in MD if found. - bool hasConstCopyAssignment(ASTContext &Context, + bool hasConstCopyAssignment(ASTContext &Context, const CXXMethodDecl *&MD) const; /// addedConstructor - Notify the class that another constructor has @@ -517,9 +517,9 @@ public: /// hasUserDeclaredConstructor - Whether this class has any /// user-declared constructors. When true, a default constructor /// will not be implicitly declared. - bool hasUserDeclaredConstructor() const { + bool hasUserDeclaredConstructor() const { assert((isDefinition() || - cast<RecordType>(getTypeForDecl())->isBeingDefined()) && + cast<RecordType>(getTypeForDecl())->isBeingDefined()) && "Incomplete record decl!"); return UserDeclaredConstructor; } @@ -551,23 +551,23 @@ public: /// setUserDeclaredDestructor - Set whether this class has a /// user-declared destructor. If not set by the time the class is /// fully defined, a destructor will be implicitly declared. - void setUserDeclaredDestructor(bool UCD) { - UserDeclaredDestructor = UCD; + void setUserDeclaredDestructor(bool UCD) { + UserDeclaredDestructor = UCD; } /// getConversions - Retrieve the overload set containing all of the /// conversion functions in this class. - OverloadedFunctionDecl *getConversionFunctions() { - assert((this->isDefinition() || + OverloadedFunctionDecl *getConversionFunctions() { + assert((this->isDefinition() || cast<RecordType>(getTypeForDecl())->isBeingDefined()) && "getConversionFunctions() called on incomplete type"); - return &Conversions; + return &Conversions; } - const OverloadedFunctionDecl *getConversionFunctions() const { - assert((this->isDefinition() || + const OverloadedFunctionDecl *getConversionFunctions() const { + assert((this->isDefinition() || cast<RecordType>(getTypeForDecl())->isBeingDefined()) && "getConversionFunctions() called on incomplete type"); - return &Conversions; + return &Conversions; } /// addConversionFunction - Add a new conversion function to the @@ -576,7 +576,7 @@ public: /// \brief Add a new conversion function template to the list of conversion /// functions. - void addConversionFunction(ASTContext &Context, + void addConversionFunction(ASTContext &Context, FunctionTemplateDecl *ConvDecl); /// isAggregate - Whether this class is an aggregate (C++ @@ -618,22 +618,22 @@ public: /// isAbstract - Whether this class is abstract (C++ [class.abstract]), /// which means that the class contains or inherits a pure virtual function. bool isAbstract() const { return Abstract; } - + /// setAbstract - Set whether this class is abstract (C++ [class.abstract]) void setAbstract(bool Abs) { Abstract = Abs; } - + // hasTrivialConstructor - Whether this class has a trivial constructor // (C++ [class.ctor]p5) bool hasTrivialConstructor() const { return HasTrivialConstructor; } - + // setHasTrivialConstructor - Set whether this class has a trivial constructor // (C++ [class.ctor]p5) void setHasTrivialConstructor(bool TC) { HasTrivialConstructor = TC; } - + // hasTrivialCopyConstructor - Whether this class has a trivial copy // constructor (C++ [class.copy]p6) bool hasTrivialCopyConstructor() const { return HasTrivialCopyConstructor; } - + // setHasTrivialCopyConstructor - Set whether this class has a trivial // copy constructor (C++ [class.copy]p6) void setHasTrivialCopyConstructor(bool TC) { HasTrivialCopyConstructor = TC; } @@ -641,7 +641,7 @@ public: // hasTrivialCopyAssignment - Whether this class has a trivial copy // assignment operator (C++ [class.copy]p11) bool hasTrivialCopyAssignment() const { return HasTrivialCopyAssignment; } - + // setHasTrivialCopyAssignment - Set whether this class has a // trivial copy assignment operator (C++ [class.copy]p11) void setHasTrivialCopyAssignment(bool TC) { HasTrivialCopyAssignment = TC; } @@ -649,11 +649,11 @@ public: // hasTrivialDestructor - Whether this class has a trivial destructor // (C++ [class.dtor]p3) bool hasTrivialDestructor() const { return HasTrivialDestructor; } - + // setHasTrivialDestructor - Set whether this class has a trivial destructor // (C++ [class.dtor]p3) void setHasTrivialDestructor(bool TC) { HasTrivialDestructor = TC; } - + /// \brief If this record is an instantiation of a member class, /// retrieves the member class from which it was instantiated. /// @@ -679,7 +679,7 @@ public: /// \brief Specify that this record is an instantiation of the /// member class RD. - void setInstantiationOfMemberClass(CXXRecordDecl *RD) { + void setInstantiationOfMemberClass(CXXRecordDecl *RD) { TemplateOrInstantiation = RD; } @@ -704,16 +704,16 @@ public: /// getDefaultConstructor - Returns the default constructor for this class CXXConstructorDecl *getDefaultConstructor(ASTContext &Context); - + /// getDestructor - Returns the destructor decl for this class. const CXXDestructorDecl *getDestructor(ASTContext &Context); - + /// isLocalClass - If the class is a local class [class.local], returns /// the enclosing function declaration. const FunctionDecl *isLocalClass() const { if (const CXXRecordDecl *RD = dyn_cast<CXXRecordDecl>(getDeclContext())) return RD->isLocalClass(); - + return dyn_cast<FunctionDecl>(getDeclContext()); } @@ -722,14 +722,14 @@ public: /// GraphViz. void viewInheritance(ASTContext& Context) const; - static bool classof(const Decl *D) { - return D->getKind() == CXXRecord || + static bool classof(const Decl *D) { + return D->getKind() == CXXRecord || D->getKind() == ClassTemplateSpecialization || - D->getKind() == ClassTemplatePartialSpecialization; + D->getKind() == ClassTemplatePartialSpecialization; } static bool classof(const CXXRecordDecl *D) { return true; } - static bool classof(const ClassTemplateSpecializationDecl *D) { - return true; + static bool classof(const ClassTemplateSpecializationDecl *D) { + return true; } }; @@ -749,32 +749,32 @@ public: QualType T, DeclaratorInfo *DInfo, bool isStatic = false, bool isInline = false); - + bool isStatic() const { return getStorageClass() == Static; } bool isInstance() const { return !isStatic(); } - bool isVirtual() const { + bool isVirtual() const { return isVirtualAsWritten() || (begin_overridden_methods() != end_overridden_methods()); } - /// + /// void addOverriddenMethod(const CXXMethodDecl *MD); - + typedef const CXXMethodDecl ** method_iterator; - + method_iterator begin_overridden_methods() const; method_iterator end_overridden_methods() const; - + /// getParent - Returns the parent of this method declaration, which /// is the class in which this method is defined. - const CXXRecordDecl *getParent() const { - return cast<CXXRecordDecl>(FunctionDecl::getParent()); + const CXXRecordDecl *getParent() const { + return cast<CXXRecordDecl>(FunctionDecl::getParent()); } - + /// getParent - Returns the parent of this method declaration, which /// is the class in which this method is defined. - CXXRecordDecl *getParent() { + CXXRecordDecl *getParent() { return const_cast<CXXRecordDecl *>( cast<CXXRecordDecl>(FunctionDecl::getParent())); } @@ -788,7 +788,7 @@ public: } // Implement isa/cast/dyncast/etc. - static bool classof(const Decl *D) { + static bool classof(const Decl *D) { return D->getKind() >= CXXMethod && D->getKind() <= CXXConversion; } static bool classof(const CXXMethodDecl *D) { return true; } @@ -818,13 +818,13 @@ class CXXBaseOrMemberInitializer { /// Args - The arguments used to initialize the base or member. Stmt **Args; unsigned NumArgs; - + /// \brief Stores either the constructor to call to initialize this base or /// member (a CXXConstructorDecl pointer), or stores the anonymous union of /// which the initialized value is a member. /// - /// When the value is a FieldDecl pointer, 'BaseOrMember' is class's - /// anonymous union data member, this field holds the FieldDecl for the + /// When the value is a FieldDecl pointer, 'BaseOrMember' is class's + /// anonymous union data member, this field holds the FieldDecl for the /// member of the anonymous union being initialized. /// @code /// struct X { @@ -838,7 +838,7 @@ class CXXBaseOrMemberInitializer { /// In above example, BaseOrMember holds the field decl. for anonymous union /// and AnonUnionMember holds field decl for au_i1. llvm::PointerUnion<CXXConstructorDecl *, FieldDecl *> CtorOrAnonUnion; - + /// IdLoc - Location of the id in ctor-initializer list. SourceLocation IdLoc; @@ -847,13 +847,13 @@ class CXXBaseOrMemberInitializer { public: /// CXXBaseOrMemberInitializer - Creates a new base-class initializer. - explicit + explicit CXXBaseOrMemberInitializer(QualType BaseType, Expr **Args, unsigned NumArgs, CXXConstructorDecl *C, SourceLocation L, SourceLocation R); /// CXXBaseOrMemberInitializer - Creates a new member initializer. - explicit + explicit CXXBaseOrMemberInitializer(FieldDecl *Member, Expr **Args, unsigned NumArgs, CXXConstructorDecl *C, SourceLocation L, SourceLocation R); @@ -872,7 +872,7 @@ public: /// getBaseOrMember - get the generic 'member' representing either the field /// or a base class. void* getBaseOrMember() const { return reinterpret_cast<void*>(BaseOrMember); } - + /// isBaseInitializer - Returns true when this initializer is /// initializing a base class. bool isBaseInitializer() const { return (BaseOrMember & 0x1) != 0; } @@ -885,8 +885,8 @@ public: /// type used to specify the initializer. The resulting type will be /// a class type or a typedef of a class type. If this is not a base /// class initializer, returns NULL. - Type *getBaseClass() { - if (isBaseInitializer()) + Type *getBaseClass() { + if (isBaseInitializer()) return reinterpret_cast<Type*>(BaseOrMember & ~0x01); else return 0; @@ -896,8 +896,8 @@ public: /// type used to specify the initializer. The resulting type will be /// a class type or a typedef of a class type. If this is not a base /// class initializer, returns NULL. - const Type *getBaseClass() const { - if (isBaseInitializer()) + const Type *getBaseClass() const { + if (isBaseInitializer()) return reinterpret_cast<const Type*>(BaseOrMember & ~0x01); else return 0; @@ -906,9 +906,9 @@ public: /// getMember - If this is a member initializer, returns the /// declaration of the non-static data member being /// initialized. Otherwise, returns NULL. - FieldDecl *getMember() { + FieldDecl *getMember() { if (isMemberInitializer()) - return reinterpret_cast<FieldDecl *>(BaseOrMember); + return reinterpret_cast<FieldDecl *>(BaseOrMember); else return 0; } @@ -916,21 +916,21 @@ public: void setMember(FieldDecl * anonUnionField) { BaseOrMember = reinterpret_cast<uintptr_t>(anonUnionField); } - + FieldDecl *getAnonUnionMember() const { return CtorOrAnonUnion.dyn_cast<FieldDecl *>(); } void setAnonUnionMember(FieldDecl *anonMember) { CtorOrAnonUnion = anonMember; } - - const CXXConstructorDecl *getConstructor() const { + + const CXXConstructorDecl *getConstructor() const { return CtorOrAnonUnion.dyn_cast<CXXConstructorDecl *>(); } - + SourceLocation getSourceLocation() const { return IdLoc; } SourceLocation getRParenLoc() const { return RParenLoc; } - + /// arg_begin() - Retrieve an iterator to the first initializer argument. arg_iterator arg_begin() { return Args; } /// arg_begin() - Retrieve an iterator to the first initializer argument. @@ -948,7 +948,7 @@ public: /// CXXConstructorDecl - Represents a C++ constructor within a /// class. For example: -/// +/// /// @code /// class X { /// public: @@ -966,23 +966,23 @@ class CXXConstructorDecl : public CXXMethodDecl { /// explicitly defaulted (i.e., defined with " = default") will have /// @c !Implicit && ImplicitlyDefined. bool ImplicitlyDefined : 1; - + /// Support for base and member initializers. - /// BaseOrMemberInitializers - The arguments used to initialize the base + /// BaseOrMemberInitializers - The arguments used to initialize the base /// or member. CXXBaseOrMemberInitializer **BaseOrMemberInitializers; unsigned NumBaseOrMemberInitializers; - + CXXConstructorDecl(CXXRecordDecl *RD, SourceLocation L, DeclarationName N, QualType T, DeclaratorInfo *DInfo, bool isExplicit, bool isInline, bool isImplicitlyDeclared) : CXXMethodDecl(CXXConstructor, RD, L, N, T, DInfo, false, isInline), Explicit(isExplicit), ImplicitlyDefined(false), - BaseOrMemberInitializers(0), NumBaseOrMemberInitializers(0) { + BaseOrMemberInitializers(0), NumBaseOrMemberInitializers(0) { setImplicit(isImplicitlyDeclared); } virtual void Destroy(ASTContext& C); - + public: static CXXConstructorDecl *Create(ASTContext &C, CXXRecordDecl *RD, SourceLocation L, DeclarationName N, @@ -990,59 +990,59 @@ public: bool isExplicit, bool isInline, bool isImplicitlyDeclared); - /// isExplicit - Whether this constructor was marked "explicit" or not. + /// isExplicit - Whether this constructor was marked "explicit" or not. bool isExplicit() const { return Explicit; } /// isImplicitlyDefined - Whether this constructor was implicitly /// defined. If false, then this constructor was defined by the /// user. This operation can only be invoked if the constructor has /// already been defined. - bool isImplicitlyDefined(ASTContext &C) const { - assert(isThisDeclarationADefinition() && + bool isImplicitlyDefined(ASTContext &C) const { + assert(isThisDeclarationADefinition() && "Can only get the implicit-definition flag once the " "constructor has been defined"); - return ImplicitlyDefined; + return ImplicitlyDefined; } /// setImplicitlyDefined - Set whether this constructor was /// implicitly defined or not. - void setImplicitlyDefined(bool ID) { - assert(isThisDeclarationADefinition() && + void setImplicitlyDefined(bool ID) { + assert(isThisDeclarationADefinition() && "Can only set the implicit-definition flag once the constructor " "has been defined"); - ImplicitlyDefined = ID; + ImplicitlyDefined = ID; } - + /// init_iterator - Iterates through the member/base initializer list. typedef CXXBaseOrMemberInitializer **init_iterator; - + /// init_const_iterator - Iterates through the memberbase initializer list. typedef CXXBaseOrMemberInitializer * const * init_const_iterator; - + /// init_begin() - Retrieve an iterator to the first initializer. init_iterator init_begin() { return BaseOrMemberInitializers; } /// begin() - Retrieve an iterator to the first initializer. init_const_iterator init_begin() const { return BaseOrMemberInitializers; } - + /// init_end() - Retrieve an iterator past the last initializer. - init_iterator init_end() { - return BaseOrMemberInitializers + NumBaseOrMemberInitializers; + init_iterator init_end() { + return BaseOrMemberInitializers + NumBaseOrMemberInitializers; } /// end() - Retrieve an iterator past the last initializer. - init_const_iterator init_end() const { - return BaseOrMemberInitializers + NumBaseOrMemberInitializers; + init_const_iterator init_end() const { + return BaseOrMemberInitializers + NumBaseOrMemberInitializers; } - + /// getNumArgs - Determine the number of arguments used to /// initialize the member or base. - unsigned getNumBaseOrMemberInitializers() const { - return NumBaseOrMemberInitializers; + unsigned getNumBaseOrMemberInitializers() const { + return NumBaseOrMemberInitializers; } - + void setNumBaseOrMemberInitializers(unsigned numBaseOrMemberInitializers) { NumBaseOrMemberInitializers = numBaseOrMemberInitializers; } - + void setBaseOrMemberInitializers(CXXBaseOrMemberInitializer ** initializers) { BaseOrMemberInitializers = initializers; } @@ -1079,7 +1079,7 @@ public: bool isConvertingConstructor(bool AllowExplicit) const; // Implement isa/cast/dyncast/etc. - static bool classof(const Decl *D) { + static bool classof(const Decl *D) { return D->getKind() == CXXConstructor; } static bool classof(const CXXConstructorDecl *D) { return true; } @@ -1087,7 +1087,7 @@ public: /// CXXDestructorDecl - Represents a C++ destructor within a /// class. For example: -/// +/// /// @code /// class X { /// public: @@ -1109,97 +1109,97 @@ private: /// explicitly defaulted (i.e., defined with " = default") will have /// @c !Implicit && ImplicitlyDefined. bool ImplicitlyDefined : 1; - + /// Support for base and member destruction. - /// BaseOrMemberDestructions - The arguments used to destruct the base + /// BaseOrMemberDestructions - The arguments used to destruct the base /// or member. Each uintptr_t value represents one of base classes (either /// virtual or direct non-virtual base), or non-static data member /// to be destroyed. The low two bits encode the kind of object /// being destroyed. uintptr_t *BaseOrMemberDestructions; unsigned NumBaseOrMemberDestructions; - + CXXDestructorDecl(CXXRecordDecl *RD, SourceLocation L, DeclarationName N, QualType T, bool isInline, bool isImplicitlyDeclared) : CXXMethodDecl(CXXDestructor, RD, L, N, T, /*DInfo=*/0, false, isInline), ImplicitlyDefined(false), - BaseOrMemberDestructions(0), NumBaseOrMemberDestructions(0) { + BaseOrMemberDestructions(0), NumBaseOrMemberDestructions(0) { setImplicit(isImplicitlyDeclared); } virtual void Destroy(ASTContext& C); - + public: static CXXDestructorDecl *Create(ASTContext &C, CXXRecordDecl *RD, SourceLocation L, DeclarationName N, - QualType T, bool isInline, + QualType T, bool isInline, bool isImplicitlyDeclared); /// isImplicitlyDefined - Whether this destructor was implicitly /// defined. If false, then this destructor was defined by the /// user. This operation can only be invoked if the destructor has /// already been defined. - bool isImplicitlyDefined() const { - assert(isThisDeclarationADefinition() && + bool isImplicitlyDefined() const { + assert(isThisDeclarationADefinition() && "Can only get the implicit-definition flag once the destructor has been defined"); - return ImplicitlyDefined; + return ImplicitlyDefined; } /// setImplicitlyDefined - Set whether this destructor was /// implicitly defined or not. - void setImplicitlyDefined(bool ID) { - assert(isThisDeclarationADefinition() && + void setImplicitlyDefined(bool ID) { + assert(isThisDeclarationADefinition() && "Can only set the implicit-definition flag once the destructor has been defined"); - ImplicitlyDefined = ID; + ImplicitlyDefined = ID; } /// destr_iterator - Iterates through the member/base destruction list. - + /// destr_const_iterator - Iterates through the member/base destruction list. typedef uintptr_t const destr_const_iterator; - + /// destr_begin() - Retrieve an iterator to the first destructed member/base. - uintptr_t* destr_begin() { - return BaseOrMemberDestructions; + uintptr_t* destr_begin() { + return BaseOrMemberDestructions; } /// destr_begin() - Retrieve an iterator to the first destructed member/base. - uintptr_t* destr_begin() const { - return BaseOrMemberDestructions; + uintptr_t* destr_begin() const { + return BaseOrMemberDestructions; } - + /// destr_end() - Retrieve an iterator past the last destructed member/base. - uintptr_t* destr_end() { - return BaseOrMemberDestructions + NumBaseOrMemberDestructions; + uintptr_t* destr_end() { + return BaseOrMemberDestructions + NumBaseOrMemberDestructions; } /// destr_end() - Retrieve an iterator past the last destructed member/base. - uintptr_t* destr_end() const { - return BaseOrMemberDestructions + NumBaseOrMemberDestructions; + uintptr_t* destr_end() const { + return BaseOrMemberDestructions + NumBaseOrMemberDestructions; } - + /// getNumBaseOrMemberDestructions - Number of base and non-static members /// to destroy. - unsigned getNumBaseOrMemberDestructions() const { - return NumBaseOrMemberDestructions; + unsigned getNumBaseOrMemberDestructions() const { + return NumBaseOrMemberDestructions; } - + /// setNumBaseOrMemberDestructions - Set number of base and non-static members /// to destroy. void setNumBaseOrMemberDestructions(unsigned numBaseOrMemberDestructions) { NumBaseOrMemberDestructions = numBaseOrMemberDestructions; } - - /// getBaseOrMemberToDestroy - get the generic 'member' representing either + + /// getBaseOrMemberToDestroy - get the generic 'member' representing either /// the field or a base class. uintptr_t* getBaseOrMemberToDestroy() const { - return BaseOrMemberDestructions; + return BaseOrMemberDestructions; } - - /// setBaseOrMemberToDestroy - set the generic 'member' representing either + + /// setBaseOrMemberToDestroy - set the generic 'member' representing either /// the field or a base class. void setBaseOrMemberDestructions(uintptr_t* baseOrMemberDestructions) { BaseOrMemberDestructions = baseOrMemberDestructions; } - + /// isVbaseToDestroy - returns true, if object is virtual base. bool isVbaseToDestroy(uintptr_t Vbase) const { return (Vbase & VBASE) != 0; @@ -1209,7 +1209,7 @@ public: bool isDirectNonVBaseToDestroy(uintptr_t DrctNonVbase) const { return (DrctNonVbase & DRCTNONVBASE) != 0; } - /// isAnyBaseToDestroy - returns true, if object is any base (virtual or + /// isAnyBaseToDestroy - returns true, if object is any base (virtual or /// direct non-virtual) bool isAnyBaseToDestroy(uintptr_t AnyBase) const { return (AnyBase & ANYBASE) != 0; @@ -1225,9 +1225,9 @@ public: return 0; } /// getMemberToDestroy - Get the member for the given object. - FieldDecl *getMemberToDestroy(uintptr_t Member) const { + FieldDecl *getMemberToDestroy(uintptr_t Member) const { if (isMemberToDestroy(Member)) - return reinterpret_cast<FieldDecl *>(Member); + return reinterpret_cast<FieldDecl *>(Member); return 0; } /// getVbaseClassToDestroy - Get the virtual base. @@ -1242,9 +1242,9 @@ public: return reinterpret_cast<Type*>(Base & ~0x02); return 0; } - + // Implement isa/cast/dyncast/etc. - static bool classof(const Decl *D) { + static bool classof(const Decl *D) { return D->getKind() == CXXDestructor; } static bool classof(const CXXDestructorDecl *D) { return true; } @@ -1252,7 +1252,7 @@ public: /// CXXConversionDecl - Represents a C++ conversion function within a /// class. For example: -/// +/// /// @code /// class X { /// public: @@ -1266,7 +1266,7 @@ class CXXConversionDecl : public CXXMethodDecl { bool Explicit : 1; CXXConversionDecl(CXXRecordDecl *RD, SourceLocation L, - DeclarationName N, QualType T, DeclaratorInfo *DInfo, + DeclarationName N, QualType T, DeclaratorInfo *DInfo, bool isInline, bool isExplicit) : CXXMethodDecl(CXXConversion, RD, L, N, T, DInfo, false, isInline), Explicit(isExplicit) { } @@ -1284,12 +1284,12 @@ public: /// getConversionType - Returns the type that this conversion /// function is converting to. - QualType getConversionType() const { - return getType()->getAsFunctionType()->getResultType(); + QualType getConversionType() const { + return getType()->getAsFunctionType()->getResultType(); } // Implement isa/cast/dyncast/etc. - static bool classof(const Decl *D) { + static bool classof(const Decl *D) { return D->getKind() == CXXConversion; } static bool classof(const CXXConversionDecl *D) { return true; } @@ -1325,8 +1325,8 @@ private: SourceLocation FriendL) : Decl(Decl::Friend, DC, L), Friend(Friend), - FriendLoc(FriendL) - {} + FriendLoc(FriendL) { + } public: static FriendDecl *Create(ASTContext &C, DeclContext *DC, @@ -1353,12 +1353,12 @@ public: } // Implement isa/cast/dyncast/etc. - static bool classof(const Decl *D) { + static bool classof(const Decl *D) { return D->getKind() == Decl::Friend; } static bool classof(const FriendDecl *D) { return true; } }; - + /// LinkageSpecDecl - This represents a linkage specification. For example: /// extern "C" void foo(); /// @@ -1378,14 +1378,14 @@ private: /// HadBraces - Whether this linkage specification had curly braces or not. bool HadBraces : 1; - LinkageSpecDecl(DeclContext *DC, SourceLocation L, LanguageIDs lang, + LinkageSpecDecl(DeclContext *DC, SourceLocation L, LanguageIDs lang, bool Braces) - : Decl(LinkageSpec, DC, L), + : Decl(LinkageSpec, DC, L), DeclContext(LinkageSpec), Language(lang), HadBraces(Braces) { } public: - static LinkageSpecDecl *Create(ASTContext &C, DeclContext *DC, - SourceLocation L, LanguageIDs Lang, + static LinkageSpecDecl *Create(ASTContext &C, DeclContext *DC, + SourceLocation L, LanguageIDs Lang, bool Braces); LanguageIDs getLanguage() const { return Language; } @@ -1452,8 +1452,8 @@ class UsingDirectiveDecl : public NamedDecl { NamespaceDecl *Nominated, DeclContext *CommonAncestor) : NamedDecl(Decl::UsingDirective, DC, L, getName()), - NamespaceLoc(NamespcLoc), QualifierRange(QualifierRange), - Qualifier(Qualifier), IdentLoc(IdentLoc), + NamespaceLoc(NamespcLo |