Minor tweaks to the transparent declcontext patch

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61798 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp
index 59d8a07..a21d5db 100644
--- a/lib/AST/DeclBase.cpp
+++ b/lib/AST/DeclBase.cpp
@@ -513,7 +513,8 @@
 /// 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);
 
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index dce1e12..5a7d07b 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -3138,12 +3138,10 @@
 }
 
 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,