clang  3.9.0
Public Member Functions | Static Public Member Functions | Friends | List of all members
clang::UsingDirectiveDecl Class Reference

Represents C++ using-directive. More...

#include <DeclCXX.h>

Inheritance diagram for clang::UsingDirectiveDecl:
[legend]
Collaboration diagram for clang::UsingDirectiveDecl:
[legend]

Public Member Functions

NestedNameSpecifierLoc getQualifierLoc () const
 Retrieve the nested-name-specifier that qualifies the name of the namespace, with source-location information. More...
 
NestedNameSpecifiergetQualifier () const
 Retrieve the nested-name-specifier that qualifies the name of the namespace. More...
 
NamedDeclgetNominatedNamespaceAsWritten ()
 
const NamedDeclgetNominatedNamespaceAsWritten () const
 
NamespaceDeclgetNominatedNamespace ()
 Returns the namespace nominated by this using-directive. More...
 
const NamespaceDeclgetNominatedNamespace () const
 
DeclContextgetCommonAncestor ()
 Returns the common ancestor context of this using-directive and its nominated namespace. More...
 
const DeclContextgetCommonAncestor () const
 
SourceLocation getUsingLoc () const
 Return the location of the using keyword. More...
 
SourceLocation getNamespaceKeyLocation () const
 Returns the location of the namespace keyword. More...
 
SourceLocation getIdentLocation () const
 Returns the location of this using declaration's identifier. More...
 
SourceRange getSourceRange () const override LLVM_READONLY
 
- Public Member Functions inherited from clang::NamedDecl
IdentifierInfogetIdentifier () const
 getIdentifier - Get the identifier that names this declaration, if there is one. More...
 
StringRef getName () const
 getName - Get the name of identifier for this declaration as a StringRef. More...
 
std::string getNameAsString () const
 getNameAsString - Get a human-readable name for the declaration, even if it is one of the special kinds of names (C++ constructor, Objective-C selector, etc). More...
 
void printName (raw_ostream &os) const
 
DeclarationName getDeclName () const
 getDeclName - Get the actual, stored name of the declaration, which may be a special name. More...
 
void setDeclName (DeclarationName N)
 Set the name of this declaration. More...
 
void printQualifiedName (raw_ostream &OS) const
 printQualifiedName - Returns human-readable qualified name for declaration, like A::B::i, for i being member of namespace A::B. More...
 
void printQualifiedName (raw_ostream &OS, const PrintingPolicy &Policy) const
 
std::string getQualifiedNameAsString () const
 
virtual void getNameForDiagnostic (raw_ostream &OS, const PrintingPolicy &Policy, bool Qualified) const
 getNameForDiagnostic - Appends a human-readable name for this declaration into the given stream. More...
 
bool declarationReplaces (NamedDecl *OldD, bool IsKnownNewer=true) const
 Determine whether this declaration, if known to be well-formed within its context, will replace the declaration OldD if introduced into scope. More...
 
bool hasLinkage () const
 Determine whether this declaration has linkage. More...
 
bool isHidden () const
 Determine whether this declaration is hidden from name lookup. More...
 
void setHidden (bool Hide)
 Set whether this declaration is hidden from name lookup. More...
 
bool isCXXClassMember () const
 Determine whether this declaration is a C++ class member. More...
 
bool isCXXInstanceMember () const
 Determine whether the given declaration is an instance member of a C++ class. More...
 
Linkage getLinkageInternal () const
 Determine what kind of linkage this entity has. More...
 
Linkage getFormalLinkage () const
 Get the linkage from a semantic point of view. More...
 
bool hasExternalFormalLinkage () const
 True if this decl has external linkage. More...
 
bool isExternallyVisible () const
 
Visibility getVisibility () const
 Determines the visibility of this entity. More...
 
LinkageInfo getLinkageAndVisibility () const
 Determines the linkage and visibility of this entity. More...
 
Optional< VisibilitygetExplicitVisibility (ExplicitVisibilityKind kind) const
 If visibility was explicitly specified for this declaration, return that visibility. More...
 
bool isLinkageValid () const
 True if the computed linkage is valid. More...
 
bool hasLinkageBeenComputed () const
 True if something has required us to compute the linkage of this declaration. More...
 
NamedDeclgetUnderlyingDecl ()
 Looks through UsingDecls and ObjCCompatibleAliasDecls for the underlying named decl. More...
 
const NamedDeclgetUnderlyingDecl () const
 
NamedDeclgetMostRecentDecl ()
 
const NamedDeclgetMostRecentDecl () const
 
ObjCStringFormatFamily getObjCFStringFormattingFamily () const
 

Static Public Member Functions

static UsingDirectiveDeclCreate (ASTContext &C, DeclContext *DC, SourceLocation UsingLoc, SourceLocation NamespaceLoc, NestedNameSpecifierLoc QualifierLoc, SourceLocation IdentLoc, NamedDecl *Nominated, DeclContext *CommonAncestor)
 
