clang  6.0.0svn
Public Member Functions | List of all members
clang::comments::Sema Class Reference

#include "clang/AST/CommentSema.h"

Public Member Functions

 Sema (llvm::BumpPtrAllocator &Allocator, const SourceManager &SourceMgr, DiagnosticsEngine &Diags, CommandTraits &Traits, const Preprocessor *PP)
 
void setDecl (const Decl *D)
 
template<typename T >
ArrayRef< TcopyArray (ArrayRef< T > Source)
 Returns a copy of array, owned by Sema's allocator. More...
 
ParagraphCommentactOnParagraphComment (ArrayRef< InlineContentComment *> Content)
 
BlockCommandCommentactOnBlockCommandStart (SourceLocation LocBegin, SourceLocation LocEnd, unsigned CommandID, CommandMarkerKind CommandMarker)
 
void actOnBlockCommandArgs (BlockCommandComment *Command, ArrayRef< BlockCommandComment::Argument > Args)
 
void actOnBlockCommandFinish (BlockCommandComment *Command, ParagraphComment *Paragraph)
 
ParamCommandCommentactOnParamCommandStart (SourceLocation LocBegin, SourceLocation LocEnd, unsigned CommandID, CommandMarkerKind CommandMarker)
 
void actOnParamCommandDirectionArg (ParamCommandComment *Command, SourceLocation ArgLocBegin, SourceLocation ArgLocEnd, StringRef Arg)
 
void actOnParamCommandParamNameArg (ParamCommandComment *Command, SourceLocation ArgLocBegin, SourceLocation ArgLocEnd, StringRef Arg)
 
void actOnParamCommandFinish (ParamCommandComment *Command, ParagraphComment *Paragraph)
 
TParamCommandCommentactOnTParamCommandStart (SourceLocation LocBegin, SourceLocation LocEnd, unsigned CommandID, CommandMarkerKind CommandMarker)
 
void actOnTParamCommandParamNameArg (TParamCommandComment *Command, SourceLocation ArgLocBegin, SourceLocation ArgLocEnd, StringRef Arg)
 
void actOnTParamCommandFinish (TParamCommandComment *Command, ParagraphComment *Paragraph)
 
InlineCommandCommentactOnInlineCommand (SourceLocation CommandLocBegin, SourceLocation CommandLocEnd, unsigned CommandID)
 
InlineCommandCommentactOnInlineCommand (SourceLocation CommandLocBegin, SourceLocation CommandLocEnd, unsigned CommandID, SourceLocation ArgLocBegin, SourceLocation ArgLocEnd, StringRef Arg)
 
InlineContentCommentactOnUnknownCommand (SourceLocation LocBegin, SourceLocation LocEnd, StringRef CommandName)
 
InlineContentCommentactOnUnknownCommand (SourceLocation LocBegin, SourceLocation LocEnd, unsigned CommandID)
 
TextCommentactOnText (SourceLocation LocBegin, SourceLocation LocEnd, StringRef Text)
 
VerbatimBlockCommentactOnVerbatimBlockStart (SourceLocation Loc, unsigned CommandID)
 
VerbatimBlockLineCommentactOnVerbatimBlockLine (SourceLocation Loc, StringRef Text)
 
void actOnVerbatimBlockFinish (VerbatimBlockComment *Block, SourceLocation CloseNameLocBegin, StringRef CloseName, ArrayRef< VerbatimBlockLineComment *> Lines)
 
VerbatimLineCommentactOnVerbatimLine (SourceLocation LocBegin, unsigned CommandID, SourceLocation TextBegin, StringRef Text)
 
HTMLStartTagCommentactOnHTMLStartTagStart (SourceLocation LocBegin, StringRef TagName)
 
void actOnHTMLStartTagFinish (HTMLStartTagComment *Tag, ArrayRef< HTMLStartTagComment::Attribute > Attrs, SourceLocation GreaterLoc, bool IsSelfClosing)
 
HTMLEndTagCommentactOnHTMLEndTag (SourceLocation LocBegin, SourceLocation LocEnd, StringRef TagName)
 
FullCommentactOnFullComment (ArrayRef< BlockContentComment *> Blocks)
 
void checkBlockCommandEmptyParagraph (BlockCommandComment *Command)
 
void checkReturnsCommand (const BlockCommandComment *Command)
 
void checkBlockCommandDuplicate (const BlockCommandComment *Command)
 Emit diagnostics about duplicate block commands that should be used only once per comment, e.g., \brief and \returns. More...
 
void checkDeprecatedCommand (const BlockCommandComment *Comment)
 
void checkFunctionDeclVerbatimLine (const BlockCommandComment *Comment)
 
void checkContainerDeclVerbatimLine (const BlockCommandComment *Comment)
 
void checkContainerDecl (const BlockCommandComment *Comment)
 
void resolveParamCommandIndexes (const FullComment *FC)
 Resolve parameter names to parameter indexes in function declaration. More...
 
