isa<DeclaratorDecl>(
D) || isa<BlockDecl>(
D) ||
49isa<TypedefNameDecl>(
D) || isa<ObjCPropertyDecl>(
D);
57 returnisa<FunctionProtoType>(FnTy);
58 returnisa<ObjCMethodDecl>(
D) || isa<BlockDecl>(
D);
66 returncast<FunctionProtoType>(FnTy)->getNumParams();
67 if(
const auto*BD = dyn_cast<BlockDecl>(
D))
68 returnBD->getNumParams();
69 returncast<ObjCMethodDecl>(
D)->param_size();
74 if(
const auto*FD = dyn_cast<FunctionDecl>(
D))
75 returnFD->getParamDecl(Idx);
76 if(
const auto*MD = dyn_cast<ObjCMethodDecl>(
D))
77 returnMD->getParamDecl(Idx);
78 if(
const auto*BD = dyn_cast<BlockDecl>(
D))
79 returnBD->getParamDecl(Idx);
85 returncast<FunctionProtoType>(FnTy)->getParamType(Idx);
86 if(
const auto*BD = dyn_cast<BlockDecl>(
D))
87 returnBD->getParamDecl(Idx)->getType();
89 returncast<ObjCMethodDecl>(
D)->parameters()[Idx]->getType();
94 returnPVD->getSourceRange();
100 returnFnTy->getReturnType();
101 returncast<ObjCMethodDecl>(
D)->getReturnType();
105 if(
const auto*FD = dyn_cast<FunctionDecl>(
D))
106 returnFD->getReturnTypeSourceRange();
107 if(
const auto*MD = dyn_cast<ObjCMethodDecl>(
D))
108 returnMD->getReturnTypeSourceRange();
114 returncast<FunctionProtoType>(FnTy)->isVariadic();
115 if(
const auto*BD = dyn_cast<BlockDecl>(
D))
116 returnBD->isVariadic();
117 returncast<ObjCMethodDecl>(
D)->isVariadic();
121 if(
const auto*MethodDecl = dyn_cast<CXXMethodDecl>(
D))
122 returnMethodDecl->isInstance();
128template<
typenameAttrTy>
130 if(
const auto*A =
D->
getAttr<AttrTy>()) {
131S.
Diag(AL.
getLoc(), diag::err_attributes_are_not_compatible)
134S.
Diag(A->getLocation(), diag::note_conflicting_attribute);
140template<
typenameAttrTy>
142 if(
const auto*A =
D->
getAttr<AttrTy>()) {
146 Diag(A->getLocation(), diag::note_conflicting_attribute);
152template<
typename... DiagnosticArgs>
153constSemaBase::SemaDiagnosticBuilder &
158template<
typename T,
typename... DiagnosticArgs>
159constSemaBase::SemaDiagnosticBuilder &
161DiagnosticArgs &&...ExtraArgs) {
163std::forward<DiagnosticArgs>(ExtraArgs)...);
168template<
typenameAttrType>
178template<
typenameAttrType,
typename... DiagnosticArgs>
181 boolPassesCheck,
unsignedDiagID,
182DiagnosticArgs &&...ExtraArgs) {
188handleSimpleAttribute<AttrType>(S,
D, CI);
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
static DiagnosticBuilder Diag(DiagnosticsEngine *Diags, const LangOptions &Features, FullSourceLoc TokLoc, const char *TokBegin, const char *TokRangeBegin, const char *TokRangeEnd, unsigned DiagID)
Produce a diagnostic highlighting some portion of a literal.
Defines the clang::SourceLocation class and associated facilities.
C Language Family Type Representation.
Attr - This represents one attribute.
SourceLocation getLocation() const
bool isRegularKeywordAttribute() const
SourceLocation getLoc() const
Decl - This represents one declaration (or definition), e.g.
const FunctionType * getFunctionType(bool BlocksToo=true) const
Looks through the Decl's underlying type to extract a FunctionType when possible.
SourceLocation getBeginLoc() const LLVM_READONLY
FunctionType - C99 6.7.5.3 - Function Declarators.
Represents a parameter to a function.
ParsedAttr - Represents a syntactic attribute.
A (possibly-)qualified type.
A generic diagnostic builder for errors which may or may not be deferred.
SemaDiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID, bool DeferHint=false)
Emit a diagnostic.
ASTContext & getASTContext() const
A trivial tuple used to represent a source range.
The JSON file list parser is used to communicate input to InstallAPI.
const SemaBase::SemaDiagnosticBuilder & appendDiagnostics(const SemaBase::SemaDiagnosticBuilder &Bldr)
void handleSimpleAttributeOrDiagnose(SemaBase &S, Decl *D, const AttributeCommonInfo &CI, bool PassesCheck, unsigned DiagID, DiagnosticArgs &&...ExtraArgs)
Add an attribute AttrType to declaration D, provided that PassesCheck is true.
bool hasDeclarator(const Decl *D)
Return true if the given decl has a declarator that should have been processed by Sema::GetTypeForDec...
QualType getFunctionOrMethodResultType(const Decl *D)
bool isInstanceMethod(const Decl *D)
const ParmVarDecl * getFunctionOrMethodParam(const Decl *D, unsigned Idx)
bool checkAttrMutualExclusion(SemaBase &S, Decl *D, const ParsedAttr &AL)
Diagnose mutually exclusive attributes when present on a given declaration.
SourceRange getFunctionOrMethodResultSourceRange(const Decl *D)
bool isFunctionOrMethodOrBlockForAttrSubject(const Decl *D)
Return true if the given decl has function type (function or function-typed variable) or an Objective...
QualType getFunctionOrMethodParamType(const Decl *D, unsigned Idx)
bool isFunctionOrMethodVariadic(const Decl *D)
bool isFuncOrMethodForAttrSubject(const Decl *D)
isFuncOrMethodForAttrSubject - Return true if the given decl has function type (function or function-...
void handleSimpleAttribute(SemaBase &S, Decl *D, const AttributeCommonInfo &CI)
Applies the given attribute to the Decl without performing any additional semantic checking.
const FunctionProtoType * T
bool hasFunctionProto(const Decl *D)
hasFunctionProto - Return true if the given decl has a argument information.
unsigned getFunctionOrMethodNumParams(const Decl *D)
getFunctionOrMethodNumParams - Return number of function or method parameters.
SourceRange getFunctionOrMethodParamRange(const Decl *D, unsigned Idx)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4