From 5013392841aa3488f6b87a554782b38498081edc Mon Sep 17 00:00:00 2001 From: gatecat Date: Thu, 4 Jan 2024 16:42:53 +0100 Subject: [PATCH] Add trivially copyable invariant for ID types Signed-off-by: gatecat --- common/kernel/nextpnr_types.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/common/kernel/nextpnr_types.cc b/common/kernel/nextpnr_types.cc index 6da37763..d867ed0e 100644 --- a/common/kernel/nextpnr_types.cc +++ b/common/kernel/nextpnr_types.cc @@ -23,8 +23,15 @@ #include "nextpnr_namespaces.h" +#include + NEXTPNR_NAMESPACE_BEGIN +// Invariant: architecture ID types must all be trivially copyable +static_assert(std::is_trivially_copyable::value == true); +static_assert(std::is_trivially_copyable::value == true); +static_assert(std::is_trivially_copyable::value == true); + void CellInfo::addInput(IdString name) { ports[name].name = name;