bool isFunctionDecl ()
 
bool isAnyFunctionDecl ()
 
bool isFunctionPointerVarDecl ()
 
bool isFunctionOrBlockPointerVarLikeDecl ()
 
bool isFunctionOrMethodVariadic ()
 
bool isObjCMethodDecl ()
 
bool isObjCPropertyDecl ()
 
bool isTemplateOrSpecialization ()
 
bool isRecordLikeDecl ()
 
bool isClassOrStructDecl ()
 
bool isUnionDecl ()
 
bool isObjCInterfaceDecl ()
 
bool isObjCProtocolDecl ()
 
bool isClassTemplateDecl ()
 
bool isFunctionTemplateDecl ()
 
ArrayRef< const ParmVarDecl * > getParamVars ()
 
void inspectThisDecl ()
 Extract all important semantic information from ThisDeclInfo->ThisDecl into ThisDeclInfo members. More...
 
unsigned resolveParmVarReference (StringRef Name, ArrayRef< const ParmVarDecl *> ParamVars)
 Returns index of a function parameter with a given name. More...
 
unsigned correctTypoInParmVarReference (StringRef Typo, ArrayRef< const ParmVarDecl *> ParamVars)
 Returns index of a function parameter with the name closest to a given typo. More...
 
bool resolveTParamReference (StringRef Name, const TemplateParameterList *TemplateParameters, SmallVectorImpl< unsigned > *Position)
 
StringRef correctTypoInTParamReference (StringRef Typo, const TemplateParameterList *TemplateParameters)
 
InlineCommandComment::RenderKind getInlineCommandRenderKind (StringRef Name) const
 

Detailed Description

Definition at line 33 of file CommentSema.h.

Constructor & Destructor Documentation

◆ Sema()

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

Definition at line 28 of file CommentSema.cpp.

Member Function Documentation

◆ actOnBlockCommandArgs()

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

◆ actOnBlockCommandFinish()

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

◆ actOnBlockCommandStart()

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

Definition at line 50 of file CommentSema.cpp.

References checkContainerDecl().

Referenced by copyArray(), and clang::comments::Parser::parseBlockCommand().

◆ actOnFullComment()

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

◆ actOnHTMLEndTag()

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

◆ actOnHTMLStartTagFinish()

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

◆ actOnHTMLStartTagStart()

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

Definition at line 458 of file CommentSema.cpp.

Referenced by copyArray(), and clang::comments::Parser::parseHTMLStartTag().

◆ actOnInlineCommand() [1/2]

InlineCommandComment * clang::comments::Sema::actOnInlineCommand ( SourceLocation  CommandLocBegin,
SourceLocation  CommandLocEnd,
unsigned  CommandID 
)

◆ actOnInlineCommand() [2/2]

InlineCommandComment * clang::comments::Sema::actOnInlineCommand ( SourceLocation  CommandLocBegin,
SourceLocation  CommandLocEnd,
unsigned  CommandID,
SourceLocation  ArgLocBegin,
SourceLocation  ArgLocEnd,
StringRef  Arg 
)

◆ actOnParagraphComment()

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

◆ actOnParamCommandDirectionArg()

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

◆ actOnParamCommandFinish()

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

◆ actOnParamCommandParamNameArg()

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

◆ actOnParamCommandStart()

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

◆ actOnText()

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

◆ actOnTParamCommandFinish()

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

◆ actOnTParamCommandParamNameArg()

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

◆ actOnTParamCommandStart()

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

◆ actOnUnknownCommand() [1/2]

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

◆ actOnUnknownCommand() [2/2]

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

◆ actOnVerbatimBlockFinish()

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

◆ actOnVerbatimBlockLine()

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

Definition at line 429 of file CommentSema.cpp.

Referenced by copyArray(), and clang::comments::Parser::parseVerbatimBlock().

◆ actOnVerbatimBlockStart()

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

◆ actOnVerbatimLine()

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

◆ checkBlockCommandDuplicate()

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

◆ checkBlockCommandEmptyParagraph()

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

◆ checkContainerDecl()

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

◆ checkContainerDeclVerbatimLine()

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

◆ checkDeprecatedCommand()

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

◆ checkFunctionDeclVerbatimLine()

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

◆ checkReturnsCommand()

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

◆ copyArray()

template<typename T >
ArrayRef<T> clang::comments::Sema::copyArray ( ArrayRef< T Source)
inline

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

Definition at line 81 of file CommentSema.h.

