mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
AST: Remove unnecessary field from ValueDecl
Now that getType() is gone, the pointer part of TypeAndAccess wasn't used. Stick InterfaceTy there, saving a word of storage.
This commit is contained in:
@@ -1943,9 +1943,6 @@ protected:
|
|||||||
ValueDeclBits.CheckedRedeclaration = false;
|
ValueDeclBits.CheckedRedeclaration = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The interface type, mutable because some subclasses compute this lazily.
|
|
||||||
mutable Type InterfaceTy;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// \brief Return true if this is a definition of a decl, not a forward
|
/// \brief Return true if this is a definition of a decl, not a forward
|
||||||
/// declaration (e.g. of a function) that is implemented outside of the
|
/// declaration (e.g. of a function) that is implemented outside of the
|
||||||
|
|||||||
@@ -1645,12 +1645,12 @@ ValueDecl::getSatisfiedProtocolRequirements(bool Sorted) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool ValueDecl::hasInterfaceType() const {
|
bool ValueDecl::hasInterfaceType() const {
|
||||||
return !!InterfaceTy;
|
return !TypeAndAccess.getPointer().isNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
Type ValueDecl::getInterfaceType() const {
|
Type ValueDecl::getInterfaceType() const {
|
||||||
assert(InterfaceTy && "No interface type was set");
|
assert(hasInterfaceType() && "No interface type was set");
|
||||||
return InterfaceTy;
|
return TypeAndAccess.getPointer();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ValueDecl::setInterfaceType(Type type) {
|
void ValueDecl::setInterfaceType(Type type) {
|
||||||
@@ -1669,7 +1669,7 @@ void ValueDecl::setInterfaceType(Type type) {
|
|||||||
"Archetype in interface type");
|
"Archetype in interface type");
|
||||||
}
|
}
|
||||||
|
|
||||||
InterfaceTy = type;
|
TypeAndAccess.setPointer(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
Optional<ObjCSelector> ValueDecl::getObjCRuntimeName() const {
|
Optional<ObjCSelector> ValueDecl::getObjCRuntimeName() const {
|
||||||
|
|||||||
Reference in New Issue
Block a user