mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Pass #1 at localizing assumptions about fixed layout and
handling non-fixed layouts. This uncovered a bug where we weren't rounding up the header size to the element alignment when allocating an array of archetypes. Writing up a detailed test case for *that* revealed that we were never initializing the length field of heap arrays. Fixing that caused a bunch of tests to crash trying to release stuff. So... I've left this in a workaround state right now because I have to catch a plane. Swift SVN r4804
This commit is contained in:
@@ -286,6 +286,17 @@ llvm::Constant *IRGenModule::getSlowRawDeallocFn() {
|
||||
return SlowRawDeallocFn;
|
||||
}
|
||||
|
||||
llvm::Constant *IRGenModule::getCopyPODFn() {
|
||||
if (CopyPODFn) return CopyPODFn;
|
||||
|
||||
/// void *swift_copyPOD(void *dest, void *src, Metadata *self);
|
||||
llvm::Type *types[] = { OpaquePtrTy, OpaquePtrTy, };
|
||||
llvm::FunctionType *fnType =
|
||||
llvm::FunctionType::get(OpaquePtrTy, types, false);
|
||||
CopyPODFn = createRuntimeFunction(*this, "swift_copyPOD", fnType);
|
||||
return CopyPODFn;
|
||||
}
|
||||
|
||||
llvm::Constant *IRGenModule::getDynamicCastClassFn() {
|
||||
if (DynamicCastClassFn) return DynamicCastClassFn;
|
||||
|
||||
@@ -498,6 +509,10 @@ llvm::Constant *IRGenModule::getObjCEmptyVTablePtr() {
|
||||
return ObjCEmptyVTablePtr;
|
||||
}
|
||||
|
||||
llvm::Constant *IRGenModule::getSize(Size size) {
|
||||
return llvm::ConstantInt::get(SizeTy, size.getValue());
|
||||
}
|
||||
|
||||
void IRGenModule::unimplemented(SourceLoc loc, StringRef message) {
|
||||
Context.Diags.diagnose(loc, diag::irgen_unimplemented, message);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user