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

Anders Carlsson andersca at mac.com
Fri Mar 27 22:27:18 PDT 2009


Author: andersca
Date: Sat Mar 28 00:27:17 2009
New Revision: 67915

URL: http://llvm.org/viewvc/llvm-project?rev=67915&view=rev
Log:
Add an ActOnNamespaceAliasDef action and have the parser call it.

Modified:
    cfe/trunk/include/clang/Parse/Action.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=67915&r1=67914&r2=67915&view=diff

==============================================================================
--- cfe/trunk/include/clang/Parse/Action.h (original)
+++ cfe/trunk/include/clang/Parse/Action.h Sat Mar 28 00:27:17 2009
@@ -842,6 +842,17 @@
                                       IdentifierInfo *NamespcName,
                                       AttributeList *AttrList);
 
+  /// ActOnNamespaceAliasDef - This is called when a namespace alias definition
+  /// is parsed.
+  virtual DeclTy *ActOnNamespaceAliasDef(Scope *CurScope,
+                                         SourceLocation AliasLoc,
+                                         IdentifierInfo *Alias,
+                                         const CXXScopeSpec &SS,
+                                         SourceLocation NamespaceLoc,
+                                         IdentifierInfo *NamespaceName) {
+    return 0;
+  }
+                                         
   /// ActOnParamDefaultArgument - Parse default argument for function parameter
   virtual void ActOnParamDefaultArgument(DeclTy *param,
                                          SourceLocation EqualLoc,

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

==============================================================================
--- cfe/trunk/lib/Parse/ParseDeclCXX.cpp (original)
+++ cfe/trunk/lib/Parse/ParseDeclCXX.cpp Sat Mar 28 00:27:17 2009
@@ -124,7 +124,8 @@
   ExpectAndConsume(tok::semi, diag::err_expected_semi_after,
                    "namespace name", tok::semi);
   
-  return 0;
+  return Actions.ActOnNamespaceAliasDef(CurScope, AliasLoc, Alias, SS,
+                                        NamespaceLoc, NamespaceName);
 }
 
 /// 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=67915&r1=67914&r2=67915&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/Sema.h (original)
+++ cfe/trunk/lib/Sema/Sema.h Sat Mar 28 00:27:17 2009
@@ -1370,9 +1370,16 @@
                                       SourceLocation IdentLoc,
                                       IdentifierInfo *NamespcName,
                                       AttributeList *AttrList);
-
+  
   void PushUsingDirective(Scope *S, UsingDirectiveDecl *UDir);
 
+  virtual DeclTy *ActOnNamespaceAliasDef(Scope *CurScope,
+                                         SourceLocation AliasLoc,
+                                         IdentifierInfo *Alias,
+                                         const CXXScopeSpec &SS,
+                                         SourceLocation NamespaceLoc,
+                                         IdentifierInfo *NamespaceName);
+  
   /// AddCXXDirectInitializerToDecl - This action is called immediately after 
   /// ActOnDeclarator, when a C++ direct initializer is present.
   /// e.g: "int x(1);"

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

==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Sat Mar 28 00:27:17 2009
@@ -1675,6 +1675,15 @@
     S->PushUsingDirective(UDir);
 }
 
+Sema::DeclTy *Sema::ActOnNamespaceAliasDef(Scope *CurScope, 
+                                           SourceLocation AliasLoc,
+                                           IdentifierInfo *Alias,
+                                           const CXXScopeSpec &SS,
+                                           SourceLocation NamespaceLoc,
+                                           IdentifierInfo *NamespaceName) {
+  return 0;
+}
+
 /// AddCXXDirectInitializerToDecl - This action is called immediately after 
 /// ActOnDeclarator, when a C++ direct initializer is present.
 /// e.g: "int x(1);"





More information about the cfe-commits mailing list