diff options
author | Chris Lattner <sabre@nondot.org> | 2008-04-06 04:47:34 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-04-06 04:47:34 +0000 |
commit | b048c9835969c4f7fe06264748be18ed4b442116 (patch) | |
tree | 1547bf56624a863ec983bd8d4efd44d87fd94be1 /lib/AST/Decl.cpp | |
parent | 6ccb91abc37700e646139f49c448ccdbf14eb575 (diff) |
This patch contains these changes:
-Renamed ContextDecl -> DeclContext
-Removed DeclContext pointer from FieldDecl
-EnumDecl inherits from DeclContext, instead of TagDecl
Patch by Argiris Kirtzidis!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49261 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r-- | lib/AST/Decl.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index b1a2499949..d97e0b33e5 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -204,7 +204,7 @@ void Decl::addDeclKind(Kind k) { // Decl Allocation/Deallocation Method Implementations //===----------------------------------------------------------------------===// -BlockVarDecl *BlockVarDecl::Create(ASTContext &C, ContextDecl *CD, +BlockVarDecl *BlockVarDecl::Create(ASTContext &C, DeclContext *CD, SourceLocation L, IdentifierInfo *Id, QualType T, StorageClass S, ScopedDecl *PrevDecl) { @@ -213,7 +213,7 @@ BlockVarDecl *BlockVarDecl::Create(ASTContext &C, ContextDecl *CD, } -FileVarDecl *FileVarDecl::Create(ASTContext &C, ContextDecl *CD, +FileVarDecl *FileVarDecl::Create(ASTContext &C, DeclContext *CD, SourceLocation L, IdentifierInfo *Id, QualType T, StorageClass S, ScopedDecl *PrevDecl) { @@ -221,7 +221,7 @@ FileVarDecl *FileVarDecl::Create(ASTContext &C, ContextDecl *CD, return new (Mem) FileVarDecl(CD, L, Id, T, S, PrevDecl); } -ParmVarDecl *ParmVarDecl::Create(ASTContext &C, ContextDecl *CD, +ParmVarDecl *ParmVarDecl::Create(ASTContext &C, DeclContext *CD, SourceLocation L, IdentifierInfo *Id, QualType T, StorageClass S, ScopedDecl *PrevDecl) { @@ -229,7 +229,7 @@ ParmVarDecl *ParmVarDecl::Create(ASTContext &C, ContextDecl *CD, return new (Mem) ParmVarDecl(CD, L, Id, T, S, PrevDecl); } -FunctionDecl *FunctionDecl::Create(ASTContext &C, ContextDecl *CD, +FunctionDecl *FunctionDecl::Create(ASTContext &C, DeclContext *CD, SourceLocation L, IdentifierInfo *Id, QualType T, StorageClass S, bool isInline, @@ -238,10 +238,10 @@ FunctionDecl *FunctionDecl::Create(ASTContext &C, ContextDecl *CD, return new (Mem) FunctionDecl(CD, L, Id, T, S, isInline, PrevDecl); } -FieldDecl *FieldDecl::Create(ASTContext &C, RecordDecl *CD, SourceLocation L, +FieldDecl *FieldDecl::Create(ASTContext &C, SourceLocation L, IdentifierInfo *Id, QualType T, Expr *BW) { void *Mem = C.getAllocator().Allocate<FieldDecl>(); - return new (Mem) FieldDecl(CD, L, Id, T, BW); + return new (Mem) FieldDecl(L, Id, T, BW); } @@ -254,7 +254,7 @@ EnumConstantDecl *EnumConstantDecl::Create(ASTContext &C, EnumDecl *CD, return new (Mem) EnumConstantDecl(CD, L, Id, T, E, V, PrevDecl); } -TypedefDecl *TypedefDecl::Create(ASTContext &C, ContextDecl *CD, +TypedefDecl *TypedefDecl::Create(ASTContext &C, DeclContext *CD, SourceLocation L, IdentifierInfo *Id, QualType T, ScopedDecl *PD) { @@ -262,14 +262,14 @@ TypedefDecl *TypedefDecl::Create(ASTContext &C, ContextDecl *CD, return new (Mem) TypedefDecl(CD, L, Id, T, PD); } -EnumDecl *EnumDecl::Create(ASTContext &C, ContextDecl *CD, SourceLocation L, +EnumDecl *EnumDecl::Create(ASTContext &C, DeclContext *CD, SourceLocation L, IdentifierInfo *Id, ScopedDecl *PrevDecl) { void *Mem = C.getAllocator().Allocate<EnumDecl>(); return new (Mem) EnumDecl(CD, L, Id, PrevDecl); } -RecordDecl *RecordDecl::Create(ASTContext &C, Kind DK, ContextDecl *CD, +RecordDecl *RecordDecl::Create(ASTContext &C, Kind DK, DeclContext *CD, SourceLocation L, IdentifierInfo *Id, ScopedDecl *PrevDecl) { void *Mem = C.getAllocator().Allocate<RecordDecl>(); @@ -330,22 +330,22 @@ const Attr *Decl::getAttrs() const { } //===----------------------------------------------------------------------===// -// ContextDecl Implementation +// DeclContext Implementation //===----------------------------------------------------------------------===// -ContextDecl *ContextDecl::getParent() const { +DeclContext *DeclContext::getParent() const { if (ScopedDecl *SD = dyn_cast<ScopedDecl>(this)) - return SD->getContextDecl(); + return SD->getDeclContext(); else return NULL; } -Decl *ContextDecl::ToDecl (const ContextDecl *D) { +Decl *DeclContext::ToDecl (const DeclContext *D) { return CastTo<Decl>(D); } -ContextDecl *ContextDecl::FromDecl (const Decl *D) { - return CastTo<ContextDecl>(D); +DeclContext *DeclContext::FromDecl (const Decl *D) { + return CastTo<DeclContext>(D); } //===----------------------------------------------------------------------===// |