Use a scoped object to manage entry/exit from a parser scope rather than explicitly calling EnterScope/ExitScope

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60830 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp
index e7f4fc9..572ca61 100644
--- a/lib/Parse/ParseDecl.cpp
+++ b/lib/Parse/ParseDecl.cpp
@@ -1728,7 +1728,7 @@
 
   // Enter function-declaration scope, limiting any declarators to the
   // function prototype scope, including parameter declarators.
-  EnterScope(Scope::FnScope|Scope::DeclScope);
+  ParseScope PrototypeScope(this, Scope::FnScope|Scope::DeclScope);
   
   bool IsVariadic = false;
   while (1) {
@@ -1818,7 +1818,7 @@
   }
   
   // Leave prototype scope.
-  ExitScope();
+  PrototypeScope.Exit();
   
   // If we have the closing ')', eat it.
   MatchRHSPunctuation(tok::r_paren, LParenLoc);