]> granicus.if.org Git - clang/commitdiff
Add an ActOnNamespaceAliasDef action and have the parser call it.
authorAnders Carlsson <andersca@mac.com>
Sat, 28 Mar 2009 05:27:17 +0000 (05:27 +0000)
committerAnders Carlsson <andersca@mac.com>
Sat, 28 Mar 2009 05:27:17 +0000 (05:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67915 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Parse/Action.h
lib/Parse/ParseDeclCXX.cpp
lib/Sema/Sema.h
lib/Sema/SemaDeclCXX.cpp

index f284ca0a75441216d18358ff967c620254ea8ad4..2f4d283950b6545f5fc79a7ecfc58ef6d03a4fff 100644 (file)
@@ -842,6 +842,17 @@ public:
                                       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,
index 229c1815f25aa241c57200554631d0dbd652e04d..121bf04bc33c7eea29b6050da206401501fbdde2 100644 (file)
@@ -124,7 +124,8 @@ Parser::DeclTy *Parser::ParseNamespaceAlias(SourceLocation AliasLoc,
   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
index 37a1799898b16ff878b5f0ebc851598e09f82ef7..ab845595b1ebb88353790577eb16ac59977145e1 100644 (file)
@@ -1370,9 +1370,16 @@ public:
                                       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);"
index 90983040b5b4b7ab4c3144ac82a2ebd4c22480c8..349aafdbda57c0b0dd3cbdb29783c34fb7ce4e1d 100644 (file)
@@ -1675,6 +1675,15 @@ void Sema::PushUsingDirective(Scope *S, UsingDirectiveDecl *UDir) {
     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);"