class Sema

Declaration

class Sema { /* full declaration omitted */ };

Declared at: clang/include/clang/AST/CommentSema.h:32

Member Variables

private llvm::BumpPtrAllocator& Allocator
Allocator for AST nodes.
private const clang::SourceManager& SourceMgr
Source manager for the comment being parsed.
private clang::DiagnosticsEngine& Diags
private clang::comments::CommandTraits& Traits
private const clang::Preprocessor* PP
private clang::comments::DeclInfo* ThisDeclInfo
Information about the declaration this comment is attached to.
private llvm::StringMap<TParamCommandComment*> TemplateParameterDocs
Contains a valid value if \c DeclInfo->IsFilled is true.
private const clang::comments::BlockCommandComment* BriefCommand
AST node for the \commandand its aliases.
private const clang::comments::BlockCommandComment* HeaderfileCommand
AST node for the \ headerfile command.
private SmallVector<clang::comments::HTMLStartTagComment*, 8> HTMLOpenTags
A stack of HTML tags that are currently open (not matched with closing tags).

Method Overview

  • private clang::DiagnosticBuilder Diag(clang::SourceLocation Loc, unsigned int DiagID)
  • public Sema(llvm::BumpPtrAllocator & Allocator, const clang::SourceManager & SourceMgr, clang::DiagnosticsEngine & Diags, clang::comments::CommandTraits & Traits, const clang::Preprocessor * PP)
  • private Sema(const clang::comments::Sema &)
  • public void actOnBlockCommandArgs(clang::comments::BlockCommandComment * Command, ArrayRef<BlockCommandComment::Argument> Args)
  • public void actOnBlockCommandFinish(clang::comments::BlockCommandComment * Command, clang::comments::ParagraphComment * Paragraph)
  • public clang::comments::BlockCommandComment * actOnBlockCommandStart(clang::SourceLocation LocBegin, clang::SourceLocation LocEnd, unsigned int CommandID, clang::comments::CommandMarkerKind CommandMarker)
  • public clang::comments::FullComment * actOnFullComment(ArrayRef<clang::comments::BlockContentComment *> Blocks)
  • public clang::comments::HTMLEndTagComment * actOnHTMLEndTag(clang::SourceLocation LocBegin, clang::SourceLocation LocEnd, llvm::StringRef TagName)
  • public void actOnHTMLStartTagFinish(clang::comments::HTMLStartTagComment * Tag, ArrayRef<HTMLStartTagComment::Attribute> Attrs, clang::SourceLocation GreaterLoc, bool IsSelfClosing)
  • public clang::comments::HTMLStartTagComment * actOnHTMLStartTagStart(clang::SourceLocation LocBegin, llvm::StringRef TagName)
  • public clang::comments::InlineCommandComment * actOnInlineCommand(clang::SourceLocation CommandLocBegin, clang::SourceLocation CommandLocEnd, unsigned int CommandID, ArrayRef<Comment::Argument> Args)
  • public clang::comments::ParagraphComment * actOnParagraphComment(ArrayRef<clang::comments::InlineContentComment *> Content)
  • public void actOnParamCommandDirectionArg(clang::comments::ParamCommandComment * Command, clang::SourceLocation ArgLocBegin, clang::SourceLocation ArgLocEnd, llvm::StringRef Arg)
  • public void actOnParamCommandFinish(clang::comments::ParamCommandComment * Command, clang::comments::ParagraphComment * Paragraph)
  • public void actOnParamCommandParamNameArg(clang::comments::ParamCommandComment * Command, clang::SourceLocation ArgLocBegin, clang::SourceLocation ArgLocEnd, llvm::StringRef Arg)
  • public clang::comments::ParamCommandComment * actOnParamCommandStart(clang::SourceLocation LocBegin, clang::SourceLocation LocEnd, unsigned int CommandID, clang::comments::CommandMarkerKind CommandMarker)
  • public void actOnTParamCommandFinish(clang::comments::TParamCommandComment * Command, clang::comments::ParagraphComment * Paragraph)
  • public void actOnTParamCommandParamNameArg(clang::comments::TParamCommandComment * Command, clang::SourceLocation ArgLocBegin, clang::SourceLocation ArgLocEnd, llvm::StringRef Arg)
  • public clang::comments::TParamCommandComment * actOnTParamCommandStart(clang::SourceLocation LocBegin, clang::SourceLocation LocEnd, unsigned int CommandID, clang::comments::CommandMarkerKind CommandMarker)
  • public clang::comments::TextComment * actOnText(clang::SourceLocation LocBegin, clang::SourceLocation LocEnd, llvm::StringRef Text)
  • public clang::comments::InlineContentComment * actOnUnknownCommand(clang::SourceLocation LocBegin, clang::SourceLocation LocEnd, unsigned int CommandID)
  • public clang::comments::InlineContentComment * actOnUnknownCommand(clang::SourceLocation LocBegin, clang::SourceLocation LocEnd, llvm::StringRef CommandName)
  • public void actOnVerbatimBlockFinish(clang::comments::VerbatimBlockComment * Block, clang::SourceLocation CloseNameLocBegin, llvm::StringRef CloseName, ArrayRef<clang::comments::VerbatimBlockLineComment *> Lines)
  • public clang::comments::VerbatimBlockLineComment * actOnVerbatimBlockLine(clang::SourceLocation Loc, llvm::StringRef Text)
  • public clang::comments::VerbatimBlockComment * actOnVerbatimBlockStart(clang::SourceLocation Loc, unsigned int CommandID)
  • public clang::comments::VerbatimLineComment * actOnVerbatimLine(clang::SourceLocation LocBegin, unsigned int CommandID, clang::SourceLocation TextBegin, llvm::StringRef Text)
  • private void checkBlockCommandDuplicate(const clang::comments::BlockCommandComment * Command)
  • private void checkBlockCommandEmptyParagraph(clang::comments::BlockCommandComment * Command)
  • private void checkContainerDecl(const clang::comments::BlockCommandComment * Comment)
  • private void checkContainerDeclVerbatimLine(const clang::comments::BlockCommandComment * Comment)
  • private void checkDeprecatedCommand(const clang::comments::BlockCommandComment * Comment)
  • private void checkFunctionDeclVerbatimLine(const clang::comments::BlockCommandComment * Comment)
  • private void checkReturnsCommand(const clang::comments::BlockCommandComment * Command)
  • public template <typename T>ArrayRef<T> copyArray(ArrayRef<T> Source)
  • private unsigned int correctTypoInParmVarReference(llvm::StringRef Typo, ArrayRef<const clang::ParmVarDecl *> ParamVars)
  • private llvm::StringRef correctTypoInTParamReference(llvm::StringRef Typo, const clang::TemplateParameterList * TemplateParameters)
  • private InlineCommandComment::RenderKind getInlineCommandRenderKind(llvm::StringRef Name) const
  • private ArrayRef<const clang::ParmVarDecl *> getParamVars()
  • private void inspectThisDecl()
  • private bool involvesFunctionType()
  • private bool isAnyFunctionDecl()
  • private bool isClassOrStructDecl()
  • private bool isClassOrStructOrTagTypedefDecl()
  • private bool isClassTemplateDecl()
  • private bool isFunctionDecl()
  • private bool isFunctionOrMethodVariadic()
  • private bool isFunctionPointerVarDecl()
  • private bool isFunctionTemplateDecl()
  • private bool isObjCInterfaceDecl()
  • private bool isObjCMethodDecl()
  • private bool isObjCPropertyDecl()
  • private bool isObjCProtocolDecl()
  • private bool isRecordLikeDecl()
  • private bool isTemplateOrSpecialization()
  • private bool isUnionDecl()
  • private void resolveParamCommandIndexes(const clang::comments::FullComment * FC)
  • private unsigned int resolveParmVarReference(llvm::StringRef Name, ArrayRef<const clang::ParmVarDecl *> ParamVars)
  • private bool resolveTParamReference(llvm::StringRef Name, const clang::TemplateParameterList * TemplateParameters, SmallVectorImpl<unsigned int> * Position)
  • public void setDecl(const clang::Decl * D)

