;
219: II(nullptr), S(
s) {}
237ID.AddInteger((
unsigned)
X.getKind());
238ID.AddInteger((
unsigned)
X.getObjKind());
243ID.AddInteger((
unsigned)
X.getKind());
244ID.AddInteger((
unsigned)
X.getObjKind());
250 return ObjCSummaryKey(DenseMapInfo<IdentifierInfo*>::getEmptyKey(),
251DenseMapInfo<Selector>::getEmptyKey());
255 return ObjCSummaryKey(DenseMapInfo<IdentifierInfo*>::getTombstoneKey(),
256DenseMapInfo<Selector>::getTombstoneKey());
260 typedefstd::pair<IdentifierInfo*, Selector> PairTy;
261 returnDenseMapInfo<PairTy>::getHashValue(PairTy(
V.getIdentifier(),
310: Args(A), DefaultArgEffect(defaultEff), Receiver(ReceiverEff),
311This(ThisEff), Ret(R) {}
316 if(
const ArgEffect*AE = Args.lookup(idx))
319 returnDefaultArgEffect;
323Args = af.add(Args, idx, e);
328DefaultArgEffect =
E;
364 returnArgs ==
Other.Args && DefaultArgEffect ==
Other.DefaultArgEffect &&
365Receiver ==
Other.Receiver && This ==
Other.This && Ret ==
Other.Ret;
369 void Profile(llvm::FoldingSetNodeID& ID)
const{
371ID.Add(DefaultArgEffect);
379 returnArgs.isEmpty();
385 ArgEffectgetDefaultArgEffect()
const{
returnDefaultArgEffect; }
391 typedefllvm::DenseMap<ObjCSummaryKey, const RetainSummary *> MapTy;
400MapTy::iterator I = M.find(K);
436 returnI == M.end() ? nullptr : I->second;
451 typedefllvm::DenseMap<const FunctionDecl*, const RetainSummary *>
456 typedefllvm::FoldingSetNodeWrapper<RetainSummary> CachedSummaryNode;
462 const boolARCEnabled;
465 const boolTrackObjCAndCFObjects;
468 const boolTrackOSObjects;
471FuncSummariesTy FuncSummaries;
482llvm::BumpPtrAllocator BPAlloc;
485ArgEffects::Factory AF;
497llvm::FoldingSet<CachedSummaryNode> SimpleSummaries;
528 RetainSummarySumm(ScratchArgs, RetEff, DefaultEff, ReceiverEff, ThisEff);
529 returngetPersistentSummary(Summ);
545 returngetPersistentSummary(
550 voidInitializeClassMethodSummaries();
551 voidInitializeMethodSummaries();
554ObjCClassMethodSummaries[S] = Summ;
558ObjCMethodSummaries[S] = Summ;
561 voidaddClassMethSummary(
const char* Cls,
const char* name,
569 voidaddInstMethSummary(
const char* Cls,
const char* nullaryName,
576 template<
typename... Keywords>
583 template<
typename... Keywords>
584 voidaddInstMethSummary(
const char*Cls,
const RetainSummary*Summ,
586addMethodSummary(&Ctx.
Idents.
get(Cls), ObjCMethodSummaries, Summ, Kws...);
589 template<
typename... Keywords>
590 voidaddClsMethSummary(
const char*Cls,
const RetainSummary*Summ,
592addMethodSummary(&Ctx.
Idents.
get(Cls), ObjCClassMethodSummaries, Summ,
596 template<
typename... Keywords>
599addMethodSummary(II, ObjCClassMethodSummaries, Summ, Kws...);
603 bool&AllowAnnotations);
615 bool&AllowAnnotations);
620 boolapplyParamAnnotationEffect(
const ParmVarDecl*pd,
unsignedparm_idx,
627: Ctx(ctx), ARCEnabled((
bool)Ctx.getLangOpts().ObjCAutoRefCount),
628TrackObjCAndCFObjects(trackObjCAndCFObjects),
629TrackOSObjects(trackOSObjects), AF(BPAlloc),
633:
RetEffect::MakeOwnedWhenTrackedReceiver()) {
634InitializeClassMethodSummaries();
635InitializeMethodSummaries();
652std::optional<BehaviorSummary>
654 bool&hasTrustedImplementationAnnotation);
663 boolHasNonZeroCallbackArg=
false,
664 boolIsReceiverUnconsumedSelf=
false,
680ObjCMethodSummariesTy &CachedSummaries);
691std::optional<RetEffect> getRetEffectFromAnnotations(
QualTypeRetTy,
694 voidupdateSummaryFromAnnotations(
const RetainSummary*&Summ,
697 voidupdateSummaryFromAnnotations(
const RetainSummary*&Summ,
715 voidupdateSummaryForReceiverUnconsumedSelf(
const RetainSummary*&S);
728std::optional<ObjKind> hasAnyEnabledAttrOf(
const Decl*
D,
QualTypeQT);
730 template<
classT1,
classT2,
class... Others>
731std::optional<ObjKind> hasAnyEnabledAttrOf(
const Decl*
D,
QualTypeQT);
748: Manager(mgr), RealSummary(real), ScratchSummary(*real), Accessed(
false) {}
752RealSummary = Manager.getPersistentSummary(ScratchSummary);
757 returnScratchSummary;
762 return&ScratchSummary;
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
__device__ __2f16 float __ockl_bool s
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
An instance of this class corresponds to a call.
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Decl - This represents one declaration (or definition), e.g.
Represents a function declaration or definition.
FunctionType - C99 6.7.5.3 - Function Declarators.
One of these records is kept for each identifier that is lexed.
IdentifierInfo & get(StringRef Name)
Return the identifier token info for the specified named identifier.
This represents a decl that may have a name.
Represents an ObjC class declaration.
An expression that sends a message to the given Objective-C object or class.
ObjCMethodDecl - Represents an instance or class method declaration.
Represents a parameter to a function.
A (possibly-)qualified type.
Smart pointer class that efficiently represents Objective-C method names.
An ArgEffect summarizes the retain count behavior on an argument or receiver to a function or method.
ArgEffect withKind(ArgEffectKind NewK)
ObjKind getObjKind() const
bool operator==(const ArgEffect &Other) const
ArgEffect(ArgEffectKind K=DoNothing, ObjKind O=ObjKind::AnyObj)
ArgEffectKind getKind() const
const RetainSummary * find(const ObjCInterfaceDecl *D, Selector S)
const RetainSummary *& operator[](Selector S)
const RetainSummary * find(IdentifierInfo *II, Selector S)
const RetainSummary *& operator[](ObjCSummaryKey K)
A key identifying a summary.
ObjCSummaryKey(const ObjCInterfaceDecl *d, Selector s)
IdentifierInfo * getIdentifier() const
Selector getSelector() const
ObjCSummaryKey(IdentifierInfo *ii, Selector s)
ObjCSummaryKey(Selector s)
RetEffect summarizes a call's retain/release behavior with respect to its return value.
static RetEffect MakeNotOwned(ObjKind o)
ObjKind getObjKind() const
static RetEffect MakeOwned(ObjKind o)
@ OwnedSymbol
Indicates that the returned value is an owned (+1) symbol.
@ OwnedWhenTrackedReceiver
Indicates that the return value is an owned object when the receiver is also a tracked object.
@ NoRet
Indicates that no retain count information is tracked for the return value.
@ NotOwnedSymbol
Indicates that the returned value is an object with retain count semantics but that it is not owned (...
static RetEffect MakeNoRet()
static RetEffect MakeOwnedWhenTrackedReceiver()
static RetEffect MakeNoRetHard()
bool operator==(const RetEffect &Other) const
bool isTrustedReferenceCountImplementation(const Decl *FD)
std::optional< BehaviorSummary > canEval(const CallExpr *CE, const FunctionDecl *FD, bool &hasTrustedImplementationAnnotation)
static bool isKnownSmartPointer(QualType QT)
const RetainSummary * getSummary(AnyCall C, bool HasNonZeroCallbackArg=false, bool IsReceiverUnconsumedSelf=false, QualType ReceiverType={})
RetEffect getObjAllocRetEffect() const
RetainSummaryManager(ASTContext &ctx, bool trackObjCAndCFObjects, bool trackOSObjects)
RetainSummaryTemplate(const RetainSummary *&real, RetainSummaryManager &mgr)
RetainSummary * operator->()
RetainSummary & operator*()
Summary for a function with respect to ownership changes.
void setRetEffect(RetEffect E)
setRetEffect - Set the effect of the return value of the call.
ArgEffect getThisEffect() const
void setDefaultArgEffect(ArgEffect E)
setDefaultArgEffect - Set the default argument effect.
RetainSummary(ArgEffects A, RetEffect R, ArgEffect defaultEff, ArgEffect ReceiverEff, ArgEffect ThisEff)
void addArg(ArgEffects::Factory &af, unsigned idx, ArgEffect e)
ArgEffect getReceiverEffect() const
getReceiverEffect - Returns the effect on the receiver of the call.
RetEffect getRetEffect() const
getRetEffect - Returns the effect on the return value of the call.
bool isSimple() const
A retain summary is simple if it has no ArgEffects other than the default.
ArgEffects getArgEffects() const
ArgEffect getDefaultEffect() const
void setThisEffect(ArgEffect e)
Set the effect of the method on "this".
ArgEffect getArg(unsigned idx) const
getArg - Return the argument effect on the argument specified by idx (starting from 0).
void setReceiverEffect(ArgEffect e)
Sets the effect on the receiver of the message.
bool operator==(const RetainSummary &Other) const
Test if two retain summaries are identical.
void Profile(llvm::FoldingSetNodeID &ID) const
Profile this summary for inclusion in a FoldingSet.
llvm::ImmutableMap< unsigned, ArgEffect > ArgEffects
ArgEffects summarizes the effects of a function/method call on all of its arguments.
ObjKind
Determines the object kind of a tracked object.
@ OS
Indicates that the tracking object is a descendant of a referenced-counted OSObject,...
@ Generalized
Indicates that the tracked object is a generalized object.
@ CF
Indicates that the tracked object is a CF object.
@ AnyObj
Indicates that the tracked object could be a CF or Objective-C object.
@ ObjC
Indicates that the tracked object is an Objective-C object.
@ IncRef
The argument has its reference count increased by 1.
@ UnretainedOutParameter
The argument is a pointer to a retain-counted object; on exit, the new value of the pointer is a +0 v...
@ DoNothing
There is no effect.
@ RetainedOutParameter
The argument is a pointer to a retain-counted object; on exit, the new value of the pointer is a +1 v...
@ RetainedOutParameterOnZero
The argument is a pointer to a retain-counted object; on exit, the new value of the pointer is a +1 v...
@ MayEscape
The argument is treated as potentially escaping, meaning that even when its reference count hits 0 it...
@ StopTracking
All typestate tracking of the object ceases.
@ Dealloc
The argument is treated as if the referenced object was deallocated.
@ Autorelease
The argument is treated as if an -autorelease message had been sent to the referenced object.
@ RetainedOutParameterOnNonZero
The argument is a pointer to a retain-counted object; on exit, the new value of the pointer is a +1 v...
@ DecRef
The argument has its reference count decreased by 1.
@ StopTrackingHard
All typestate tracking of the object ceases.
@ DecRefAndStopTrackingHard
Performs the combined functionality of DecRef and StopTrackingHard.
@ DecRefBridgedTransferred
The argument has its reference count decreased by 1 to model a transferred bridge cast under ARC.
The JSON file list parser is used to communicate input to InstallAPI.
static Selector getKeywordSelector(ASTContext &Ctx, const IdentifierInfos *...IIs)
Selector GetUnarySelector(StringRef name, ASTContext &Ctx)
Utility function for constructing an unary selector.
Selector GetNullarySelector(StringRef name, ASTContext &Ctx)
Utility function for constructing a nullary selector.
@ Other
Other implicit parameter.
Diagnostic wrappers for TextAPI types for error reporting.
static unsigned getHashValue(const ObjCSummaryKey &V)
static ObjCSummaryKey getEmptyKey()
static bool isEqual(const ObjCSummaryKey &LHS, const ObjCSummaryKey &RHS)
static ObjCSummaryKey getTombstoneKey()
static void Profile(const ArgEffect X, FoldingSetNodeID &ID)
static void Profile(const RetEffect &X, FoldingSetNodeID &ID)
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