From 23f2fff1c83eed5b80421c485cf887cf2d232f73 Mon Sep 17 00:00:00 2001 From: David Shah Date: Fri, 22 Mar 2019 10:39:05 +0000 Subject: clangformat Signed-off-by: David Shah --- ecp5/arch.h | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'ecp5') diff --git a/ecp5/arch.h b/ecp5/arch.h index b19e008f..2e86988a 100644 --- a/ecp5/arch.h +++ b/ecp5/arch.h @@ -448,25 +448,28 @@ struct ArchArgs } speed = SPEED_6; }; -struct DelayKey { +struct DelayKey +{ IdString celltype, from, to; - inline bool operator==(const DelayKey &other) const { + inline bool operator==(const DelayKey &other) const + { return celltype == other.celltype && from == other.from && to == other.to; } }; NEXTPNR_NAMESPACE_END namespace std { - template<> - struct hash { - std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX DelayKey &dk) const noexcept { - std::size_t seed = std::hash()(dk.celltype); - seed ^= std::hash()(dk.from) + 0x9e3779b9 + (seed << 6) + (seed >> 2); - seed ^= std::hash()(dk.to) + 0x9e3779b9 + (seed << 6) + (seed >> 2); - return seed; - } - }; -} +template <> struct hash +{ + std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX DelayKey &dk) const noexcept + { + std::size_t seed = std::hash()(dk.celltype); + seed ^= std::hash()(dk.from) + 0x9e3779b9 + (seed << 6) + (seed >> 2); + seed ^= std::hash()(dk.to) + 0x9e3779b9 + (seed << 6) + (seed >> 2); + return seed; + } +}; +} // namespace std NEXTPNR_NAMESPACE_BEGIN struct Arch : BaseCtx -- cgit v1.2.3