References actOnBlockCommandArgs(), actOnBlockCommandFinish(), actOnBlockCommandStart(), actOnFullComment(), actOnHTMLEndTag(), actOnHTMLStartTagFinish(), actOnHTMLStartTagStart(), actOnInlineCommand(), actOnParagraphComment(), actOnParamCommandDirectionArg(), actOnParamCommandFinish(), actOnParamCommandParamNameArg(), actOnParamCommandStart(), actOnText(), actOnTParamCommandFinish(), actOnTParamCommandParamNameArg(), actOnTParamCommandStart(), actOnUnknownCommand(), actOnVerbatimBlockFinish(), actOnVerbatimBlockLine(), actOnVerbatimBlockStart(), actOnVerbatimLine(), checkBlockCommandDuplicate(), checkBlockCommandEmptyParagraph(), checkContainerDecl(), checkContainerDeclVerbatimLine(), checkDeprecatedCommand(), checkFunctionDeclVerbatimLine(), checkReturnsCommand(), getParamVars(), inspectThisDecl(), isAnyFunctionDecl(), isClassOrStructDecl(), isClassTemplateDecl(), isFunctionDecl(), isFunctionOrBlockPointerVarLikeDecl(), isFunctionOrMethodVariadic(), isFunctionPointerVarDecl(), isFunctionTemplateDecl(), isObjCInterfaceDecl(), isObjCMethodDecl(), isObjCPropertyDecl(), isObjCProtocolDecl(), isRecordLikeDecl(), isTemplateOrSpecialization(), isUnionDecl(), resolveParamCommandIndexes(), resolveParmVarReference(), and Text.

Referenced by clang::comments::Parser::parseFullComment(), clang::comments::Parser::parseHTMLStartTag(), clang::comments::Parser::parseParagraphOrBlockCommand(), and clang::comments::Parser::parseVerbatimBlock().

◆ correctTypoInParmVarReference()

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

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

Definition at line 1038 of file CommentSema.cpp.

◆ correctTypoInTParamReference()

StringRef clang::comments::Sema::correctTypoInTParamReference ( StringRef  Typo,
const TemplateParameterList TemplateParameters 
)

Definition at line 1103 of file CommentSema.cpp.

◆ getInlineCommandRenderKind()

InlineCommandComment::RenderKind clang::comments::Sema::getInlineCommandRenderKind ( StringRef  Name) const

Definition at line 1117 of file CommentSema.cpp.

Referenced by actOnInlineCommand().

◆ getParamVars()

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

◆ inspectThisDecl()

void clang::comments::Sema::inspectThisDecl ( )

◆ isAnyFunctionDecl()

bool clang::comments::Sema::isAnyFunctionDecl ( )

◆ isClassOrStructDecl()

bool clang::comments::Sema::isClassOrStructDecl ( )

◆ isClassTemplateDecl()

bool clang::comments::Sema::isClassTemplateDecl ( )

◆ isFunctionDecl()

bool clang::comments::Sema::isFunctionDecl ( )

◆ isFunctionOrBlockPointerVarLikeDecl()

bool clang::comments::Sema::isFunctionOrBlockPointerVarLikeDecl ( )
Returns
true if the declaration that this comment is attached to declares a variable or a field whose type is a function or a block pointer.

Definition at line 857 of file CommentSema.cpp.

References clang::comments::DeclInfo::CurrentDecl, clang::Type::getAs(), clang::comments::DeclInfo::getKind(), inspectThisDecl(), clang::Type::isBlockPointerType(), clang::comments::DeclInfo::IsFilled, clang::Type::isFunctionPointerType(), and clang::comments::DeclInfo::VariableKind.

Referenced by actOnParamCommandStart(), checkReturnsCommand(), and copyArray().

◆ isFunctionOrMethodVariadic()

bool clang::comments::Sema::isFunctionOrMethodVariadic ( )

◆ isFunctionPointerVarDecl()

bool clang::comments::Sema::isFunctionPointerVarDecl ( )

◆ isFunctionTemplateDecl()

bool clang::comments::Sema::isFunctionTemplateDecl ( )

◆ isObjCInterfaceDecl()

bool clang::comments::Sema::isObjCInterfaceDecl ( )

◆ isObjCMethodDecl()

bool clang::comments::Sema::isObjCMethodDecl ( )

◆ isObjCPropertyDecl()

bool clang::comments::Sema::isObjCPropertyDecl ( )

◆ isObjCProtocolDecl()

bool clang::comments::Sema::isObjCProtocolDecl ( )

◆ isRecordLikeDecl()

bool clang::comments::Sema::isRecordLikeDecl ( )

◆ isTemplateOrSpecialization()

bool clang::comments::Sema::isTemplateOrSpecialization ( )

◆ isUnionDecl()

bool clang::comments::Sema::isUnionDecl ( )

◆ resolveParamCommandIndexes()

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

Resolve parameter names to parameter indexes in function declaration.

Emit diagnostics about unknown parametrs.

Definition at line 713 of file CommentSema.cpp.

References getParamVars(), and isFunctionDecl().

Referenced by actOnFullComment(), and copyArray().

◆ resolveParmVarReference()

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

Returns index of a function parameter with a given name.

Definition at line 973 of file CommentSema.cpp.

Referenced by copyArray().

◆ resolveTParamReference()

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

Definition at line 1076 of file CommentSema.cpp.

◆ setDecl()

void clang::comments::Sema::setDecl ( const Decl D)

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