24bool hasPublicMethodInBaseClass(
const CXXRecordDecl *R, StringRef NameToMatch) {
30 if (MethodName == NameToMatch && MD->getAccess() ==
AS_public)
40std::optional<const clang::CXXRecordDecl *>
44 const Type *T =
Base->getType().getTypePtrOrNull();
50 auto CT =
Base->getType().getCanonicalType();
51 if (
auto *TST = dyn_cast<TemplateSpecializationType>(CT)) {
52 auto TmplName = TST->getTemplateName();
53 if (!TmplName.isNull()) {
54 if (
auto *TD = TmplName.getAsTemplateDecl())
55 R = dyn_cast_or_null<CXXRecordDecl>(TD->getTemplatedDecl());
64 return hasPublicMethodInBaseClass(R, NameToMatch) ? R :
nullptr;
68 StringRef IncMethodName,
69 StringRef DecMethodName) {
76 bool hasRef = hasPublicMethodInBaseClass(R, IncMethodName);
77 bool hasDeref = hasPublicMethodInBaseClass(R, DecMethodName);
78 if (hasRef && hasDeref)
84 bool AnyInconclusiveBase =
false;
89 AnyInconclusiveBase =
true;
92 return (*hasRefInBase) !=
nullptr;
95 hasRef = hasRef || R->
lookupInBases(hasPublicRefInBase, Paths,
97 if (AnyInconclusiveBase)
104 if (!hasDerefInBase) {
105 AnyInconclusiveBase =
true;
108 return (*hasDerefInBase) !=
nullptr;
110 hasDeref = hasDeref || R->
lookupInBases(hasPublicDerefInBase, Paths,
112 if (AnyInconclusiveBase)
115 return hasRef && hasDeref;
124 "decrementCheckedPtrCount");
128 return Name ==
"Ref" || Name ==
"RefAllowingPartiallyDestroyed" ||
129 Name ==
"RefPtr" || Name ==
"RefPtrAllowingPartiallyDestroyed";
133 return Name ==
"RetainPtr" || Name ==
"RetainPtrArc" ||
134 Name ==
"OSObjectPtr" || Name ==
"OSObjectPtrArc";
138 return Name ==
"CheckedPtr" || Name ==
"CheckedRef";
143 Name ==
"UniqueRef" || Name ==
"LazyUniqueRef";
148 Name ==
"WeakPtr" || Name ==
"WeakPtrFactory" ||
149 Name ==
"WeakPtrFactoryWithBitField" || Name ==
"WeakPtrImplBase" ||
150 Name ==
"WeakPtrImplBaseSingleThread" || Name ==
"ThreadSafeWeakPtr" ||
151 Name ==
"ThreadSafeWeakOrStrongPtr" ||
152 Name ==
"ThreadSafeWeakPtrControlBlock" ||
153 Name ==
"ThreadSafeRefCountedAndCanMakeThreadSafeWeakPtr";
160 return isRefType(FunctionName) || FunctionName ==
"adoptRef" ||
161 FunctionName ==
"UniqueRef" || FunctionName ==
"makeUniqueRef" ||
162 FunctionName ==
"makeUniqueRefWithoutFastMallocCheck"
164 || FunctionName ==
"String" || FunctionName ==
"AtomString" ||
165 FunctionName ==
"UniqueString"
167 || FunctionName ==
"Identifier";
177 return FunctionName ==
"RetainPtr" || FunctionName ==
"adoptNS" ||
178 FunctionName ==
"adoptCF" || FunctionName ==
"retainPtr" ||
179 FunctionName ==
"RetainPtrArc" || FunctionName ==
"adoptNSArc" ||
180 FunctionName ==
"adoptOSObject" || FunctionName ==
"adoptOSObjectArc";
194 if (!isa_and_nonnull<TranslationUnitDecl>(TUDeck))
197 return (NsName ==
"WTF" || NsName ==
"std") && FnName ==
"move";
200template <
typename Predicate>
203 while (!
type.isNull()) {
204 if (
auto *SpecialT =
type->getAs<TemplateSpecializationType>()) {
205 auto *
Decl = SpecialT->getTemplateName().getAsTemplateDecl();
206 return Decl && Pred(
Decl->getNameAsString());
207 }
else if (
auto *DTS =
type->getAs<DeducedTemplateSpecializationType>()) {
208 auto *
Decl = DTS->getTemplateName().getAsTemplateDecl();
209 return Decl && Pred(
Decl->getNameAsString());
230 if (
auto *Subst = dyn_cast<SubstTemplateTypeParmType>(T)) {
231 if (
auto *
Decl = Subst->getAssociatedDecl()) {
240 if (
auto *Subst = dyn_cast<SubstTemplateTypeParmType>(T)) {
241 if (
auto *
Decl = Subst->getAssociatedDecl()) {
251 IsARCEnabled = TUD->
getLangOpts().ObjCAutoRefCount;
252 DefaultSynthProperties = TUD->
getLangOpts().ObjCDefaultSynthProperties;
257 if (!QT->isPointerType())
263 if (TD->
hasAttr<ObjCBridgeAttr>() || TD->
hasAttr<ObjCBridgeMutableAttr>()) {
272 for (
auto *Redecl : RT->getDecl()->getMostRecentDecl()->redecls()) {
273 if (Redecl->getAttr<ObjCBridgeAttr>() ||
274 Redecl->getAttr<ObjCBridgeMutableAttr>()) {
275 CFPointees.insert(RT);
284 if (
auto *RT = dyn_cast_or_null<RecordType>(
286 return CFPointees.contains(RT);
287 return RecordlessTypes.contains(QT.
getTypePtr());
300 return (*IsRefCountable);
310 if (T->isPointerType() || T->isReferenceType()) {
311 if (
auto *CXXRD = T->getPointeeCXXRecordDecl())
318 if (T->isPointerType() || T->isReferenceType()) {
319 if (
auto *CXXRD = T->getPointeeCXXRecordDecl())
333 if (
isCheckedPtr(className) && (method ==
"get" || method ==
"ptr"))
336 if ((
isRefType(className) && (method ==
"get" || method ==
"ptr")) ||
337 ((className ==
"String" || className ==
"AtomString" ||
338 className ==
"AtomStringImpl" || className ==
"UniqueString" ||
339 className ==
"UniqueStringImpl" || className ==
"Identifier") &&
349 if (
auto *maybeRefToRawOperator = dyn_cast<CXXConversionDecl>(M)) {
350 auto QT = maybeRefToRawOperator->getConversionType();
351 auto *T = QT.getTypePtrOrNull();
352 return T && (T->isPointerType() || T->isReferenceType());
357 if (
auto *maybeRefToRawOperator = dyn_cast<CXXConversionDecl>(M)) {
358 auto QT = maybeRefToRawOperator->getConversionType();
359 auto *T = QT.getTypePtrOrNull();
360 return T && (T->isPointerType() || T->isReferenceType());
365 if (
auto *maybeRefToRawOperator = dyn_cast<CXXConversionDecl>(M)) {
366 auto QT = maybeRefToRawOperator->getConversionType();
367 auto *T = QT.getTypePtrOrNull();
368 return T && (T->isPointerType() || T->isReferenceType() ||
369 T->isObjCObjectPointerType());
417 auto *
Type = RetType.getTypePtrOrNull();
418 if (
auto *MacroQualified = dyn_cast_or_null<MacroQualifiedType>(
Type))
419 Type = MacroQualified->desugar().getTypePtrOrNull();
420 auto *
Attr = dyn_cast_or_null<AttributedType>(
Type);
423 auto *AnnotateType = dyn_cast_or_null<AnnotateTypeAttr>(
Attr->getAttr());
426 auto Annotation = AnnotateType->getAnnotation();
427 if (Annotation ==
"webkit.pointerconversion")
429 if (Annotation ==
"webkit.nodelete")
441 if (FunctionName ==
"getPtr" || FunctionName ==
"WeakPtr" ||
442 FunctionName ==
"dynamicDowncast" || FunctionName ==
"downcast" ||
443 FunctionName ==
"checkedDowncast" || FunctionName ==
"bit_cast" ||
444 FunctionName ==
"uncheckedDowncast" || FunctionName ==
"bitwise_cast" ||
445 FunctionName ==
"bridge_cast" || FunctionName ==
"bridge_id_cast" ||
446 FunctionName ==
"dynamic_cf_cast" || FunctionName ==
"checked_cf_cast" ||
447 FunctionName ==
"dynamic_objc_cast" ||
448 FunctionName ==
"checked_objc_cast")
465 const auto *MD = dyn_cast<CXXMethodDecl>(F);
466 if (!MD || !MD->isVirtual())
469 auto Overriders = llvm::to_vector(MD->overridden_methods());
470 while (!Overriders.empty()) {
471 const auto *Fn = Overriders.pop_back_val();
472 llvm::append_range(Overriders, Fn->overridden_methods());
484 return Name.starts_with(
"__builtin") || Name ==
"__libcpp_verbose_abort" ||
485 Name.starts_with(
"os_log") || Name.starts_with(
"_os_log");
491 if (
auto *MethodDecl = dyn_cast<CXXMethodDecl>(F)) {
492 if (!MethodDecl->isStatic())
496 StringRef Name = NameStr;
497 return Name ==
"singleton" || Name.ends_with(
"Singleton");
506 bool VisitChildren(
const Stmt *S) {
508 if (Child && !
Visit(Child)) {
509 if (OffendingStmt && !*OffendingStmt)
510 *OffendingStmt = Child;
518 template <
typename StmtOrDecl,
typename CheckFunction>
519 bool WithCachedResult(
const StmtOrDecl *S, CheckFunction
Function) {
520 auto CacheIt = Cache.find(S);
521 if (CacheIt != Cache.end() && !OffendingStmt)
522 return CacheIt->second;
525 auto [RecursiveIt, IsNew] = RecursiveFn.insert(std::make_pair(S,
true));
527 return RecursiveIt->second;
532 for (
auto &It : RecursiveFn)
535 RecursiveIt = RecursiveFn.find(S);
536 assert(RecursiveIt != RecursiveFn.end());
537 Result = RecursiveIt->second;
538 RecursiveFn.erase(RecursiveIt);
544 bool CanTriviallyDestruct(
QualType Ty) {
561 if (HasFieldWithNonTrivialDtor(R))
577 return CanTriviallyDestruct(AT->getElementType());
583 auto CacheIt = FieldDtorCache.find(Cls);
584 if (CacheIt != FieldDtorCache.end())
585 return CacheIt->second;
590 if (!CanTriviallyDestruct(F->getType()))
596 if (HasNonTrivialField(Cls))
609 auto *R = T->getAsCXXRecordDecl();
610 return R && HasNonTrivialField(R);
615 FieldDtorCache[Cls] =
Result;
621 using CacheTy = TrivialFunctionAnalysis::CacheTy;
624 const Stmt **OffendingStmt =
nullptr)
625 : Cache(Cache), OffendingStmt(OffendingStmt) {}
628 const Stmt **SavedOffendingStmt = std::exchange(OffendingStmt,
nullptr);
629 auto Result = WithCachedResult(D, [&]() {
630 if (
auto *FnDecl = dyn_cast<FunctionDecl>(D)) {
633 if (
auto *MD = dyn_cast<CXXMethodDecl>(D); MD && MD->isVirtual())
635 for (
auto *Param : FnDecl->parameters()) {
640 if (
auto *CtorDecl = dyn_cast<CXXConstructorDecl>(D)) {
641 for (
auto *CtorInit : CtorDecl->inits()) {
642 if (!
Visit(CtorInit->getInit()))
651 OffendingStmt = SavedOffendingStmt;
656 return WithCachedResult(
657 VD, [&] {
return CanTriviallyDestruct(VD->
getType()); });
661 auto CacheIt = Cache.find(S);
662 if (CacheIt != Cache.end())
663 return CacheIt->second;
683 return WithCachedResult(CS, [&]() {
return VisitChildren(CS); });
687 return WithCachedResult(CBS, [&]() {
return VisitChildren(CBS); });
700 if (
auto *VD = dyn_cast<VarDecl>(
Decl)) {
705 return VisitChildren(DS);
709 return WithCachedResult(IS, [&]() {
return VisitChildren(IS); });
712 return WithCachedResult(FS, [&]() {
return VisitChildren(FS); });
715 return WithCachedResult(FS, [&]() {
return VisitChildren(FS); });
718 return WithCachedResult(WS, [&]() {
return VisitChildren(WS); });
743 return VisitChildren(CAO);
747 return VisitChildren(ASE);
752 return VisitChildren(CO);
775 if (Callee->isInStdNamespace() &&
776 (Name ==
"addressof" || Name ==
"forward" || Name ==
"move"))
779 if (Name ==
"WTFCrashWithInfo" || Name ==
"WTFBreakpointTrap" ||
780 Name ==
"WTFReportBacktrace" ||
781 Name ==
"WTFCrashWithSecurityImplication" || Name ==
"WTFCrash" ||
782 Name ==
"WTFReportAssertionFailure" || Name ==
"isMainThread" ||
783 Name ==
"isMainThreadOrGCThread" || Name ==
"isMainRunLoop" ||
784 Name ==
"isWebThread" || Name ==
"isUIThread" ||
785 Name ==
"mayBeGCThread" || Name ==
"compilerFenceForCrash" ||
803 return VisitChildren(E);
833 if (Name ==
"ref" || Name ==
"incrementCheckedPtrCount")
837 if (IsGetterOfRefCounted && *IsGetterOfRefCounted)
856 return SemanticExpr &&
Visit(SemanticExpr);
873 if (Arg && !
Visit(Arg))
881 if (Arg && !
Visit(Arg))
936 if (Child && !
Visit(Child))
982 CacheTy FieldDtorCache;
984 const Stmt **OffendingStmt;
987bool TrivialFunctionAnalysis::isTrivialImpl(
988 const Decl *D, TrivialFunctionAnalysis::CacheTy &
Cache,
989 const Stmt **OffendingStmt) {
991 return V.IsFunctionTrivial(D);
994bool TrivialFunctionAnalysis::isTrivialImpl(
995 const Stmt *S, TrivialFunctionAnalysis::CacheTy &
Cache,
996 const Stmt **OffendingStmt) {
998 return V.IsStatementTrivial(S);
1001bool TrivialFunctionAnalysis::hasTrivialDtorImpl(
const VarDecl *VD,
1004 return V.HasTrivialDestructor(VD);
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
Defines the clang::Expr interface and subclasses for C++ expressions.
TypePropertyCache< Private > Cache
QualType getTypedefType(ElaboratedTypeKeyword Keyword, NestedNameSpecifier Qualifier, const TypedefNameDecl *Decl, QualType UnderlyingType=QualType(), std::optional< bool > TypeMatchesDeclOrNone=std::nullopt) const
Return the unique reference to the type for the specified typedef-name decl.
Represents the index of the current element of an array being initialized by an ArrayInitLoopExpr.
Represents a loop initializing the elements of an array.
OpaqueValueExpr * getCommonExpr() const
Get the common subexpression shared by all initializations (the source array).
Expr * getSubExpr() const
Get the initializer to use for each array element.
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load,...
Attr - This represents one attribute.
Represents an attribute applied to a statement.
A builtin binary operation expression such as "x + y" or "x <= y".
BreakStmt - This represents a break.
Represents a path from a specific derived class (which is not represented as part of the path) to a p...
BasePaths - Represents the set of paths from a derived class to one of its (direct or indirect) bases...
void setOrigin(const CXXRecordDecl *Rec)
void clear()
Clear the base-paths results.
Represents a base class of a C++ class.
QualType getType() const
Retrieves the type of the base class.
Represents binding an expression to a temporary.
CXXTemporary * getTemporary()
const Expr * getSubExpr() const
A boolean literal, per ([C++ lex.bool] Boolean literals).
Represents a call to a C++ constructor.
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will (ultimately) call.
A default argument (C++ [dcl.fct.default]).
A use of a default initializer in a constructor or in aggregate initialization.
Expr * getExpr()
Get the initialization expression that will be used.
CXXForRangeStmt - This represents C++0x [stmt.ranged]'s ranged for statement, represented as 'for (ra...
Represents a call to an inherited base class constructor from an inheriting constructor.
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will call.
Represents a call to a member function that may be written either with member call syntax (e....
CXXMethodDecl * getMethodDecl() const
Retrieve the declaration of the called method.
Expr * getImplicitObjectArgument() const
Retrieve the implicit object argument for the member call.
QualType getObjectType() const
Retrieve the type of the object argument.
Represents a static or instance method of a struct/union/class.
const CXXRecordDecl * getParent() const
Return the parent of this method declaration, which is the class in which this method is defined.
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)".
The null pointer literal (C++11 [lex.nullptr])
A call to an overloaded operator written using operator syntax.
Represents a C++ struct/union/class.
bool hasTrivialDestructor() const
Determine whether this class has a trivial destructor (C++ [class.dtor]p3)
method_range methods() const
CXXRecordDecl * getDefinition() const
const CXXRecordDecl * getTemplateInstantiationPattern() const
Retrieve the record declaration from which this record could be instantiated.
bool lookupInBases(BaseMatchesCallback BaseMatches, CXXBasePaths &Paths, bool LookupInDependent=false) const
Look for entities within the base classes of this C++ class, transitively searching all base class su...
bool hasDefinition() const
CXXDestructorDecl * getDestructor() const
Returns the destructor decl for this class.
A rewritten comparison expression that was originally written using operator syntax.
Expr * getSemanticForm()
Get an equivalent semantic form for this expression.
Represents the this expression in C++.
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
FunctionDecl * getDirectCallee()
If the callee is a FunctionDecl, return it. Otherwise return null.
CaseStmt - Represent a case statement.
CompoundAssignOperator - For compound assignments (e.g.
CompoundStmt - This represents a group of statements like { stmt stmt }.
ConditionalOperator - The ?
ConstStmtVisitor - This class implements a simple visitor for Stmt subclasses.
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
ContinueStmt - This represents a continue.
Represents the body of a coroutine.
DeclContext * getParent()
getParent - Returns the containing DeclContext.
A reference to a declared variable, function, enum, etc.
DeclStmt - Adaptor class for mixing declarations with statements and expressions.
Decl - This represents one declaration (or definition), e.g.
ASTContext & getASTContext() const LLVM_READONLY
virtual Stmt * getBody() const
getBody - If this Decl represents a declaration for a body of code, such as a function or method defi...
const LangOptions & getLangOpts() const LLVM_READONLY
Helper to get the language options from the ASTContext.
bool isIdentifier() const
Predicate functions for querying what type of name this is.
DoStmt - This represents a 'do/while' stmt.
ExplicitCastExpr - An explicit cast written in the source code.
Represents an expression – generally a full-expression – that introduces cleanups to be run at the en...
This represents one expression.
Represents a member of a struct/union/class.
ForStmt - This represents a 'for (init;cond;inc)' stmt.
const Expr * getSubExpr() const
Represents a function declaration or definition.
QualType getReturnType() const
redecl_range redecls() const
Returns an iterator range for all the redeclarations of the same decl.
This represents a GCC inline-assembly statement extension.
std::string getAsmString() const
GotoStmt - This represents a direct goto.
IfStmt - This represents an if/then/else.
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Represents an implicitly-generated value initialization of an object of a given type.
Describes an C or C++ initializer list.
ArrayRef< Expr * > inits()
LabelStmt - Represents a label, which has a substatement.
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
Expr * getSubExpr() const
Retrieve the temporary-generating subexpression whose value will be materialized into a glvalue.
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
This represents a decl that may have a name.
StringRef getName() const
Get the name of identifier for this declaration as a StringRef.
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
OffsetOfExpr - [C99 7.17] - This represents an expression of the form offsetof(record-type,...
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class.
Expr * getSourceExpr() const
The source expression of an opaque value expression is the expression which originally generated the ...
ParenExpr - This represents a parenthesized expression, e.g.
const Expr * getSubExpr() const
[C99 6.4.2.2] - A predefined identifier such as func.
A (possibly-)qualified type.
bool isNull() const
Return true if this QualType doesn't point to a type yet.
const Type * getTypePtr() const
Retrieves a pointer to the underlying (unqualified) type.
QualType getCanonicalType() const
const Type * getTypePtrOrNull() const
field_range fields() const
bool isUnretained(const QualType, bool ignoreARC=false)
void visitTranslationUnitDecl(const TranslationUnitDecl *)
void visitTypedef(const TypedefDecl *)
ReturnStmt - This represents a return, optionally of an expression: return; return 4;.
Represents a C++11 static_assert declaration.
bool Visit(PTR(Stmt) S, ParamTys... P)
Stmt - This represents one statement.
StringLiteral - This represents a string literal expression, e.g.
Represents a reference to a non-type template parameter that has been substituted with a template arg...
SwitchStmt - This represents a 'switch' stmt.
The top declaration context.
bool VisitMemberExpr(const MemberExpr *ME)
bool VisitStringLiteral(const StringLiteral *E)
bool HasTrivialDestructor(const VarDecl *VD)
bool VisitStaticAssertDecl(const StaticAssertDecl *SAD)
bool VisitCXXBindTemporaryExpr(const CXXBindTemporaryExpr *BTE)
bool VisitBreakStmt(const BreakStmt *)
bool VisitCXXThisExpr(const CXXThisExpr *CTE)
bool IsFunctionTrivial(const Decl *D)
bool VisitLabelStmt(const LabelStmt *)
bool IsStatementTrivial(const Stmt *S)
bool VisitUnaryOperator(const UnaryOperator *UO)
bool VisitArrayInitLoopExpr(const ArrayInitLoopExpr *AILE)
bool VisitPredefinedExpr(const PredefinedExpr *E)
bool VisitContinueStmt(const ContinueStmt *)
bool VisitSwitchStmt(const SwitchStmt *SS)
bool VisitGCCAsmStmt(const GCCAsmStmt *AS)
bool VisitCompoundAssignOperator(const CompoundAssignOperator *CAO)
bool VisitCXXDefaultArgExpr(const CXXDefaultArgExpr *E)
bool VisitFixedPointLiteral(const FixedPointLiteral *E)
bool VisitCXXDefaultInitExpr(const CXXDefaultInitExpr *E)
bool VisitDeclRefExpr(const DeclRefExpr *DRE)
bool VisitDoStmt(const DoStmt *DS)
bool VisitIfStmt(const IfStmt *IS)
bool VisitIntegerLiteral(const IntegerLiteral *E)
bool VisitMaterializeTemporaryExpr(const MaterializeTemporaryExpr *VMT)
bool VisitCXXInheritedCtorInitExpr(const CXXInheritedCtorInitExpr *E)
bool VisitCXXRewrittenBinaryOperator(const CXXRewrittenBinaryOperator *Op)
bool VisitFloatingLiteral(const FloatingLiteral *E)
TrivialFunctionAnalysis::CacheTy CacheTy
bool VisitCaseStmt(const CaseStmt *CS)
bool VisitDeclStmt(const DeclStmt *DS)
bool VisitConditionalOperator(const ConditionalOperator *CO)
bool VisitSubstNonTypeTemplateParmExpr(const SubstNonTypeTemplateParmExpr *E)
bool VisitCompoundStmt(const CompoundStmt *CS)
bool VisitImplicitValueInitExpr(const ImplicitValueInitExpr *IVIE)
bool VisitConstantExpr(const ConstantExpr *CE)
bool VisitImplicitCastExpr(const ImplicitCastExpr *ICE)
bool VisitCXXOperatorCallExpr(const CXXOperatorCallExpr *OCE)
bool VisitCXXNullPtrLiteralExpr(const CXXNullPtrLiteralExpr *E)
bool VisitOpaqueValueExpr(const OpaqueValueExpr *OVE)
bool VisitExprWithCleanups(const ExprWithCleanups *EWC)
bool VisitArraySubscriptExpr(const ArraySubscriptExpr *ASE)
bool VisitCallExpr(const CallExpr *CE)
bool VisitForStmt(const ForStmt *FS)
bool VisitCXXNewExpr(const CXXNewExpr *NE)
bool VisitBinaryOperator(const BinaryOperator *BO)
bool checkArguments(const CallExpr *CE)
bool VisitCoroutineBodyStmt(const CoroutineBodyStmt *CBS)
bool VisitCXXMemberCallExpr(const CXXMemberCallExpr *MCE)
bool VisitCXXForRangeStmt(const CXXForRangeStmt *FS)
bool VisitGotoStmt(const GotoStmt *)
bool VisitWhileStmt(const WhileStmt *WS)
bool VisitCharacterLiteral(const CharacterLiteral *E)
bool VisitInitListExpr(const InitListExpr *ILE)
bool VisitAttributedStmt(const AttributedStmt *AS)
bool VisitUnaryExprOrTypeTraitExpr(const UnaryExprOrTypeTraitExpr *E)
bool VisitAtomicExpr(const AtomicExpr *E)
bool VisitStmt(const Stmt *S)
bool VisitCXXBoolLiteralExpr(const CXXBoolLiteralExpr *E)
bool VisitExplicitCastExpr(const ExplicitCastExpr *ECE)
bool VisitArrayInitIndexExpr(const ArrayInitIndexExpr *AIIE)
bool VisitParenExpr(const ParenExpr *PE)
bool VisitDefaultStmt(const DefaultStmt *DS)
bool VisitOffsetOfExpr(const OffsetOfExpr *OE)
bool VisitCXXConstructExpr(const CXXConstructExpr *CE)
TrivialFunctionAnalysisVisitor(CacheTy &Cache, const Stmt **OffendingStmt=nullptr)
bool VisitReturnStmt(const ReturnStmt *RS)
friend class TrivialFunctionAnalysisVisitor
The base class of the type hierarchy.
bool isFundamentalType() const
Tests whether the type is categorized as a fundamental type.
CXXRecordDecl * getAsCXXRecordDecl() const
Retrieves the CXXRecordDecl that this type refers to, either because the type is a RecordType or beca...
QualType getPointeeType() const
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee.
bool isIntegralOrEnumerationType() const
Determine whether this type is an integral or enumeration type.
const ArrayType * getAsArrayTypeUnsafe() const
A variant of getAs<> for array types which silently discards qualifiers from the outermost type.
bool isPointerOrReferenceType() const
const T * getAsCanonical() const
If this type is canonically the specified type, return its canonical type cast to that specified type...
bool isRecordType() const
Represents the declaration of a typedef-name via the 'typedef' type specifier.
QualType getUnderlyingType() const
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand.
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
Expr * getSubExpr() const
Represents a variable declaration or definition.
WhileStmt - This represents a 'while' stmt.
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
bool isCocoaObjectRef(QualType T)
The JSON file list parser is used to communicate input to InstallAPI.
bool isCtorOfSafePtr(const clang::FunctionDecl *F)
bool isTrivialBuiltinFunction(const FunctionDecl *F)
bool isa(CodeGen::Address addr)
static bool isNoDeleteFunctionDecl(const FunctionDecl *F)
bool isPtrConversion(const FunctionDecl *F)
std::optional< bool > isCheckedPtrCapable(const clang::CXXRecordDecl *R)
std::optional< bool > isUnchecked(const QualType T)
bool isCtorOfRefCounted(const clang::FunctionDecl *F)
bool isRefOrCheckedPtrType(const clang::QualType T)
bool isRetainPtrOrOSPtrType(const clang::QualType T)
bool isCtorOfRetainPtrOrOSPtr(const clang::FunctionDecl *F)
@ Result
The result type of a method or function.
bool isOwnerPtr(const std::string &Name)
std::optional< bool > isRefCountable(const clang::CXXRecordDecl *R)
std::optional< const clang::CXXRecordDecl * > hasPublicMethodInBase(const CXXBaseSpecifier *Base, StringRef NameToMatch)
static WebKitAnnotation typeAnnotationForReturnType(const FunctionDecl *FD)
bool isSmartPtrClass(const std::string &Name)
bool isRefCounted(const CXXRecordDecl *R)
static bool isPtrOfType(const clang::QualType T, Predicate Pred)
std::optional< bool > isSmartPtrCompatible(const CXXRecordDecl *R, StringRef IncMethodName, StringRef DecMethodName)
bool isNoDeleteFunction(const FunctionDecl *F)
bool isOwnerPtrType(const clang::QualType T)
bool isSmartPtr(const CXXRecordDecl *R)
std::optional< bool > isGetterOfSafePtr(const CXXMethodDecl *M)
bool isRetainPtrOrOSPtr(const std::string &Name)
bool isRefType(const std::string &Name)
std::optional< bool > isUncountedPtr(const QualType T)
std::string safeGetName(const T *ASTNode)
bool isCtorOfCheckedPtr(const clang::FunctionDecl *F)
bool isSingleton(const NamedDecl *F)
bool isCheckedPtr(const std::string &Name)
bool isStdOrWTFMove(const clang::FunctionDecl *F)
@ None
The alignment was not explicit in code.
@ None
No keyword precedes the qualified type name.
@ Class
The "class" keyword introduces the elaborated-type-specifier.
std::optional< bool > isUncounted(const QualType T)
std::optional< bool > isUncheckedPtr(const QualType T)