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:
Slava Pestov
2016-12-04 00:17:14 -08:00
parent 705da29987
commit c1a216137c
2 changed files with 5 additions and 8 deletions

View File

@@ -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

View File

@@ -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 {