[IRGen] NFC: Add static_assert cross references

The metadata visitors note the address start of the metadata, but that
is not actually the way the offsets are calculated.
This commit is contained in:
David Zarzycki
2020-05-14 06:39:05 -04:00
parent ec0b560209
commit 36257d6a62
5 changed files with 15 additions and 0 deletions

View File

@@ -55,6 +55,7 @@
#include "ConformanceDescription.h"
#include "GenDecl.h"
#include "GenEnum.h"
#include "GenMeta.h"
#include "GenPointerAuth.h"
#include "GenIntegerLiteral.h"
#include "GenType.h"
@@ -338,6 +339,8 @@ IRGenModule::IRGenModule(IRGenerator &irgen,
// A full type metadata record is basically just an adjustment to the
// address point of a type metadata. Resilience may cause
// additional data to be laid out prior to this address point.
static_assert(MetadataAdjustmentIndex::ValueType == 1,
"Adjustment index must be synchronized with this layout");
FullTypeMetadataStructTy = createStructType(*this, "swift.full_type", {
WitnessTablePtrTy,
TypeMetadataStructTy
@@ -350,6 +353,8 @@ IRGenModule::IRGenModule(IRGenerator &irgen,
// A full heap metadata is basically just an additional small prefix
// on a full metadata, used for metadata corresponding to heap
// allocations.
static_assert(MetadataAdjustmentIndex::Class == 2,
"Adjustment index must be synchronized with this layout");
FullHeapMetadataStructTy =
createStructType(*this, "swift.full_heapmetadata", {
dtorPtrTy,