[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
3 files changed
tree: 8605ae1c2d1e88cc712aa64ddb923f700ae84dcd
  1. benchmark/
  2. cmake/
  3. docs/
  4. examples/
  5. include/
  6. lib/
  7. python/
  8. test/
  9. tools/
  10. unittests/
  11. utils/
  12. .clang-format
  13. .clang-tidy
  14. CMakeLists.txt
  15. LICENSE.TXT
  16. Maintainers.md
  17. README.md
README.md

Multi-Level Intermediate Representation

See https://mlir.llvm.org/ for more information.