static UsingDirectiveDeclCreateDeserialized (ASTContext &C, unsigned ID)
 
static bool classof (const Decl *D)
 
static bool classofKind (Kind K)
 
- Static Public Member Functions inherited from clang::NamedDecl
static bool classof (const Decl *D)
 
static bool classofKind (Kind K)
 

Friends

class DeclContext
 
class ASTDeclReader
 

Additional Inherited Members

- Public Types inherited from clang::NamedDecl
enum  ExplicitVisibilityKind { VisibilityForType, VisibilityForValue }
 Kinds of explicit visibility. More...
 
- Protected Member Functions inherited from clang::NamedDecl
 NamedDecl (Kind DK, DeclContext *DC, SourceLocation L, DeclarationName N)
 

Detailed Description

Represents C++ using-directive.

For example:

using namespace std;
Note
UsingDirectiveDecl should be Decl not NamedDecl, but we provide artificial names for all using-directives in order to store them in DeclContext effectively.

Definition at line 2615 of file DeclCXX.h.

Member Function Documentation

static bool clang::UsingDirectiveDecl::classof ( const Decl D)
inlinestatic

Definition at line 2702 of file DeclCXX.h.

References classofKind().

static bool clang::UsingDirectiveDecl::classofKind ( Kind  K)
inlinestatic

Definition at line 2703 of file DeclCXX.h.

Referenced by classof().

UsingDirectiveDecl * UsingDirectiveDecl::Create ( ASTContext C,
DeclContext DC,
SourceLocation  UsingLoc,
SourceLocation  NamespaceLoc,
NestedNameSpecifierLoc  QualifierLoc,
SourceLocation  IdentLoc,
NamedDecl Nominated,
DeclContext CommonAncestor 
)
static
UsingDirectiveDecl * UsingDirectiveDecl::CreateDeserialized ( ASTContext C,
unsigned  ID 
)
static

Definition at line 2055 of file DeclCXX.cpp.

References AttributeLangSupport::C, and ID.

DeclContext* clang::UsingDirectiveDecl::getCommonAncestor ( )
inline

Returns the common ancestor context of this using-directive and its nominated namespace.

Definition at line 2676 of file DeclCXX.h.

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

const DeclContext* clang::UsingDirectiveDecl::getCommonAncestor ( ) const
inline

Definition at line 2677 of file DeclCXX.h.

SourceLocation clang::UsingDirectiveDecl::getIdentLocation ( ) const
inline

Returns the location of this using declaration's identifier.

Definition at line 2687 of file DeclCXX.h.

SourceLocation clang::UsingDirectiveDecl::getNamespaceKeyLocation ( ) const
inline

Returns the location of the namespace keyword.

Definition at line 2684 of file DeclCXX.h.

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

NamespaceDecl * UsingDirectiveDecl::getNominatedNamespace ( )

Returns the namespace nominated by this using-directive.

Definition at line 2063 of file DeclCXX.cpp.

Referenced by clang::CodeGen::CGDebugInfo::EmitUsingDirective(), getNominatedNamespace(), and clang::ASTDeclWriter::VisitUsingDirectiveDecl().

const NamespaceDecl* clang::UsingDirectiveDecl::getNominatedNamespace ( ) const
inline

Definition at line 2670 of file DeclCXX.h.

References getNominatedNamespace().

NamedDecl* clang::UsingDirectiveDecl::getNominatedNamespaceAsWritten ( )
inline

Definition at line 2662 of file DeclCXX.h.

const NamedDecl* clang::UsingDirectiveDecl::getNominatedNamespaceAsWritten ( ) const
inline

Definition at line 2663 of file DeclCXX.h.

NestedNameSpecifier* clang::UsingDirectiveDecl::getQualifier ( ) const
inline

Retrieve the nested-name-specifier that qualifies the name of the namespace.

Definition at line 2658 of file DeclCXX.h.

References clang::NestedNameSpecifierLoc::getNestedNameSpecifier().

NestedNameSpecifierLoc clang::UsingDirectiveDecl::getQualifierLoc ( ) const
inline

Retrieve the nested-name-specifier that qualifies the name of the namespace, with source-location information.

Definition at line 2654 of file DeclCXX.h.

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

SourceRange clang::UsingDirectiveDecl::getSourceRange ( ) const
inlineoverride

Definition at line 2698 of file DeclCXX.h.

SourceLocation clang::UsingDirectiveDecl::getUsingLoc ( ) const
inline

Return the location of the using keyword.

Definition at line 2680 of file DeclCXX.h.

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

Friends And Related Function Documentation

friend class ASTDeclReader
friend

Definition at line 2708 of file DeclCXX.h.

friend class DeclContext
friend

Definition at line 2706 of file DeclCXX.h.


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