clang API Documentation
NamespaceDecl - Represent a C++ namespace. More...
#include <Decl.h>
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. | |
NamespaceDecl * | getOriginalNamespace () |
Get the original (first) namespace declaration. | |
const NamespaceDecl * | getOriginalNamespace () 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. | |
NamespaceDecl * | getAnonymousNamespace () const |
Retrieve the anonymous namespace nested inside this namespace, if any. | |
void | setAnonymousNamespace (NamespaceDecl *D) |
NamespaceDecl * | getCanonicalDecl () override |
Retrieves the canonical declaration of this namespace. | |
const NamespaceDecl * | getCanonicalDecl () 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 NamespaceDecl * | Create (ASTContext &C, DeclContext *DC, bool Inline, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, NamespaceDecl *PrevDecl) |
static NamespaceDecl * | CreateDeserialized (ASTContext &C, unsigned ID) |
static bool | classof (const Decl *D) |
static bool | classofKind (Kind K) |
static DeclContext * | castToDeclContext (const NamespaceDecl *D) |
static NamespaceDecl * | castFromDeclContext (const DeclContext *DC) |
Friends | |
class | ASTDeclReader |
class | ASTDeclWriter |
NamespaceDecl - Represent a C++ namespace.
typedef redeclarable_base::redecl_iterator clang::NamespaceDecl::redecl_iterator |
Reimplemented from clang::Redeclarable< NamespaceDecl >.
static NamespaceDecl* clang::NamespaceDecl::castFromDeclContext | ( | const DeclContext * | DC | ) | [inline, static] |
Reimplemented from clang::Decl.
static DeclContext* clang::NamespaceDecl::castToDeclContext | ( | const NamespaceDecl * | D | ) | [inline, static] |
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 1980 of file DeclCXX.cpp.
References AttributeLangSupport::C.
Referenced by clang::Sema::ActOnStartNamespaceDef(), CreateAAPCSABIBuiltinVaListDecl(), CreateAArch64ABIBuiltinVaListDecl(), clang::Sema::getOrCreateStdNamespace(), and clang::ASTNodeImporter::VisitNamespaceDecl().
NamespaceDecl * NamespaceDecl::CreateDeserialized | ( | ASTContext & | C, |
unsigned | ID | ||
) | [static] |
Definition at line 1988 of file DeclCXX.cpp.
References AttributeLangSupport::C.
NamespaceDecl* clang::NamespaceDecl::getAnonymousNamespace | ( | ) | const [inline] |
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().
const NamespaceDecl* clang::NamespaceDecl::getCanonicalDecl | ( | ) | const [inline] |
Reimplemented from clang::Decl.
Definition at line 457 of file Decl.h.
References getOriginalNamespace().
SourceLocation clang::NamespaceDecl::getLocStart | ( | ) | const [inline] |
Reimplemented from clang::Decl.
Definition at line 465 of file Decl.h.
Referenced by clang::ASTDeclWriter::VisitNamespaceDecl(), and clang::ASTNodeImporter::VisitNamespaceDecl().
NamespaceDecl* clang::NamespaceDecl::getOriginalNamespace | ( | ) | [inline] |
Get the original (first) namespace declaration.
Definition at line 423 of file Decl.h.
References clang::Redeclarable< NamespaceDecl >::isFirstDecl().
Referenced by getAnonymousNamespace(), getCanonicalDecl(), clang::ASTContext::getCanonicalNestedNameSpecifier(), isStd(), setAnonymousNamespace(), and clang::ASTDeclWriter::VisitNamespaceDecl().
const NamespaceDecl* clang::NamespaceDecl::getOriginalNamespace | ( | ) | const [inline] |
Get the original (first) namespace declaration.
Definition at line 431 of file Decl.h.
References clang::Redeclarable< NamespaceDecl >::isFirstDecl().
SourceLocation clang::NamespaceDecl::getRBraceLoc | ( | ) | const [inline] |
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.
bool clang::NamespaceDecl::isAnonymousNamespace | ( | ) | const [inline] |
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().
bool clang::NamespaceDecl::isInline | ( | ) | const [inline] |
Returns true if this is an inline namespace declaration.
Definition at line 413 of file Decl.h.
Referenced by clang::Sema::ActOnStartNamespaceDef(), DiagnoseNamespaceInlineMismatch(), clang::DeclContext::InEnclosingNamespaceSetOf(), isSameEntity(), clang::DeclContext::isStdNamespace(), clang::ASTDeclWriter::VisitNamespaceDecl(), and clang::ASTNodeImporter::VisitNamespaceDecl().
bool clang::NamespaceDecl::isOriginalNamespace | ( | ) | const [inline] |
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::setAnonymousNamespace | ( | NamespaceDecl * | D | ) | [inline] |
Definition at line 449 of file Decl.h.
References getOriginalNamespace().
Referenced by clang::ASTDeclReader::UpdateDecl(), and clang::ASTDeclReader::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().
void clang::NamespaceDecl::setLocStart | ( | SourceLocation | L | ) | [inline] |
void clang::NamespaceDecl::setRBraceLoc | ( | SourceLocation | L | ) | [inline] |
Definition at line 468 of file Decl.h.
Referenced by clang::Sema::ActOnFinishNamespaceDef().
friend class ASTDeclReader [friend] |
Reimplemented from clang::DeclContext.
friend class ASTDeclWriter [friend] |
Reimplemented from clang::Redeclarable< NamespaceDecl >.