use enum class in ir
use constexpr for ir::Type
reformat