diff options
author | Chris Lattner <sabre@nondot.org> | 2008-04-22 18:39:57 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-04-22 18:39:57 +0000 |
commit | 9fdf9c6d3530bb85f3166e6460d841e2ff8e1a2c (patch) | |
tree | dd6acdccfa4e434bf9f8dff0c5bf095e53977e1b /lib | |
parent | 5585114307b6ba4874546212cb6e5399cfff7ffb (diff) |
"This patch renames
DeclContext *CtxDecl -> DeclContext *DeclCtx
DeclContext *CD -> DeclContext *DC
It makes the code more consistent."
Patch by Zhongxing Xu!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50105 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/AST/Decl.cpp | 24 | ||||
-rw-r--r-- | lib/AST/DeclSerialization.cpp | 2 | ||||
-rw-r--r-- | lib/Sema/Sema.h | 2 | ||||
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 8 |
4 files changed, 18 insertions, 18 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index 11e6bcfb0f..3c7401feab 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -211,29 +211,29 @@ TranslationUnitDecl *TranslationUnitDecl::Create(ASTContext &C) { return new (Mem) TranslationUnitDecl(); } -VarDecl *VarDecl::Create(ASTContext &C, DeclContext *CD, +VarDecl *VarDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L, IdentifierInfo *Id, QualType T, StorageClass S, ScopedDecl *PrevDecl) { void *Mem = C.getAllocator().Allocate<VarDecl>(); - return new (Mem) VarDecl(Var, CD, L, Id, T, S, PrevDecl); + return new (Mem) VarDecl(Var, DC, L, Id, T, S, PrevDecl); } -ParmVarDecl *ParmVarDecl::Create(ASTContext &C, DeclContext *CD, +ParmVarDecl *ParmVarDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L, IdentifierInfo *Id, QualType T, StorageClass S, Expr *DefArg, ScopedDecl *PrevDecl) { void *Mem = C.getAllocator().Allocate<ParmVarDecl>(); - return new (Mem) ParmVarDecl(CD, L, Id, T, S, DefArg, PrevDecl); + return new (Mem) ParmVarDecl(DC, L, Id, T, S, DefArg, PrevDecl); } -FunctionDecl *FunctionDecl::Create(ASTContext &C, DeclContext *CD, +FunctionDecl *FunctionDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L, IdentifierInfo *Id, QualType T, StorageClass S, bool isInline, ScopedDecl *PrevDecl) { void *Mem = C.getAllocator().Allocate<FunctionDecl>(); - return new (Mem) FunctionDecl(CD, L, Id, T, S, isInline, PrevDecl); + return new (Mem) FunctionDecl(DC, L, Id, T, S, isInline, PrevDecl); } FieldDecl *FieldDecl::Create(ASTContext &C, SourceLocation L, @@ -252,26 +252,26 @@ EnumConstantDecl *EnumConstantDecl::Create(ASTContext &C, EnumDecl *CD, return new (Mem) EnumConstantDecl(CD, L, Id, T, E, V, PrevDecl); } -TypedefDecl *TypedefDecl::Create(ASTContext &C, DeclContext *CD, +TypedefDecl *TypedefDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L, IdentifierInfo *Id, QualType T, ScopedDecl *PD) { void *Mem = C.getAllocator().Allocate<TypedefDecl>(); - return new (Mem) TypedefDecl(CD, L, Id, T, PD); + return new (Mem) TypedefDecl(DC, L, Id, T, PD); } -EnumDecl *EnumDecl::Create(ASTContext &C, DeclContext *CD, SourceLocation L, +EnumDecl *EnumDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L, IdentifierInfo *Id, ScopedDecl *PrevDecl) { void *Mem = C.getAllocator().Allocate<EnumDecl>(); - return new (Mem) EnumDecl(CD, L, Id, PrevDecl); + return new (Mem) EnumDecl(DC, L, Id, PrevDecl); } -RecordDecl *RecordDecl::Create(ASTContext &C, Kind DK, DeclContext *CD, +RecordDecl *RecordDecl::Create(ASTContext &C, Kind DK, DeclContext *DC, SourceLocation L, IdentifierInfo *Id, ScopedDecl *PrevDecl) { void *Mem = C.getAllocator().Allocate<RecordDecl>(); - return new (Mem) RecordDecl(DK, CD, L, Id, PrevDecl); + return new (Mem) RecordDecl(DK, DC, L, Id, PrevDecl); } FileScopeAsmDecl *FileScopeAsmDecl::Create(ASTContext &C, diff --git a/lib/AST/DeclSerialization.cpp b/lib/AST/DeclSerialization.cpp index e7442ff51c..6186649e70 100644 --- a/lib/AST/DeclSerialization.cpp +++ b/lib/AST/DeclSerialization.cpp @@ -115,7 +115,7 @@ void ScopedDecl::ReadInRec(Deserializer& D, ASTContext& C) { D.ReadPtr(Next); // From ScopedDecl. Decl *TmpD; D.ReadPtr(TmpD); // From ScopedDecl. - CtxDecl = cast_or_null<DeclContext>(TmpD); + DeclCtx = cast_or_null<DeclContext>(TmpD); } //===------------------------------------------------------------===// diff --git a/lib/Sema/Sema.h b/lib/Sema/Sema.h index e70da932f6..da878f3f13 100644 --- a/lib/Sema/Sema.h +++ b/lib/Sema/Sema.h @@ -258,7 +258,7 @@ private: DeclTy **Elements, unsigned NumElements); private: /// Set the current declaration context until it gets popped. - void PushDeclContext(DeclContext *CD); + void PushDeclContext(DeclContext *DC); void PopDeclContext(); /// Add this decl to the scope shadowed decl chains. diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 415908a30b..c97ecc8313 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -42,11 +42,11 @@ Sema::DeclTy *Sema::isTypeName(const IdentifierInfo &II, Scope *S) { return 0; } -void Sema::PushDeclContext(DeclContext *CD) { - assert( ( (CD->isFunctionOrMethod() && isa<TranslationUnitDecl>(CurContext)) - || CD->getParent() == CurContext ) && +void Sema::PushDeclContext(DeclContext *DC) { + assert( ( (DC->isFunctionOrMethod() && isa<TranslationUnitDecl>(CurContext)) + || DC->getParent() == CurContext ) && "The next DeclContext should be directly contained in the current one."); - CurContext = CD; + CurContext = DC; } void Sema::PopDeclContext() { |