class LabelDecl

Declaration

class LabelDecl : public NamedDecl { /* full declaration omitted */ };

Description

Represents the declaration of a label. Labels also have a corresponding LabelStmt, which indicates the position that the label was defined at. For normal labels, the location of the decl is the same as the location of the statement. For GNU local labels (__label__), the decl location is where the __label__ is.

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

Inherits from: NamedDecl

Member Variables

private clang::LabelStmt* TheStmt
private llvm::StringRef MSAsmName
private bool MSAsmNameResolved = false
private clang::SourceLocation LocStart
For normal labels, this is the same as the main declaration label, i.e., the location of the identifier; for GNU local labels, this is the location of the __label__ keyword.

Inherited from Decl:

protected NextInContextAndBits
protected Access
protected FromASTFile
protected IdentifierNamespace
protected CacheValidAndLinkage

Method Overview

  • public static clang::LabelDecl * Create(clang::ASTContext & C, clang::DeclContext * DC, clang::SourceLocation IdentL, clang::IdentifierInfo * II)
  • public static clang::LabelDecl * Create(clang::ASTContext & C, clang::DeclContext * DC, clang::SourceLocation IdentL, clang::IdentifierInfo * II, clang::SourceLocation GnuLabelL)
  • public static clang::LabelDecl * CreateDeserialized(clang::ASTContext & C, unsigned int ID)
  • private LabelDecl(clang::DeclContext * DC, clang::SourceLocation IdentL, clang::IdentifierInfo * II, clang::LabelStmt * S, clang::SourceLocation StartL)
  • private void anchor()
  • public static bool classof(const clang::Decl * D)
  • public static bool classofKind(clang::Decl::Kind K)
  • public llvm::StringRef getMSAsmLabel() const
  • public clang::SourceRange getSourceRange() const
  • public clang::LabelStmt * getStmt() const
  • public bool isGnuLocal() const
  • public bool isMSAsmLabel() const
  • public bool isResolvedMSAsmLabel() const
  • public void setLocStart(clang::SourceLocation L)
  • public void setMSAsmLabel(llvm::StringRef Name)
  • public void setMSAsmLabelResolved()
  • public void setStmt(clang::LabelStmt * T)

Inherited from NamedDecl:

Inherited from Decl:

Methods

static clang::LabelDecl* Create(
    clang::ASTContext& C,
    clang::DeclContext* DC,
    clang::SourceLocation IdentL,
    clang::IdentifierInfo* II)

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

Parameters

clang::ASTContext& C
clang::DeclContext* DC
clang::SourceLocation IdentL
clang::IdentifierInfo* II

static clang::LabelDecl* Create(
    clang::ASTContext& C,
    clang::DeclContext* DC,
    clang::SourceLocation IdentL,
    clang::IdentifierInfo* II,
    clang::SourceLocation GnuLabelL)

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

Parameters

clang::ASTContext& C
clang::DeclContext* DC
clang::SourceLocation IdentL
clang::IdentifierInfo* II
clang::SourceLocation GnuLabelL

static clang::LabelDecl* CreateDeserialized(
    clang::ASTContext& C,
    unsigned int ID)

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

Parameters

clang::ASTContext& C
unsigned int ID

LabelDecl(clang::DeclContext* DC,
          clang::SourceLocation IdentL,
          clang::IdentifierInfo* II,
          clang::LabelStmt* S,
          clang::SourceLocation StartL)

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

Parameters

clang::DeclContext* DC
clang::SourceLocation IdentL
clang::IdentifierInfo* II
clang::LabelStmt* S
clang::SourceLocation StartL

void anchor()

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

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

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

Parameters

const clang::Decl* D

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

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

Parameters

clang::Decl::Kind K

llvm::StringRef getMSAsmLabel() const

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

clang::SourceRange getSourceRange() const

Description

Source range that this declaration covers.

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

clang::LabelStmt* getStmt() const

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

bool isGnuLocal() const

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

bool isMSAsmLabel() const

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

bool isResolvedMSAsmLabel() const

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

void setLocStart(clang::SourceLocation L)

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

Parameters

clang::SourceLocation L

void setMSAsmLabel(llvm::StringRef Name)

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

Parameters

llvm::StringRef Name

void setMSAsmLabelResolved()

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

void setStmt(clang::LabelStmt* T)

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

Parameters

clang::LabelStmt* T