clang API Documentation

Public Types | Public Member Functions | Static Public Member Functions | Friends
clang::NamespaceDecl Class Reference

NamespaceDecl - Represent a C++ namespace. More...

#include <Decl.h>

Inheritance diagram for clang::NamespaceDecl:
Inheritance graph
[legend]
Collaboration diagram for clang::NamespaceDecl:
Collaboration graph
[legend]

List of all members.

Public Types

typedef
redeclarable_base::redecl_range 
redecl_range
typedef
redeclarable_base::redecl_iterator 
redecl_iterator

Public Member Functions

bool isAnonymousNamespace () const
 Returns true if this is an anonymous namespace declaration.
bool isInline () const
 Returns true if this is an inline namespace declaration.
void setInline (bool Inline)
 Set whether this is an inline namespace declaration.
NamespaceDeclgetOriginalNamespace ()
 Get the original (first) namespace declaration.
const NamespaceDeclgetOriginalNamespace () const
 Get the original (first) namespace declaration.
bool isOriginalNamespace () const
 Return true if this declaration is an original (first) declaration of the namespace. This is false for non-original (subsequent) namespace declarations and anonymous namespaces.
NamespaceDeclgetAnonymousNamespace () const
 Retrieve the anonymous namespace nested inside this namespace, if any.
void setAnonymousNamespace (NamespaceDecl *D)
NamespaceDeclgetCanonicalDecl () override
 Retrieves the canonical declaration of this namespace.
const NamespaceDeclgetCanonicalDecl () const
SourceRange getSourceRange () const override LLVM_READONLY
 Source range that this declaration covers.
SourceLocation getLocStart () const LLVM_READONLY
SourceLocation getRBraceLoc () const
void setLocStart (SourceLocation L)
void setRBraceLoc (SourceLocation L)

Static Public Member Functions

static NamespaceDeclCreate (ASTContext &C, DeclContext *DC, bool Inline, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, NamespaceDecl *PrevDecl)
static NamespaceDeclCreateDeserialized (ASTContext &C, unsigned ID)
static bool classof (const Decl *D)
static bool classofKind (Kind K)
static DeclContextcastToDeclContext (const NamespaceDecl *D)
static NamespaceDeclcastFromDeclContext (const DeclContext *DC)

Friends

class ASTDeclReader
class ASTDeclWriter

Detailed Description

NamespaceDecl - Represent a C++ namespace.

Definition at line 358 of file Decl.h.


Member Typedef Documentation

typedef redeclarable_base::redecl_iterator clang::NamespaceDecl::redecl_iterator

Definition at line 391 of file Decl.h.

Reimplemented from clang::Redeclarable< NamespaceDecl >.

Definition at line 390 of file Decl.h.


Member Function Documentation

static NamespaceDecl* clang::NamespaceDecl::castFromDeclContext ( const DeclContext DC) [inline, static]

Reimplemented from clang::Decl.

Definition at line 476 of file Decl.h.

static DeclContext* clang::NamespaceDecl::castToDeclContext ( const NamespaceDecl D) [inline, static]

Definition at line 473 of file Decl.h.

static bool clang::NamespaceDecl::classof ( const Decl D) [inline, static]

Reimplemented from clang::NamedDecl.

Definition at line 471 of file Decl.h.

References classofKind(), and clang::Decl::getKind().

static bool clang::NamespaceDecl::classofKind ( Kind  K) [inline, static]

Reimplemented from clang::NamedDecl.

Definition at line 472 of file Decl.h.

Referenced by classof().

NamespaceDecl * NamespaceDecl::Create ( ASTContext C,
DeclContext DC,
bool  Inline,
SourceLocation  StartLoc,
SourceLocation  IdLoc,
IdentifierInfo Id,
NamespaceDecl PrevDecl 
) [static]

Definition at line 1988 of file DeclCXX.cpp.

References AttributeLangSupport::C.

Retrieve the anonymous namespace nested inside this namespace, if any.

Definition at line 445 of file Decl.h.

References getOriginalNamespace().

Referenced by clang::Sema::ActOnStartNamespaceDef(), clang::ASTDeclWriter::VisitNamespaceDecl(), and clang::ASTNodeImporter::VisitNamespaceDecl().

NamespaceDecl* clang::NamespaceDecl::getCanonicalDecl ( ) [inline, override, virtual]

Retrieves the canonical declaration of this namespace.

Reimplemented from clang::Decl.

Definition at line 454 of file Decl.h.

References getOriginalNamespace().

Reimplemented from clang::Decl.

Definition at line 457 of file Decl.h.

References getOriginalNamespace().

Reimplemented from clang::Decl.

Definition at line 465 of file Decl.h.

Referenced by clang::ASTDeclWriter::VisitNamespaceDecl(), and clang::ASTNodeImporter::VisitNamespaceDecl().

Get the original (first) namespace declaration.

Definition at line 431 of file Decl.h.

References clang::Redeclarable< NamespaceDecl >::isFirstDecl().

Definition at line 466 of file Decl.h.

Referenced by clang::ASTDeclWriter::VisitNamespaceDecl().

SourceRange clang::NamespaceDecl::getSourceRange ( ) const [inline, override, virtual]

Source range that this declaration covers.

Reimplemented from clang::Decl.

Definition at line 461 of file Decl.h.

Returns true if this is an anonymous namespace declaration.

For example:

   namespace {
     ...
   };

q.v. C++ [namespace.unnamed]

Definition at line 408 of file Decl.h.

References clang::NamedDecl::getIdentifier().

Referenced by createFriendTagNNSFixIt(), getNestedNameSpecifierIdentifiers(), and clang::ASTDeclWriter::VisitNamespaceDecl().

Return true if this declaration is an original (first) declaration of the namespace. This is false for non-original (subsequent) namespace declarations and anonymous namespaces.

Definition at line 441 of file Decl.h.

References clang::Redeclarable< NamespaceDecl >::isFirstDecl().

Referenced by clang::ASTDeclWriter::VisitNamespaceDecl().

void clang::NamespaceDecl::setInline ( bool  Inline) [inline]

Set whether this is an inline namespace declaration.

Definition at line 418 of file Decl.h.

Referenced by clang::ASTDeclReader::VisitNamespaceDecl().

Definition at line 467 of file Decl.h.

Definition at line 468 of file Decl.h.

Referenced by clang::Sema::ActOnFinishNamespaceDef().


Friends And Related Function Documentation

friend class ASTDeclReader [friend]

Reimplemented from clang::DeclContext.

Definition at line 480 of file Decl.h.

friend class ASTDeclWriter [friend]

Reimplemented from clang::Redeclarable< NamespaceDecl >.

Definition at line 481 of file Decl.h.


The documentation for this class was generated from the following files: