class TranslationUnitDecl

Declaration

class TranslationUnitDecl : public Decl,
                            public DeclContext,
                            public Redeclarable { /* full declaration omitted */ };

Description

The top declaration context.

Declared at: clang/include/clang/AST/Decl.h:80

Inherits from: Decl, DeclContext, Redeclarable

Member Variables

private clang::ASTContext& Ctx
private clang::NamespaceDecl* AnonymousNamespace = nullptr
The (most recently entered) anonymous namespace for this translation unit, if one has been created.

Inherited from DeclContext:

protected
protected FirstDecl = nullptr
protected LastDecl = nullptr

Inherited from Decl:

protected NextInContextAndBits
protected Access
protected FromASTFile
protected IdentifierNamespace
protected CacheValidAndLinkage

Method Overview

Inherited from DeclContext:

Inherited from Decl:

Methods

static clang::TranslationUnitDecl* Create(
    clang::ASTContext& C)

Declared at: clang/include/clang/AST/Decl.h:123

Parameters

clang::ASTContext& C

TranslationUnitDecl(clang::ASTContext& ctx)

Declared at: clang/include/clang/AST/Decl.h:103

Parameters

clang::ASTContext& ctx

virtual void anchor()

Declared at: clang/include/clang/AST/Decl.h:105

static clang::TranslationUnitDecl*
castFromDeclContext(const clang::DeclContext* DC)

Declared at: clang/include/clang/AST/Decl.h:131

Parameters

const clang::DeclContext* DC

static clang::DeclContext* castToDeclContext(
    const clang::TranslationUnitDecl* D)

Declared at: clang/include/clang/AST/Decl.h:128

Parameters

const clang::TranslationUnitDecl* D

static bool classof(const clang::Decl* D)

Declared at: clang/include/clang/AST/Decl.h:126

Parameters

const clang::Decl* D

static bool classofKind(clang::Decl::Kind K)

Declared at: clang/include/clang/AST/Decl.h:127

Parameters

clang::Decl::Kind K

clang::ASTContext& getASTContext() const

Declared at: clang/include/clang/AST/Decl.h:118

clang::NamespaceDecl* getAnonymousNamespace()
    const

Declared at: clang/include/clang/AST/Decl.h:120

clang::TranslationUnitDecl*
getMostRecentDeclImpl()

Description

Implementation of getMostRecentDecl(), to be overridden by any subclass that has a redeclaration chain.

Declared at: clang/include/clang/AST/Decl.h:93

clang::TranslationUnitDecl*
getNextRedeclarationImpl()

Description

Returns the next redeclaration or itself if this is the only decl. Decl subclasses that can be redeclared should override this method so that Decl::redecl_iterator can iterate over them.

Declared at: clang/include/clang/AST/Decl.h:85

clang::TranslationUnitDecl* getPreviousDeclImpl()

Description

Implementation of getPreviousDecl(), to be overridden by any subclass that has a redeclaration chain.

Declared at: clang/include/clang/AST/Decl.h:89

void setAnonymousNamespace(
    clang::NamespaceDecl* D)

Declared at: clang/include/clang/AST/Decl.h:121

Parameters

clang::NamespaceDecl* D