Make sure methods with no return type default to "id".

This fixes a crasher in Sema::MatchTwoMethodDeclarations(), identified by selector-overload.m (just added).

Added Action::ActOnTranslationUnitScope() and renamed Action::PopScope to ActOnPopScope.

Added a Translation Unit Scope instance variable to Sema (will be very useful to ObjC-related actions, since ObjC declarations are always file-scoped).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42817 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Parse/Parser.cpp b/Parse/Parser.cpp
index 117afab..fc5c4ae 100644
--- a/Parse/Parser.cpp
+++ b/Parse/Parser.cpp
@@ -192,7 +192,7 @@
   // Inform the actions module that this scope is going away if there are any
   // decls in it.
   if (!CurScope->decl_empty())
-    Actions.PopScope(Tok.getLocation(), CurScope);
+    Actions.ActOnPopScope(Tok.getLocation(), CurScope);
   
   Scope *OldScope = CurScope;
   CurScope = OldScope->getParent();
@@ -228,7 +228,8 @@
   // Create the translation unit scope.  Install it as the current scope.
   assert(CurScope == 0 && "A scope is already active?");
   EnterScope(Scope::DeclScope);
-    
+  Actions.ActOnTranslationUnitScope(Tok.getLocation(), CurScope);
+  
   // Install builtin types.
   // TODO: Move this someplace more useful.
   {