[cfe-commits] r67961 - in /cfe/trunk: include/clang/Parse/Action.h include/clang/Parse/Parser.h lib/Parse/ParseDeclCXX.cpp lib/Sema/Sema.h lib/Sema/SemaDeclCXX.cpp

Anders Carlsson andersca at mac.com
Sat Mar 28 15:53:22 PDT 2009


Author: andersca
Date: Sat Mar 28 17:53:22 2009
New Revision: 67961

URL: http://llvm.org/viewvc/llvm-project?rev=67961&view=rev
Log:
Parse the location of the 'namespace' token to ActOnNamespaceAliasDef. No functionality change.

Modified:
    cfe/trunk/include/clang/Parse/Action.h
    cfe/trunk/include/clang/Parse/Parser.h
    cfe/trunk/lib/Parse/ParseDeclCXX.cpp
    cfe/trunk/lib/Sema/Sema.h
    cfe/trunk/lib/Sema/SemaDeclCXX.cpp

Modified: cfe/trunk/include/clang/Parse/Action.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/Action.h?rev=67961&r1=67960&r2=67961&view=diff

==============================================================================
--- cfe/trunk/include/clang/Parse/Action.h (original)
+++ cfe/trunk/include/clang/Parse/Action.h Sat Mar 28 17:53:22 2009
@@ -848,11 +848,12 @@
   /// ActOnNamespaceAliasDef - This is called when a namespace alias definition
   /// is parsed.
   virtual DeclPtrTy ActOnNamespaceAliasDef(Scope *CurScope,
+                                           SourceLocation NamespaceLoc,
                                            SourceLocation AliasLoc,
                                            IdentifierInfo *Alias,
                                            const CXXScopeSpec &SS,
-                                           SourceLocation NamespaceLoc,
-                                           IdentifierInfo *NamespaceName) {
+                                           SourceLocation IdentLoc,
+                                           IdentifierInfo *Ident) {
     return DeclPtrTy();
   }
                                          

Modified: cfe/trunk/include/clang/Parse/Parser.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/Parser.h?rev=67961&r1=67960&r2=67961&view=diff

==============================================================================
--- cfe/trunk/include/clang/Parse/Parser.h (original)
+++ cfe/trunk/include/clang/Parse/Parser.h Sat Mar 28 17:53:22 2009
@@ -997,7 +997,8 @@
   DeclPtrTy ParseUsingDirective(unsigned Context, SourceLocation UsingLoc);
   DeclPtrTy ParseUsingDeclaration(unsigned Context, SourceLocation UsingLoc);
   DeclPtrTy ParseStaticAssertDeclaration();
-  DeclPtrTy ParseNamespaceAlias(SourceLocation AliasLoc, IdentifierInfo *Alias);
+  DeclPtrTy ParseNamespaceAlias(SourceLocation NamespaceLoc,
+                                SourceLocation AliasLoc, IdentifierInfo *Alias);
   
   //===--------------------------------------------------------------------===//
   // C++ 9: classes [class] and C structs/unions.

Modified: cfe/trunk/lib/Parse/ParseDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDeclCXX.cpp?rev=67961&r1=67960&r2=67961&view=diff

==============================================================================
--- cfe/trunk/lib/Parse/ParseDeclCXX.cpp (original)
+++ cfe/trunk/lib/Parse/ParseDeclCXX.cpp Sat Mar 28 17:53:22 2009
@@ -62,7 +62,7 @@
   
   if (Tok.is(tok::equal))
     // FIXME: Verify no attributes were present.
-    return ParseNamespaceAlias(IdentLoc, Ident);
+    return ParseNamespaceAlias(NamespaceLoc, IdentLoc, Ident);
   
   if (Tok.is(tok::l_brace)) {
     SourceLocation LBrace = ConsumeBrace();
@@ -99,7 +99,8 @@
 /// ParseNamespaceAlias - Parse the part after the '=' in a namespace
 /// alias definition.
 ///
-Parser::DeclPtrTy Parser::ParseNamespaceAlias(SourceLocation AliasLoc, 
+Parser::DeclPtrTy Parser::ParseNamespaceAlias(SourceLocation NamespaceLoc,
+                                              SourceLocation AliasLoc, 
                                               IdentifierInfo *Alias) {
   assert(Tok.is(tok::equal) && "Not equal token");
   
@@ -117,15 +118,15 @@
   }
 
   // Parse identifier.
-  IdentifierInfo *NamespaceName = Tok.getIdentifierInfo();
-  SourceLocation NamespaceLoc = ConsumeToken();
+  IdentifierInfo *Ident = Tok.getIdentifierInfo();
+  SourceLocation IdentLoc = ConsumeToken();
   
   // Eat the ';'.
   ExpectAndConsume(tok::semi, diag::err_expected_semi_after,
                    "namespace name", tok::semi);
   
-  return Actions.ActOnNamespaceAliasDef(CurScope, AliasLoc, Alias, SS,
-                                        NamespaceLoc, NamespaceName);
+  return Actions.ActOnNamespaceAliasDef(CurScope, NamespaceLoc, AliasLoc, Alias, 
+                                        SS, IdentLoc, Ident);
 }
 
 /// ParseLinkage - We know that the current token is a string_literal

Modified: cfe/trunk/lib/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.h?rev=67961&r1=67960&r2=67961&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/Sema.h (original)
+++ cfe/trunk/lib/Sema/Sema.h Sat Mar 28 17:53:22 2009
@@ -1377,11 +1377,12 @@
   void PushUsingDirective(Scope *S, UsingDirectiveDecl *UDir);
 
   virtual DeclPtrTy ActOnNamespaceAliasDef(Scope *CurScope,
+                                           SourceLocation NamespaceLoc,
                                            SourceLocation AliasLoc,
                                            IdentifierInfo *Alias,
                                            const CXXScopeSpec &SS,
-                                           SourceLocation NamespaceLoc,
-                                           IdentifierInfo *NamespaceName);
+                                           SourceLocation IdentLoc,
+                                           IdentifierInfo *Ident);
   
   /// AddCXXDirectInitializerToDecl - This action is called immediately after 
   /// ActOnDeclarator, when a C++ direct initializer is present.

Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=67961&r1=67960&r2=67961&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Sat Mar 28 17:53:22 2009
@@ -1677,11 +1677,12 @@
 }
 
 Sema::DeclPtrTy Sema::ActOnNamespaceAliasDef(Scope *S, 
+                                             SourceLocation NamespaceLoc,
                                              SourceLocation AliasLoc,
                                              IdentifierInfo *Alias,
                                              const CXXScopeSpec &SS,
-                                             SourceLocation NamespaceLoc,
-                                             IdentifierInfo *NamespaceName) {
+                                             SourceLocation IdentLoc,
+                                             IdentifierInfo *Ident) {
   
   // Check if we have a previous declaration with the same name.
   if (NamedDecl *PrevDecl = LookupName(S, Alias, LookupOrdinaryName)) {
@@ -1695,10 +1696,9 @@
   }
 
   // Lookup the namespace name.
-  LookupResult R = LookupParsedName(S, &SS, NamespaceName,
-                                    LookupNamespaceName, false);
+  LookupResult R = LookupParsedName(S, &SS, Ident, LookupNamespaceName, false);
   if (R.isAmbiguous()) {
-    DiagnoseAmbiguousLookup(R, NamespaceName, NamespaceLoc);
+    DiagnoseAmbiguousLookup(R, Ident, IdentLoc);
     return DeclPtrTy();
   }
   





More information about the cfe-commits mailing list