clang API Documentation

Public Types | Public Member Functions | Static Public Member Functions
clang::LinkageSpecDecl Class Reference

Represents a linkage specification. More...

#include <DeclCXX.h>

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

List of all members.

Public Types

enum  LanguageIDs { lang_c = 0x0002, lang_cxx = 0x0004 }
 Represents the language in a linkage specification. More...

Public Member Functions

LanguageIDs getLanguage () const
 Return the language specified by this linkage specification.
void setLanguage (LanguageIDs L)
 Set the language specified by this linkage specification.
bool hasBraces () const
 Determines whether this linkage specification had braces in its syntactic form.
SourceLocation getExternLoc () const
SourceLocation getRBraceLoc () const
void setExternLoc (SourceLocation L)
void setRBraceLoc (SourceLocation L)
SourceLocation getLocEnd () const LLVM_READONLY
SourceRange getSourceRange () const override LLVM_READONLY
 Source range that this declaration covers.

Static Public Member Functions

static LinkageSpecDeclCreate (ASTContext &C, DeclContext *DC, SourceLocation ExternLoc, SourceLocation LangLoc, LanguageIDs Lang, bool HasBraces)
static LinkageSpecDeclCreateDeserialized (ASTContext &C, unsigned ID)
static bool classof (const Decl *D)
static bool classofKind (Kind K)
static DeclContextcastToDeclContext (const LinkageSpecDecl *D)
static LinkageSpecDeclcastFromDeclContext (const DeclContext *DC)

Detailed Description

Represents a linkage specification.

For example:

   extern "C" void foo();

Definition at line 2459 of file DeclCXX.h.


Member Enumeration Documentation

Represents the language in a linkage specification.

The values are part of the serialization ABI for ASTs and cannot be changed without altering that ABI. To help ensure a stable ABI for this, we choose the DW_LANG_ encodings from the dwarf standard.

Enumerator:
lang_c 
lang_cxx 

Definition at line 2468 of file DeclCXX.h.


Member Function Documentation

Reimplemented from clang::Decl.

Definition at line 2536 of file DeclCXX.h.

Definition at line 2533 of file DeclCXX.h.

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

Reimplemented from clang::DeclContext.

Definition at line 2531 of file DeclCXX.h.

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

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

Reimplemented from clang::Decl.

Definition at line 2532 of file DeclCXX.h.

Referenced by classof().

LinkageSpecDecl * LinkageSpecDecl::Create ( ASTContext C,
DeclContext DC,
SourceLocation  ExternLoc,
SourceLocation  LangLoc,
LanguageIDs  Lang,
bool  HasBraces 
) [static]

Definition at line 1932 of file DeclCXX.cpp.

References AttributeLangSupport::C, and lang_c.

Definition at line 2511 of file DeclCXX.h.

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

Return the language specified by this linkage specification.

Definition at line 2500 of file DeclCXX.h.

Referenced by clang::FunctionDecl::getBuiltinID(), and clang::ASTDeclWriter::VisitLinkageSpecDecl().

Definition at line 2512 of file DeclCXX.h.

Referenced by getLocEnd(), and clang::ASTDeclWriter::VisitLinkageSpecDecl().

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

Source range that this declaration covers.

Reimplemented from clang::Decl.

Definition at line 2527 of file DeclCXX.h.

References getLocEnd().

Determines whether this linkage specification had braces in its syntactic form.

Definition at line 2506 of file DeclCXX.h.

References clang::SourceLocation::isValid().

Referenced by getLocEnd().

Definition at line 2513 of file DeclCXX.h.

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

Set the language specified by this linkage specification.

Definition at line 2502 of file DeclCXX.h.

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


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