Add Builtin.ObjCPointer with accompanying IR-gen support and

wrap it in an 'id' type in the standard library.

Also fix a bug noticed by inspection where initWithTake for
function types wasn't entering a cleanup for the taken value.
This probably doesn't matter for existing possibilities, but
it's potentially important under exceptions.

Swift SVN r1902
This commit is contained in:
John McCall
2012-05-18 23:40:17 +00:00
parent 7b2216216a
commit 38bac7c706
18 changed files with 260 additions and 3 deletions

View File

@@ -56,6 +56,8 @@ IRGenModule::IRGenModule(ASTContext &Context,
ReleaseFn = nullptr;
DeallocFn = nullptr;
DeallocRawFn = nullptr;
ObjCRetainFn = nullptr;
ObjCReleaseFn = nullptr;
RefCountedStructTy =
llvm::StructType::create(getLLVMContext(), "swift.refcounted");
@@ -83,6 +85,9 @@ IRGenModule::IRGenModule(ASTContext &Context,
FixedBufferTy = nullptr;
for (unsigned i = 0; i != NumValueWitnesses; ++i)
ValueWitnessTys[i] = nullptr;
ObjCPtrTy = llvm::StructType::create(getLLVMContext(), "objc_object")
->getPointerTo(0);
}
IRGenModule::~IRGenModule() {