summaryrefslogtreecommitdiffstats
path: root/include/clang/AST/Attr.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/AST/Attr.h')
-rw-r--r--include/clang/AST/Attr.h31
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.
OpenPOWER on IntegriCloud