class FunctionScopeInfo::WeakObjectProfileTy
Declaration
class FunctionScopeInfo::WeakObjectProfileTy { /* full declaration omitted */ };
Description
Represents a simple identification of a weak object. Part of the implementation of -Wrepeated-use-of-weak. This is used to determine if two weak accesses refer to the same object. Here are some examples of how various accesses are "profiled": Access Expression | "Base" Decl | "Property" Decl :---------------: | :-----------------: | :------------------------------: self.property | self (VarDecl) | property (ObjCPropertyDecl) self.implicitProp | self (VarDecl) | -implicitProp (ObjCMethodDecl) self->ivar.prop | ivar (ObjCIvarDecl) | prop (ObjCPropertyDecl) cxxObj.obj.prop | obj (FieldDecl) | prop (ObjCPropertyDecl) [self foo].prop | 0 (unknown) | prop (ObjCPropertyDecl) self.prop1.prop2 | prop1 (ObjCPropertyDecl) | prop2 (ObjCPropertyDecl) MyClass.prop | MyClass (ObjCInterfaceDecl) | -prop (ObjCMethodDecl) MyClass.foo.prop | +foo (ObjCMethodDecl) | -prop (ObjCPropertyDecl) weakVar | 0 (known) | weakVar (VarDecl) self->weakIvar | self (VarDecl) | weakIvar (ObjCIvarDecl) Objects are identified with only two Decls to make it reasonably fast to compare them.
Declared at: clang/include/clang/Sema/ScopeInfo.h:259
Member Variables
- private clang::sema::FunctionScopeInfo:: WeakObjectProfileTy::BaseInfoTy Base
- private const clang::NamedDecl* Property = nullptr
- Note that this may not actually be an ObjCPropertyDecl, e.g. in the case of "implicit" properties (regular methods accessed via dot syntax).
Method Overview
- private inline WeakObjectProfileTy()
- public WeakObjectProfileTy(const clang::ObjCPropertyRefExpr * RE)
- public WeakObjectProfileTy(const clang::Expr * Base, const clang::ObjCPropertyDecl * Property)
- public WeakObjectProfileTy(const clang::DeclRefExpr * RE)
- public WeakObjectProfileTy(const clang::ObjCIvarRefExpr * RE)
- public const clang::NamedDecl * getBase() const
- private static clang::sema::FunctionScopeInfo::WeakObjectProfileTy::BaseInfoTy getBaseInfo(const clang::Expr * BaseE)
- public const clang::NamedDecl * getProperty() const
- private static inline clang::sema::FunctionScopeInfo::WeakObjectProfileTy getSentinel()
- public bool isExactProfile() const
Methods
¶inline WeakObjectProfileTy()
inline WeakObjectProfileTy()
Declared at: clang/include/clang/Sema/ScopeInfo.h:278
¶WeakObjectProfileTy(
const clang::ObjCPropertyRefExpr* RE)
WeakObjectProfileTy(
const clang::ObjCPropertyRefExpr* RE)
Declared at: clang/include/clang/Sema/ScopeInfo.h:282
Parameters
- const clang::ObjCPropertyRefExpr* RE
¶WeakObjectProfileTy(
const clang::Expr* Base,
const clang::ObjCPropertyDecl* Property)
WeakObjectProfileTy(
const clang::Expr* Base,
const clang::ObjCPropertyDecl* Property)
Declared at: clang/include/clang/Sema/ScopeInfo.h:283
Parameters
- const clang::Expr* Base
- const clang::ObjCPropertyDecl* Property
¶WeakObjectProfileTy(const clang::DeclRefExpr* RE)
WeakObjectProfileTy(const clang::DeclRefExpr* RE)
Declared at: clang/include/clang/Sema/ScopeInfo.h:284
Parameters
- const clang::DeclRefExpr* RE
¶WeakObjectProfileTy(
const clang::ObjCIvarRefExpr* RE)
WeakObjectProfileTy(
const clang::ObjCIvarRefExpr* RE)
Declared at: clang/include/clang/Sema/ScopeInfo.h:285
Parameters
- const clang::ObjCIvarRefExpr* RE
¶const clang::NamedDecl* getBase() const
const clang::NamedDecl* getBase() const
Declared at: clang/include/clang/Sema/ScopeInfo.h:287
¶static clang::sema::FunctionScopeInfo::
WeakObjectProfileTy::BaseInfoTy
getBaseInfo(const clang::Expr* BaseE)
static clang::sema::FunctionScopeInfo::
WeakObjectProfileTy::BaseInfoTy
getBaseInfo(const clang::Expr* BaseE)
Description
Used to find the proper base profile for a given base expression.
Declared at: clang/include/clang/Sema/ScopeInfo.h:276
Parameters
- const clang::Expr* BaseE
¶const clang::NamedDecl* getProperty() const
const clang::NamedDecl* getProperty() const
Declared at: clang/include/clang/Sema/ScopeInfo.h:288
¶static inline clang::sema::FunctionScopeInfo::
WeakObjectProfileTy
getSentinel()
static inline clang::sema::FunctionScopeInfo::
WeakObjectProfileTy
getSentinel()
Declared at: clang/include/clang/Sema/ScopeInfo.h:279
¶bool isExactProfile() const
bool isExactProfile() const
Description
Returns true if the object base specifies a known object in memory, rather than, say, an instance variable or property of another object. Note that this ignores the effects of aliasing; that is, \c foo.bar is considered an exact profile if \c foo is a local variable, even if another variable \c foo2 refers to the same object as \c foo. For increased precision, accesses with base variables that are properties or ivars of 'self' (e.g. self.prop1.prop2) are considered to be exact, though this is not true for arbitrary variables (foo.prop1.prop2).
Declared at: clang/include/clang/Sema/ScopeInfo.h:301