Methods

clang::DiagnosticBuilder Diag(
    clang::SourceLocation Loc,
    unsigned int DiagID)

Declared at: clang/include/clang/AST/CommentSema.h:63

Parameters

clang::SourceLocation Loc
unsigned int DiagID

Sema(llvm::BumpPtrAllocator& Allocator,
     const clang::SourceManager& SourceMgr,
     clang::DiagnosticsEngine& Diags,
     clang::comments::CommandTraits& Traits,
     const clang::Preprocessor* PP)

Declared at: clang/include/clang/AST/CommentSema.h:72

Parameters

llvm::BumpPtrAllocator& Allocator
const clang::SourceManager& SourceMgr
clang::DiagnosticsEngine& Diags
clang::comments::CommandTraits& Traits
const clang::Preprocessor* PP

Sema(const clang::comments::Sema&)

Declared at: clang/include/clang/AST/CommentSema.h:33

Parameters

const clang::comments::Sema&

void actOnBlockCommandArgs(
    clang::comments::BlockCommandComment* Command,
    ArrayRef<BlockCommandComment::Argument> Args)

Declared at: clang/include/clang/AST/CommentSema.h:94

Parameters

clang::comments::BlockCommandComment* Command
ArrayRef<BlockCommandComment::Argument> Args

void actOnBlockCommandFinish(
    clang::comments::BlockCommandComment* Command,
    clang::comments::ParagraphComment* Paragraph)

