#include namespace willow { Type TypeContext::IntType(std::size_t width) { auto [it, _] = icache.try_emplace(IntTypeImpl::Key{width}, std::make_unique(width)); return Type(it->second.get()); } Type TypeContext::PtrType(Type pointee) { auto [it, _] = pcache.try_emplace( PtrTypeImpl::Key{pointee}, std::make_unique(pointee)); return Type(it->second.get()); } Type TypeContext::VoidType() { return Type(voidty.get()); } Type TypeContext::BasicBlockType() { return Type{labelty.get()}; } Type TypeContext::FunctionType(Type ret, std::initializer_list params) { auto [it, _] = fncache.try_emplace(FunctionTypeImpl::Key{ret, params}, std::make_unique(ret, params)); return Type(it->second.get()); }; };