Completely rewrite tblgen's type inference mechanism,