diff options
author | dim <dim@FreeBSD.org> | 2011-02-20 13:06:31 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2011-02-20 13:06:31 +0000 |
commit | 39fcc9a984e2820e4ea0fa2ac4abd17d9f3a31df (patch) | |
tree | a9243275843fbeaa590afc07ee888e006b8d54ea /include/clang/AST/Attr.h | |
parent | 69b4eca4a4255ba43baa5c1d9bbdec3ec17f479e (diff) | |
download | FreeBSD-src-39fcc9a984e2820e4ea0fa2ac4abd17d9f3a31df.zip FreeBSD-src-39fcc9a984e2820e4ea0fa2ac4abd17d9f3a31df.tar.gz |
Vendor import of clang trunk r126079:
http://llvm.org/svn/llvm-project/cfe/trunk@126079
Diffstat (limited to 'include/clang/AST/Attr.h')
-rw-r--r-- | include/clang/AST/Attr.h | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/include/clang/AST/Attr.h b/include/clang/AST/Attr.h index 62ca49f..67968fd 100644 --- a/include/clang/AST/Attr.h +++ b/include/clang/AST/Attr.h @@ -36,19 +36,19 @@ namespace clang { } // Defined in ASTContext.h -void *operator new(size_t Bytes, clang::ASTContext &C, +void *operator new(size_t Bytes, const clang::ASTContext &C, size_t Alignment = 16) throw (); // FIXME: Being forced to not have a default argument here due to redeclaration // rules on default arguments sucks -void *operator new[](size_t Bytes, clang::ASTContext &C, +void *operator new[](size_t Bytes, const clang::ASTContext &C, size_t Alignment) throw (); // It is good practice to pair new/delete operators. Also, MSVC gives many // warnings if a matching delete overload is not declared, even though the // throw() spec guarantees it will not be implicitly called. -void operator delete(void *Ptr, clang::ASTContext &C, size_t) +void operator delete(void *Ptr, const clang::ASTContext &C, size_t) throw (); -void operator delete[](void *Ptr, clang::ASTContext &C, size_t) +void operator delete[](void *Ptr, const clang::ASTContext &C, size_t) throw (); namespace clang { @@ -58,9 +58,10 @@ class Attr { private: SourceLocation Loc; unsigned AttrKind : 16; - bool Inherited : 1; protected: + bool Inherited : 1; + virtual ~Attr(); void* operator new(size_t bytes) throw() { @@ -88,10 +89,6 @@ protected: public: - /// \brief Whether this attribute should be merged to new - /// declarations. - virtual bool isMerged() const { return true; } - attr::Kind getKind() const { return static_cast<attr::Kind>(AttrKind); } @@ -100,7 +97,6 @@ public: void setLocation(SourceLocation L) { Loc = L; } bool isInherited() const { return Inherited; } - void setInherited(bool I) { Inherited = I; } // Clone this attribute. virtual Attr* clone(ASTContext &C) const = 0; @@ -109,6 +105,21 @@ public: static bool classof(const Attr *) { return true; } }; +class InheritableAttr : public Attr { +protected: + InheritableAttr(attr::Kind AK, SourceLocation L) + : Attr(AK, L) {} + +public: + void setInherited(bool I) { Inherited = I; } + + // Implement isa/cast/dyncast/etc. + static bool classof(const Attr *A) { + return A->getKind() <= attr::LAST_INHERITABLE; + } + static bool classof(const InheritableAttr *) { return true; } +}; + #include "clang/AST/Attrs.inc" /// AttrVec - A vector of Attr, which is how they are stored on the AST. |