clang: clang::SemaSwift Class Reference (original) (raw)
#include "[clang/Sema/SemaSwift.h](SemaSwift%5F8h%5Fsource.html)"
Public Member Functions | |
---|---|
SemaSwift (Sema &S) | |
SwiftNameAttr * | mergeNameAttr (Decl *D, const SwiftNameAttr &SNA, StringRef Name) |
void | handleAttrAttr (Decl *D, const ParsedAttr &AL) |
void | handleAsyncAttr (Decl *D, const ParsedAttr &AL) |
void | handleBridge (Decl *D, const ParsedAttr &AL) |
void | handleError (Decl *D, const ParsedAttr &AL) |
void | handleAsyncError (Decl *D, const ParsedAttr &AL) |
void | handleName (Decl *D, const ParsedAttr &AL) |
void | handleAsyncName (Decl *D, const ParsedAttr &AL) |
void | handleNewType (Decl *D, const ParsedAttr &AL) |
bool | DiagnoseName (Decl *D, StringRef Name, SourceLocation Loc, const ParsedAttr &AL, bool IsAsync) |
Do a check to make sure Name looks like a legal argument for the swift_name attribute applied to decl D. | |
void | AddParameterABIAttr (Decl *D, const AttributeCommonInfo &CI, ParameterABI abi) |
![]() |
|
SemaBase (Sema &S) | |
ASTContext & | getASTContext () const |
DiagnosticsEngine & | getDiagnostics () const |
const LangOptions & | getLangOpts () const |
SemaDiagnosticBuilder | Diag (SourceLocation Loc, unsigned DiagID, bool DeferHint=false) |
Emit a diagnostic. | |
SemaDiagnosticBuilder | Diag (SourceLocation Loc, const PartialDiagnostic &PD, bool DeferHint=false) |
Emit a partial diagnostic. | |
PartialDiagnostic | PDiag (unsigned DiagID=0) |
Build a partial diagnostic. | |
Definition at line 28 of file SemaSwift.h.
clang::SemaSwift::SemaSwift | ( | Sema & | S | ) |
---|
◆ AddParameterABIAttr()
Definition at line 715 of file SemaSwift.cpp.
References D, clang::SemaBase::Diag(), clang::SemaBase::getASTContext(), clang::AttributeCommonInfo::getLoc(), clang::getParameterABISpelling(), clang::HLSLInOut, clang::HLSLOut, clang::AttributeCommonInfo::isRegularKeywordAttribute(), clang::isValidSwiftContextType(), clang::isValidSwiftErrorResultType(), clang::isValidSwiftIndirectResultType(), clang::Ordinary, clang::SwiftAsyncContext, clang::SwiftContext, clang::SwiftErrorResult, clang::SwiftIndirectResult, and clang::ast_matchers::type.
Referenced by clang::Sema::InstantiateAttrs(), and ProcessDeclAttribute().
◆ DiagnoseName()
Do a check to make sure Name
looks like a legal argument for the swift_name attribute applied to decl D
.
Raise a diagnostic if the name is invalid for the given declaration.
AL
is used to provide caret diagnostics in case of a malformed name.
Returns
true if the name is a valid swift name for D
, false otherwise.
Definition at line 515 of file SemaSwift.cpp.
References D, clang::SemaBase::Diag(), clang::ExpectedFunctionWithProtoType, clang::Type::getPointeeType(), clang::ValueDecl::getType(), clang::QualType::isConstQualified(), clang::Type::isPointerType(), clang::Type::isReferenceType(), clang::AttributeCommonInfo::isRegularKeywordAttribute(), clang::isValidAsciiIdentifier(), Loc, clang::SemaBase::SemaRef, and clang::validateSwiftFunctionName().
Referenced by handleAsyncName(), handleName(), and ProcessAPINotes().
◆ handleAsyncAttr()
void clang::SemaSwift::handleAsyncAttr | ( | Decl * | D, |
---|---|---|---|
const ParsedAttr & | AL | ||
) |
Definition at line 662 of file SemaSwift.cpp.
References clang::AANT_ArgumentIdentifier, clang::Type::castAs(), clang::ParsedAttr::checkExactlyNumArgs(), clang::Sema::checkFunctionOrMethodParameterIndex(), clang::checkSwiftAsyncErrorBlock(), D, clang::SemaBase::Diag(), clang::ParsedAttr::getArgAsExpr(), clang::ParsedAttr::getArgAsIdent(), clang::SemaBase::getASTContext(), clang::ParamIdx::getASTIndex(), clang::getFunctionOrMethodParam(), clang::AttributeCommonInfo::getLoc(), clang::Decl::getLocation(), clang::IdentifierInfo::getName(), getPointeeType(), clang::FunctionType::getReturnType(), clang::ValueDecl::getType(), clang::IdentifierLoc::Ident, clang::ParsedAttr::isArgIdent(), clang::Type::isBlockPointerType(), clang::Type::isVoidType(), Kind, and clang::SemaBase::SemaRef.
Referenced by ProcessDeclAttribute().
◆ handleAsyncError()
void clang::SemaSwift::handleAsyncError | ( | Decl * | D, |
---|---|---|---|
const ParsedAttr & | AL | ||
) |
Definition at line 287 of file SemaSwift.cpp.
References clang::ParsedAttr::checkExactlyNumArgs(), clang::checkSwiftAsyncErrorBlock(), clang::Sema::checkUInt32Argument(), D, clang::SemaBase::Diag(), clang::ParsedAttr::getArgAsExpr(), clang::ParsedAttr::getArgAsIdent(), clang::SemaBase::getASTContext(), clang::AttributeCommonInfo::getLoc(), clang::IdentifierInfo::getName(), clang::IdentifierLoc::Ident, and clang::SemaBase::SemaRef.
Referenced by ProcessDeclAttribute().
◆ handleAsyncName()
void clang::SemaSwift::handleAsyncName | ( | Decl * | D, |
---|---|---|---|
const ParsedAttr & | AL | ||
) |
◆ handleAttrAttr()
void clang::SemaSwift::handleAttrAttr | ( | Decl * | D, |
---|---|---|---|
const ParsedAttr & | AL | ||
) |
◆ handleBridge()
void clang::SemaSwift::handleBridge | ( | Decl * | D, |
---|---|---|---|
const ParsedAttr & | AL | ||
) |
◆ handleError()
void clang::SemaSwift::handleError | ( | Decl * | D, |
---|---|---|---|
const ParsedAttr & | AL | ||
) |
Definition at line 130 of file SemaSwift.cpp.
References D, clang::SemaBase::Diag(), E, clang::ParsedAttr::getArgAsIdent(), clang::SemaBase::getASTContext(), clang::getFunctionOrMethodNumParams(), clang::getFunctionOrMethodParamType(), clang::getFunctionOrMethodResultType(), clang::AttributeCommonInfo::getLoc(), clang::IdentifierInfo::getName(), clang::Type::hasPointerRepresentation(), clang::IdentifierLoc::Ident, clang::isErrorParameter(), clang::Type::isIntegralType(), clang::Type::isReferenceType(), Loc, and clang::SemaBase::SemaRef.
Referenced by ProcessDeclAttribute().
◆ handleName()
◆ handleNewType()
void clang::SemaSwift::handleNewType | ( | Decl * | D, |
---|---|---|---|
const ParsedAttr & | AL | ||
) |
Definition at line 634 of file SemaSwift.cpp.
References clang::AANT_ArgumentIdentifier, clang::ParsedAttr::checkExactlyNumArgs(), D, clang::SemaBase::Diag(), clang::ExpectedTypedef, clang::ParsedAttr::getArgAsIdent(), clang::SemaBase::getASTContext(), clang::AttributeCommonInfo::getLoc(), clang::IdentifierInfo::getName(), clang::IdentifierLoc::Ident, clang::ParsedAttr::isArgIdent(), clang::AttributeCommonInfo::isRegularKeywordAttribute(), Kind, and clang::SemaBase::SemaRef.
Referenced by ProcessDeclAttribute().
◆ mergeNameAttr()
SwiftNameAttr * clang::SemaSwift::mergeNameAttr | ( | Decl * | D, |
---|---|---|---|
const SwiftNameAttr & | SNA, | ||
StringRef | Name | ||
) |
The documentation for this class was generated from the following files:
- include/clang/Sema/SemaSwift.h
- lib/Sema/SemaSwift.cpp