move all mangle computation (except D mangle) from backend to glue

fix format