/// 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);
}
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);
- }
+ // Enter the enumeration context.
+ PushDeclContext(S, Enum);
}
Sema::DeclTy *Sema::ActOnEnumConstant(Scope *S, DeclTy *theEnumDecl,