Declared at: clang/include/clang/AST/CommentSema.h:97

Parameters

clang::comments::BlockCommandComment* Command
clang::comments::ParagraphComment* Paragraph

clang::comments::BlockCommandComment*
actOnBlockCommandStart(
    clang::SourceLocation LocBegin,
    clang::SourceLocation LocEnd,
    unsigned int CommandID,
    clang::comments::CommandMarkerKind
        CommandMarker)

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

Parameters

clang::SourceLocation LocBegin
clang::SourceLocation LocEnd
unsigned int CommandID
clang::comments::CommandMarkerKind CommandMarker

clang::comments::FullComment* actOnFullComment(
    ArrayRef<
        clang::comments::BlockContentComment*>
        Blocks)

Declared at: clang/include/clang/AST/CommentSema.h:176

Parameters

ArrayRef<clang::comments::BlockContentComment*> Blocks

clang::comments::HTMLEndTagComment*
actOnHTMLEndTag(clang::SourceLocation LocBegin,
                clang::SourceLocation LocEnd,
                llvm::StringRef TagName)

Declared at: clang/include/clang/AST/CommentSema.h:172

Parameters

clang::SourceLocation LocBegin
clang::SourceLocation LocEnd
llvm::StringRef TagName

void actOnHTMLStartTagFinish(
    clang::comments::HTMLStartTagComment* Tag,
    ArrayRef<HTMLStartTagComment::Attribute>
        Attrs,
    clang::SourceLocation GreaterLoc,
    bool IsSelfClosing)

Declared at: clang/include/clang/AST/CommentSema.h:167

Parameters

clang::comments::HTMLStartTagComment* Tag
ArrayRef<HTMLStartTagComment::Attribute> Attrs
clang::SourceLocation GreaterLoc
bool IsSelfClosing

clang::comments::HTMLStartTagComment*
actOnHTMLStartTagStart(
    clang::SourceLocation LocBegin,
    llvm::StringRef TagName)

Declared at: clang/include/clang/AST/CommentSema.h:164

Parameters

clang::SourceLocation LocBegin
llvm::StringRef TagName

clang::comments::InlineCommandComment*
actOnInlineCommand(
    clang::SourceLocation CommandLocBegin,
    clang::SourceLocation CommandLocEnd,
    unsigned int CommandID,
    ArrayRef<Comment::Argument> Args)

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

Parameters

clang::SourceLocation CommandLocBegin
clang::SourceLocation CommandLocEnd
unsigned int CommandID
ArrayRef<Comment::Argument> Args

