diff options
| author | Chris Lattner <sabre@nondot.org> | 2008-03-16 00:16:02 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2008-03-16 00:16:02 +0000 |
| commit | ee1284a6e20097fe1fe0fa1f16ab95c596bcea4a (patch) | |
| tree | 5a4c72dc49dcce3dfe6c35cbb2912c897a714d19 /clang/lib/AST/Decl.cpp | |
| parent | 7a51313d8a0a358bb92eb5dbf8fd846b7c48e7fe (diff) | |
| download | bcm5719-llvm-ee1284a6e20097fe1fe0fa1f16ab95c596bcea4a.tar.gz bcm5719-llvm-ee1284a6e20097fe1fe0fa1f16ab95c596bcea4a.zip | |
switch the rest of the C decl classes to do their
allocation through ASTContext.
llvm-svn: 48403
Diffstat (limited to 'clang/lib/AST/Decl.cpp')
| -rw-r--r-- | clang/lib/AST/Decl.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp index 7fa679cbc08..4ce6fa8f3c4 100644 --- a/clang/lib/AST/Decl.cpp +++ b/clang/lib/AST/Decl.cpp @@ -235,6 +235,12 @@ FunctionDecl *FunctionDecl::Create(ASTContext &C, SourceLocation L, return new (Mem) FunctionDecl(L, Id, T, S, isInline, PrevDecl); } +FieldDecl *FieldDecl::Create(ASTContext &C, SourceLocation L, + IdentifierInfo *Id, QualType T, Expr *BW) { + void *Mem = C.getAllocator().Allocate<FieldDecl>(); + return new (Mem) FieldDecl(L, Id, T, BW); +} + EnumConstantDecl *EnumConstantDecl::Create(ASTContext &C, SourceLocation L, IdentifierInfo *Id, QualType T, @@ -263,6 +269,17 @@ RecordDecl *RecordDecl::Create(ASTContext &C, Kind DK, SourceLocation L, return new (Mem) RecordDecl(DK, L, Id, PrevDecl); } +FileScopeAsmDecl *FileScopeAsmDecl::Create(ASTContext &C, SourceLocation L, + StringLiteral *Str) { + void *Mem = C.getAllocator().Allocate<FileScopeAsmDecl>(); + return new (Mem) FileScopeAsmDecl(L, Str); +} + +LinkageSpecDecl *LinkageSpecDecl::Create(ASTContext &C, SourceLocation L, + LanguageIDs Lang, Decl *D) { + void *Mem = C.getAllocator().Allocate<LinkageSpecDecl>(); + return new (Mem) LinkageSpecDecl(L, Lang, D); +} //===----------------------------------------------------------------------===// // Decl Implementation |

