clang API Documentation
Represents a linkage specification. More...
#include <DeclCXX.h>


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 LinkageSpecDecl * | Create (ASTContext &C, DeclContext *DC, SourceLocation ExternLoc, SourceLocation LangLoc, LanguageIDs Lang, bool HasBraces) |
| static LinkageSpecDecl * | CreateDeserialized (ASTContext &C, unsigned ID) |
| static bool | classof (const Decl *D) |
| static bool | classofKind (Kind K) |
| static DeclContext * | castToDeclContext (const LinkageSpecDecl *D) |
| static LinkageSpecDecl * | castFromDeclContext (const DeclContext *DC) |
Represents a linkage specification.
For example:
extern "C" void foo();
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.
| static LinkageSpecDecl* clang::LinkageSpecDecl::castFromDeclContext | ( | const DeclContext * | DC | ) | [inline, static] |
Reimplemented from clang::Decl.
| static DeclContext* clang::LinkageSpecDecl::castToDeclContext | ( | const LinkageSpecDecl * | D | ) | [inline, static] |
| 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] |
| LinkageSpecDecl * LinkageSpecDecl::Create | ( | ASTContext & | C, |
| DeclContext * | DC, | ||
| SourceLocation | ExternLoc, | ||
| SourceLocation | LangLoc, | ||
| LanguageIDs | Lang, | ||
| bool | HasBraces | ||
| ) | [static] |
Definition at line 1923 of file DeclCXX.cpp.
References AttributeLangSupport::C.
Referenced by clang::Sema::ActOnStartLinkageSpecification(), and clang::Sema::LazilyCreateBuiltin().
| LinkageSpecDecl * LinkageSpecDecl::CreateDeserialized | ( | ASTContext & | C, |
| unsigned | ID | ||
| ) | [static] |
Definition at line 1932 of file DeclCXX.cpp.
References AttributeLangSupport::C, and lang_c.
| SourceLocation clang::LinkageSpecDecl::getExternLoc | ( | ) | const [inline] |
Definition at line 2511 of file DeclCXX.h.
Referenced by clang::ASTDeclWriter::VisitLinkageSpecDecl().
| LanguageIDs clang::LinkageSpecDecl::getLanguage | ( | ) | const [inline] |
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().
| SourceLocation clang::LinkageSpecDecl::getLocEnd | ( | ) | const [inline] |
Reimplemented from clang::Decl.
Definition at line 2519 of file DeclCXX.h.
References clang::DeclContext::decls_begin(), clang::DeclContext::decls_empty(), clang::Decl::getLocation(), clang::Decl::getLocEnd(), getRBraceLoc(), and hasBraces().
Referenced by getSourceRange().
| SourceLocation clang::LinkageSpecDecl::getRBraceLoc | ( | ) | const [inline] |
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().
| bool clang::LinkageSpecDecl::hasBraces | ( | ) | const [inline] |
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().
| void clang::LinkageSpecDecl::setExternLoc | ( | SourceLocation | L | ) | [inline] |
Definition at line 2513 of file DeclCXX.h.
Referenced by clang::ASTDeclReader::VisitLinkageSpecDecl().
| void clang::LinkageSpecDecl::setLanguage | ( | LanguageIDs | L | ) | [inline] |
Set the language specified by this linkage specification.
Definition at line 2502 of file DeclCXX.h.
Referenced by clang::ASTDeclReader::VisitLinkageSpecDecl().
| void clang::LinkageSpecDecl::setRBraceLoc | ( | SourceLocation | L | ) | [inline] |
Definition at line 2514 of file DeclCXX.h.
References clang::SourceLocation::isValid().
Referenced by clang::Sema::ActOnFinishLinkageSpecification(), and clang::ASTDeclReader::VisitLinkageSpecDecl().