clang::comments::ParagraphComment*
actOnParagraphComment(
    ArrayRef<
        clang::comments::InlineContentComment*>
        Content)

Declared at: clang/include/clang/AST/CommentSema.h:86

Parameters

ArrayRef<clang::comments::InlineContentComment*> Content

void actOnParamCommandDirectionArg(
    clang::comments::ParamCommandComment* Command,
    clang::SourceLocation ArgLocBegin,
    clang::SourceLocation ArgLocEnd,
    llvm::StringRef Arg)

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

Parameters

clang::comments::ParamCommandComment* Command
clang::SourceLocation ArgLocBegin
clang::SourceLocation ArgLocEnd
llvm::StringRef Arg

void actOnParamCommandFinish(
    clang::comments::ParamCommandComment* Command,
    clang::comments::ParagraphComment* Paragraph)

Declared at: clang/include/clang/AST/CommentSema.h:115

Parameters

clang::comments::ParamCommandComment* Command
clang::comments::ParagraphComment* Paragraph

void actOnParamCommandParamNameArg(
    clang::comments::ParamCommandComment* Command,
    clang::SourceLocation ArgLocBegin,
    clang::SourceLocation ArgLocEnd,
    llvm::StringRef Arg)

Declared at: clang/include/clang/AST/CommentSema.h:110

Parameters

clang::comments::ParamCommandComment* Command
clang::SourceLocation ArgLocBegin
clang::SourceLocation ArgLocEnd
llvm::StringRef Arg

clang::comments::ParamCommandComment*
actOnParamCommandStart(
    clang::SourceLocation LocBegin,
    clang::SourceLocation LocEnd,
    unsigned int CommandID,
    clang::comments::CommandMarkerKind
        CommandMarker)

Declared at: clang/include/clang/AST/CommentSema.h:100

Parameters

clang::SourceLocation LocBegin
clang::SourceLocation LocEnd
unsigned int CommandID
clang::comments::CommandMarkerKind CommandMarker

void actOnTParamCommandFinish(
    clang::comments::TParamCommandComment*
        Command,
    clang::comments::ParagraphComment* Paragraph)

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

Parameters

clang::comments::TParamCommandComment* Command
clang::comments::ParagraphComment* Paragraph

void actOnTParamCommandParamNameArg(
    clang::comments::TParamCommandComment*
        Command,
    clang::SourceLocation ArgLocBegin,
    clang::SourceLocation ArgLocEnd,
    llvm::StringRef Arg)

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

Parameters

clang::comments::TParamCommandComment* Command
clang::SourceLocation ArgLocBegin
clang::SourceLocation ArgLocEnd
llvm::StringRef Arg

clang::comments::TParamCommandComment*
actOnTParamCommandStart(
    clang::SourceLocation LocBegin,
    clang::SourceLocation LocEnd,
    unsigned int CommandID,
    clang::comments::CommandMarkerKind
        CommandMarker)

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

Parameters

clang::SourceLocation LocBegin
clang::SourceLocation LocEnd
unsigned int CommandID
clang::comments::CommandMarkerKind CommandMarker

clang::comments::TextComment* actOnText(
    clang::SourceLocation LocBegin,
    clang::SourceLocation LocEnd,
    llvm::StringRef Text)

Declared at: clang/include/clang/AST/CommentSema.h:144

Parameters

clang::SourceLocation LocBegin
clang::SourceLocation LocEnd
llvm::StringRef Text

clang::comments::InlineContentComment*
actOnUnknownCommand(
    clang::SourceLocation LocBegin,
    clang::SourceLocation LocEnd,
    unsigned int CommandID)

Declared at: clang/include/clang/AST/CommentSema.h:140

Parameters

clang::SourceLocation LocBegin
clang::SourceLocation LocEnd
unsigned int CommandID

clang::comments::InlineContentComment*
actOnUnknownCommand(
    clang::SourceLocation LocBegin,
    clang::SourceLocation LocEnd,
    llvm::StringRef CommandName)

