aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/clang/AST/Decl.h3
-rw-r--r--include/clang/AST/DeclBase.h8
-rw-r--r--include/clang/AST/DeclObjC.h4
3 files changed, 9 insertions, 6 deletions
diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h
index 019673ab1b..ac08f96508 100644
--- a/include/clang/AST/Decl.h
+++ b/include/clang/AST/Decl.h
@@ -372,6 +372,7 @@ protected:
static FunctionDecl* CreateImpl(llvm::Deserializer& D, ASTContext& C);
friend Decl* Decl::Create(llvm::Deserializer& D, ASTContext& C);
+ friend void Decl::Destroy(ASTContext& C) const;
};
@@ -452,6 +453,7 @@ protected:
static EnumConstantDecl* CreateImpl(llvm::Deserializer& D, ASTContext& C);
friend Decl* Decl::Create(llvm::Deserializer& D, ASTContext& C);
+ friend void Decl::Destroy(ASTContext& C) const;
};
@@ -504,6 +506,7 @@ protected:
static TypedefDecl* CreateImpl(llvm::Deserializer& D, ASTContext& C);
friend Decl* Decl::Create(llvm::Deserializer& D, ASTContext& C);
+ friend void Decl::Destroy(ASTContext& C) const;
};
diff --git a/include/clang/AST/DeclBase.h b/include/clang/AST/DeclBase.h
index ec3c753051..058cb9223c 100644
--- a/include/clang/AST/DeclBase.h
+++ b/include/clang/AST/DeclBase.h
@@ -118,12 +118,10 @@ protected:
HasAttrs(false) {
if (Decl::CollectingStats()) addDeclKind(DK);
}
-
-public:
- // TODO: This should probably be made protected once derived classes have
- // destructors.
+
virtual ~Decl();
-
+
+public:
SourceLocation getLocation() const { return Loc; }
void setLocation(SourceLocation L) { Loc = L; }
diff --git a/include/clang/AST/DeclObjC.h b/include/clang/AST/DeclObjC.h
index e9d03a1769..0efdd2e60d 100644
--- a/include/clang/AST/DeclObjC.h
+++ b/include/clang/AST/DeclObjC.h
@@ -103,7 +103,7 @@ private:
SelName(SelInfo), MethodDeclType(T),
ParamInfo(0), NumMethodParams(0),
MethodAttrs(M), EndLoc(endLoc), Body(0), SelfDecl(0) {}
- virtual ~ObjCMethodDecl();
+ ~ObjCMethodDecl();
public:
static ObjCMethodDecl *Create(ASTContext &C,
@@ -175,6 +175,8 @@ public:
// Implement isa/cast/dyncast/etc.
static bool classof(const Decl *D) { return D->getKind() == ObjCMethod; }
static bool classof(const ObjCMethodDecl *D) { return true; }
+
+ friend void Decl::Destroy(ASTContext& C) const;
};
/// ObjCInterfaceDecl - Represents an ObjC class declaration. For example: