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;
|
||||
}
|
||||
|
||||
/// The interface type, mutable because some subclasses compute this lazily.
|
||||
mutable Type InterfaceTy;
|
||||
|
||||
public:
|
||||
/// \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
|
||||
|
||||
@@ -1645,12 +1645,12 @@ ValueDecl::getSatisfiedProtocolRequirements(bool Sorted) const {
|
||||
}
|
||||
|
||||
bool ValueDecl::hasInterfaceType() const {
|
||||
return !!InterfaceTy;
|
||||
return !TypeAndAccess.getPointer().isNull();
|
||||
}
|
||||
|
||||
Type ValueDecl::getInterfaceType() const {
|
||||
assert(InterfaceTy && "No interface type was set");
|
||||
return InterfaceTy;
|
||||
assert(hasInterfaceType() && "No interface type was set");
|
||||
return TypeAndAccess.getPointer();
|
||||
}
|
||||
|
||||
void ValueDecl::setInterfaceType(Type type) {
|
||||
@@ -1668,8 +1668,8 @@ void ValueDecl::setInterfaceType(Type type) {
|
||||
assert(!type->hasTypeVariable() &&
|
||||
"Archetype in interface type");
|
||||
}
|
||||
|
||||
InterfaceTy = type;
|
||||
|
||||
TypeAndAccess.setPointer(type);
|
||||
}
|
||||
|
||||
Optional<ObjCSelector> ValueDecl::getObjCRuntimeName() const {
|
||||
|
||||
Reference in New Issue
Block a user