Declared at: clang/include/clang/AST/CommentSema.h:136

Parameters

clang::SourceLocation LocBegin
clang::SourceLocation LocEnd
llvm::StringRef CommandName

void actOnVerbatimBlockFinish(
    clang::comments::VerbatimBlockComment* Block,
    clang::SourceLocation CloseNameLocBegin,
    llvm::StringRef CloseName,
    ArrayRef<clang::comments::
                 VerbatimBlockLineComment*> Lines)

Declared at: clang/include/clang/AST/CommentSema.h:154

Parameters

clang::comments::VerbatimBlockComment* Block
clang::SourceLocation CloseNameLocBegin
llvm::StringRef CloseName
ArrayRef< clang::comments::VerbatimBlockLineComment*> Lines

clang::comments::VerbatimBlockLineComment*
actOnVerbatimBlockLine(clang::SourceLocation Loc,
                       llvm::StringRef Text)

Declared at: clang/include/clang/AST/CommentSema.h:151

Parameters

clang::SourceLocation Loc
llvm::StringRef Text

clang::comments::VerbatimBlockComment*
actOnVerbatimBlockStart(clang::SourceLocation Loc,
                        unsigned int CommandID)

Declared at: clang/include/clang/AST/CommentSema.h:148

Parameters

clang::SourceLocation Loc
unsigned int CommandID

clang::comments::VerbatimLineComment*
actOnVerbatimLine(clang::SourceLocation LocBegin,
                  unsigned int CommandID,
                  clang::SourceLocation TextBegin,
                  llvm::StringRef Text)

Declared at: clang/include/clang/AST/CommentSema.h:159

Parameters

clang::SourceLocation LocBegin
unsigned int CommandID
clang::SourceLocation TextBegin
llvm::StringRef Text

void checkBlockCommandDuplicate(
    const clang::comments::BlockCommandComment*
        Command)

Description

Emit diagnostics about duplicate block commands that should be used only once per comment, e.g., \and\ returns.

Declared at: clang/include/clang/AST/CommentSema.h:185

Parameters

const clang::comments::BlockCommandComment* Command

void checkBlockCommandEmptyParagraph(
    clang::comments::BlockCommandComment* Command)

Declared at: clang/include/clang/AST/CommentSema.h:179

Parameters

clang::comments::BlockCommandComment* Command

void checkContainerDecl(
    const clang::comments::BlockCommandComment*
        Comment)

Declared at: clang/include/clang/AST/CommentSema.h:193

Parameters

const clang::comments::BlockCommandComment* Comment

void checkContainerDeclVerbatimLine(
    const clang::comments::BlockCommandComment*
        Comment)

Declared at: clang/include/clang/AST/CommentSema.h:191

Parameters

const clang::comments::BlockCommandComment* Comment

void checkDeprecatedCommand(
    const clang::comments::BlockCommandComment*
        Comment)

Declared at: clang/include/clang/AST/CommentSema.h:187

Parameters

const clang::comments::BlockCommandComment* Comment

void checkFunctionDeclVerbatimLine(
    const clang::comments::BlockCommandComment*
        Comment)

Declared at: clang/include/clang/AST/CommentSema.h:189

Parameters

const clang::comments::BlockCommandComment* Comment

void checkReturnsCommand(
    const clang::comments::BlockCommandComment*
        Command)

Declared at: clang/include/clang/AST/CommentSema.h:181

Parameters

const clang::comments::BlockCommandComment* Command

template <typename T>
ArrayRef<T> copyArray(ArrayRef<T> Source)

Description

Returns a copy of array, owned by Sema's allocator.

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

Templates

T

Parameters

ArrayRef<T> Source

unsigned int correctTypoInParmVarReference(
    llvm::StringRef Typo,
    ArrayRef<const clang::ParmVarDecl*> ParamVars)

Description

Returns index of a function parameter with the name closest to a given typo.

Declared at: clang/include/clang/AST/CommentSema.h:236

Parameters

llvm::StringRef Typo
ArrayRef<const clang::ParmVarDecl*> ParamVars

