EDSC: clean up type casting mechanism
Originally, edsc::Expr had a long enum edsc::ExprKind with all supported types of operations. Recent Expr extensibility support removed the need to specify supported types in advance. Replace the no-longer-used blocks of enum values reserved for unary/binary/ternary/variadic expressions with simple values (it is still useful to know if an expression is, e.g., binary to access it through a simpler API). Furthermore, wrap string-comparison now used to identify specific ops into an `Expr::is_op<>` function template, that acts similarly to `Instruction::isa<>`. Introduce `{Unary,Binary,Ternary,Variadic}Expr::make<> ` function template that creates a Expression emitting the MLIR Op specified as template argument. PiperOrigin-RevId: 234612916
Loading
Please sign in to comment