Restructure how we finalize VWTs in the runtime to potentially allow asynchronous queries.

I keep finding reasons to want such queries and then deciding that they're
unnecessary.  Let's at least do this much, though.
This commit is contained in:
John McCall
2018-03-25 17:26:10 -04:00
parent b75baac19d
commit 6d99a7755a
7 changed files with 100 additions and 52 deletions

View File

@@ -20,7 +20,8 @@
using namespace swift;
namespace swift {
void installCommonValueWitnesses(ValueWitnessTable *vwtable);
void installCommonValueWitnesses(const TypeLayout &layout,
ValueWitnessTable *vwtable);
} // namespace swift
@@ -33,7 +34,7 @@ static void initialize_pod_witness_table_size_uint32_t_stride_uint64_t(
.withBitwiseTakable(true)
.withInlineStorage(true);
testTable.stride = sizeof(uint64_t);
installCommonValueWitnesses(&testTable);
installCommonValueWitnesses(*testTable.getTypeLayout(), &testTable);
}
extern "C" void swift_arrayInitWithCopy(OpaqueValue *dest,