llvm::StringRef correctTypoInTParamReference(
    llvm::StringRef Typo,
    const clang::TemplateParameterList*
        TemplateParameters)

Declared at: clang/include/clang/AST/CommentSema.h:243

Parameters

llvm::StringRef Typo
const clang::TemplateParameterList* TemplateParameters

InlineCommandComment::RenderKind
getInlineCommandRenderKind(
    llvm::StringRef Name) const

Declared at: clang/include/clang/AST/CommentSema.h:248

Parameters

llvm::StringRef Name

ArrayRef<const clang::ParmVarDecl*> getParamVars()

Declared at: clang/include/clang/AST/CommentSema.h:224

void inspectThisDecl()

Description

Extract all important semantic information from\c ThisDeclInfo->ThisDecl into \c ThisDeclInfo members.

Declared at: clang/include/clang/AST/CommentSema.h:228

bool involvesFunctionType()

Declared at: clang/include/clang/AST/CommentSema.h:201

Returns

\c true if the declaration that this comment is attached to is a pointer to function/method/block type or has such a type.

bool isAnyFunctionDecl()

Declared at: clang/include/clang/AST/CommentSema.h:204

bool isClassOrStructDecl()

Declared at: clang/include/clang/AST/CommentSema.h:214

bool isClassOrStructOrTagTypedefDecl()

Declared at: clang/include/clang/AST/CommentSema.h:217

Returns

\c true if the declaration that this comment is attached to declares either struct, class or tag typedef.

bool isClassTemplateDecl()

Declared at: clang/include/clang/AST/CommentSema.h:221

bool isFunctionDecl()

Declared at: clang/include/clang/AST/CommentSema.h:203

bool isFunctionOrMethodVariadic()

Declared at: clang/include/clang/AST/CommentSema.h:209

bool isFunctionPointerVarDecl()

Declared at: clang/include/clang/AST/CommentSema.h:208

Returns

\c true if declaration that this comment is attached to declares a function pointer.

bool isFunctionTemplateDecl()

Declared at: clang/include/clang/AST/CommentSema.h:222

bool isObjCInterfaceDecl()

Declared at: clang/include/clang/AST/CommentSema.h:219

bool isObjCMethodDecl()

Declared at: clang/include/clang/AST/CommentSema.h:210

bool isObjCPropertyDecl()

Declared at: clang/include/clang/AST/CommentSema.h:211

bool isObjCProtocolDecl()

Declared at: clang/include/clang/AST/CommentSema.h:220

bool isRecordLikeDecl()

Declared at: clang/include/clang/AST/CommentSema.h:213

bool isTemplateOrSpecialization()

Declared at: clang/include/clang/AST/CommentSema.h:212

bool isUnionDecl()

Declared at: clang/include/clang/AST/CommentSema.h:218

void resolveParamCommandIndexes(
    const clang::comments::FullComment* FC)

Description

Resolve parameter names to parameter indexes in function declaration. Emit diagnostics about unknown parametrs.

Declared at: clang/include/clang/AST/CommentSema.h:197

Parameters

const clang::comments::FullComment* FC

unsigned int resolveParmVarReference(
    llvm::StringRef Name,
    ArrayRef<const clang::ParmVarDecl*> ParamVars)

Description

Returns index of a function parameter with a given name.

Declared at: clang/include/clang/AST/CommentSema.h:231

Parameters

llvm::StringRef Name
ArrayRef<const clang::ParmVarDecl*> ParamVars

bool resolveTParamReference(
    llvm::StringRef Name,
    const clang::TemplateParameterList*
        TemplateParameters,
    SmallVectorImpl<unsigned int>* Position)

Declared at: clang/include/clang/AST/CommentSema.h:239

Parameters

llvm::StringRef Name
const clang::TemplateParameterList* TemplateParameters
SmallVectorImpl<unsigned int>* Position

void setDecl(const clang::Decl* D)

Declared at: clang/include/clang/AST/CommentSema.h:76

Parameters

const clang::Decl* D