[IRGen] Adopt reference storage type meta-programming macros

This commit also fixes reference storage extra inhabitant bugs.
This commit is contained in:
David Zarzycki
2018-05-20 19:11:49 -04:00
parent b91bde4d14
commit 057bbb366a
26 changed files with 2040 additions and 2333 deletions

View File

@@ -179,13 +179,11 @@ IRGenModule::IRGenModule(IRGenerator &irgen,
RefCountedPtrTy = RefCountedStructTy->getPointerTo(/*addrspace*/ 0);
RefCountedNull = llvm::ConstantPointerNull::get(RefCountedPtrTy);
// For now, native weak references are just a pointer.
WeakReferencePtrTy =
createStructPointerType(*this, "swift.weak", { RefCountedPtrTy });
// Native unowned references are just a pointer.
UnownedReferencePtrTy =
createStructPointerType(*this, "swift.unowned", { RefCountedPtrTy });
// For now, references storage types are just pointers.
#define CHECKED_REF_STORAGE(Name, name, ...) \
Name##ReferencePtrTy = \
createStructPointerType(*this, "swift." #name, { RefCountedPtrTy });
#include "swift/AST/ReferenceStorage.def"
// A type metadata record is the structure pointed to by the canonical
// address point of a type metadata. This is at least one word, and