[MLIR][IRDL][Python] Fix error while composing `irdl.any_of` and `irdl.base` (#187914)
Previously, while users compose `irdl.any_of` and `irdl.base`, e.g.
```mlir
module {
irdl.dialect @ext_attr_in_op {
irdl.operation @op_with_attr {
%0 = irdl.base "#builtin.integer"
%1 = irdl.base "#builtin.string"
%2 = irdl.any_of(%0, %1)
irdl.attributes {"a" = %2}
}
}
}
```
The program will crash due to `llvm_unreachable("unknown IRDL
constraint")`.
This PR implements `getBases(..)` for `irdl::BaseOp` to make this work.
This make fields like `attr: IntegerAttr | StringAttr` work in
Python-defined dialects, which led to a crash previously.
GitOrigin-RevId: 6dabcef0b3ffa0beadd426e0fd56c61c45b5b396
See https://mlir.llvm.org/ for more information.