|
ROSE 2.23.0
|
Describes an override relationship for one virtual function.
An override descriptor is stored on both sides of the relationship: in VirtualFunctionDesc::overriders() of the overridden function and in VirtualFunctionDesc::overridden() of the overriding function.
A declared override (the overriding function is declared in a class that derives from the class declaring the overridden function) has an invalid witness key. An implied override has a valid witness: the class at which a function inherited along the non-virtual inheritance chain first meets a function of a virtual base that it implements (e.g., in Java a superclass method implementing an interface method of a subclass, JLS 8.4.8.1). The overriding function's class is then not derived from the overridden function's class; only the witness is. Implied overrides are only computed when AbstractCompatibilityBridge::inheritedMethodsImplementVirtualBaseMethods returns true.
Definition at line 123 of file ClassHierarchyAnalysis.h.
#include <Rose/Common/Analysis/ClassHierarchyAnalysis.h>


Public Types | |
| using | base = std::tuple< FunctionKeyType, bool, ClassKeyType > |
| Base tuple type used for storage. | |
Public Member Functions | |
| OverrideDesc (FunctionKeyType fn, bool covariant) | |
| Constructs a descriptor for a declared override (no witness). | |
| FunctionKeyType | function () const |
| Returns the overriding or overridden function key. | |
| bool | covariantReturn () const |
| Returns true when the override uses a covariant return type. | |
| bool | adjustReturnObj () const |
| returns true of an object adjustment is needed upon return. | |
| ClassKeyType | witness () const |
| Returns the witness class of an implied override. | |
| bool | isImplied () const |
| Returns true when this is an implied override (see class description). | |
| using Rose::Common::Analysis::OverrideDesc::base = std::tuple<FunctionKeyType, bool, ClassKeyType> |
Base tuple type used for storage.
Definition at line 127 of file ClassHierarchyAnalysis.h.
|
inline |
Constructs a descriptor for a declared override (no witness).
| fn | overriding or overridden function key. |
| covariant | true if the override uses a covariant return type. |
Definition at line 133 of file ClassHierarchyAnalysis.h.
|
inline |
Returns the overriding or overridden function key.
Definition at line 139 of file ClassHierarchyAnalysis.h.
|
inline |
Returns true when the override uses a covariant return type.
Definition at line 143 of file ClassHierarchyAnalysis.h.
|
inline |
returns true of an object adjustment is needed upon return.
this should be a subset of covariantReturn() [only if the original and the new return types have different primary base classes], but currently we use the same value.
Definition at line 150 of file ClassHierarchyAnalysis.h.
|
inline |
Returns the witness class of an implied override.
Definition at line 155 of file ClassHierarchyAnalysis.h.
Referenced by isImplied().
|
inline |
Returns true when this is an implied override (see class description).
Definition at line 159 of file ClassHierarchyAnalysis.h.
References witness().