summaryrefslogtreecommitdiffstats
path: root/clang/AST
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-03-15 21:10:16 +0000
committerChris Lattner <sabre@nondot.org>2008-03-15 21:10:16 +0000
commit4b08ca8f2e16e7fea0840bc83cb207aa53c5cfd2 (patch)
tree28998c297709e67b0aa3f93d4e88e08a8632e3dd /clang/AST
parent2c7f144ab783dcd2753613ce4cb5c9aa6a9424ef (diff)
downloadbcm5719-llvm-4b08ca8f2e16e7fea0840bc83cb207aa53c5cfd2.tar.gz
bcm5719-llvm-4b08ca8f2e16e7fea0840bc83cb207aa53c5cfd2.zip
switch the VarDecl allocation model to go through ASTContext.
llvm-svn: 48396
Diffstat (limited to 'clang/AST')
-rw-r--r--clang/AST/Decl.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/clang/AST/Decl.cpp b/clang/AST/Decl.cpp
index aad8f212bfe..a171589f135 100644
--- a/clang/AST/Decl.cpp
+++ b/clang/AST/Decl.cpp
@@ -205,6 +205,28 @@ void Decl::addDeclKind(Kind k) {
// Decl Allocation/Deallocation Method Implementations
//===----------------------------------------------------------------------===//
+BlockVarDecl *BlockVarDecl::Create(SourceLocation L, IdentifierInfo *Id,
+ QualType T, StorageClass S,
+ ScopedDecl *PrevDecl, ASTContext &C) {
+ void *Mem = C.getAllocator().Allocate<BlockVarDecl>();
+ return new (Mem) BlockVarDecl(L, Id, T, S, PrevDecl);
+}
+
+
+FileVarDecl *FileVarDecl::Create(SourceLocation L, IdentifierInfo *Id,
+ QualType T, StorageClass S,
+ ScopedDecl *PrevDecl, ASTContext &C) {
+ void *Mem = C.getAllocator().Allocate<FileVarDecl>();
+ return new (Mem) FileVarDecl(L, Id, T, S, PrevDecl);
+}
+
+ParmVarDecl *ParmVarDecl::Create(SourceLocation L, IdentifierInfo *Id,
+ QualType T, StorageClass S,
+ ScopedDecl *PrevDecl, ASTContext &C) {
+ void *Mem = C.getAllocator().Allocate<ParmVarDecl>();
+ return new (Mem) ParmVarDecl(L, Id, T, S, PrevDecl);
+}
+
EnumConstantDecl *EnumConstantDecl::Create(SourceLocation L, IdentifierInfo *Id,
QualType T, Expr *E,
const llvm::APSInt &V,
OpenPOWER on IntegriCloud