Minor tweaks to the transparent declcontext patch

llvm-svn: 61798
This commit is contained in:
Douglas Gregor 2009-01-06 07:17:58 +00:00
parent 4f149f2611
commit d05cb418fd
2 changed files with 5 additions and 6 deletions

View File

@ -513,7 +513,8 @@ void DeclContext::addDecl(ASTContext &Context, ScopedDecl *D, bool AllowLookup)
/// transparent contexts nested within it).
void DeclContext::buildLookup(ASTContext &Context, DeclContext *DCtx) {
for (; DCtx; DCtx = DCtx->getNextContext()) {
for (decl_iterator D = DCtx->decls_begin(); D != DCtx->decls_end(); ++D) {
for (decl_iterator D = DCtx->decls_begin(), DEnd = DCtx->decls_end();
D != DEnd; ++D) {
// Insert this declaration into the lookup structure
insertImpl(*D);

View File

@ -3138,13 +3138,11 @@ void Sema::ActOnFields(Scope* S,
}
void Sema::ActOnEnumStartDefinition(Scope *S, DeclTy *EnumD) {
EnumDecl *Enum = cast_or_null<EnumDecl>((Decl *)EnumD);
EnumDecl *Enum = cast<EnumDecl>((Decl *)EnumD);
if (Enum) {
// Enter the enumeration context.
PushDeclContext(S, Enum);
}
}
Sema::DeclTy *Sema::ActOnEnumConstant(Scope *S, DeclTy *theEnumDecl,
DeclTy *lastEnumConst,