llvm-project/mlir/test/python
Michal Terepeta 54c9984207 [mlir][Python] Fix generation of accessors for Optional
Previously, in case there was only one `Optional` operand/result within
the list, we would always return `None` from the accessor, e.g., for a
single optional result we would generate:

```
return self.operation.results[0] if len(self.operation.results) > 1 else None
```

But what we really want is to return `None` only if the length of
`results` is smaller than the total number of element groups (i.e.,
the optional operand/result is in fact missing).

This commit also renames a few local variables in the generator to make
the distinction between `isVariadic()` and `isVariableLength()` a bit
more clear.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D113855
2021-11-18 09:42:57 +01:00
..
dialects [mlir][Python] Fix generation of accessors for Optional 2021-11-18 09:42:57 +01:00
integration [mlir] Move min/max ops from Std to Arith. 2021-11-15 13:19:17 +01:00
ir [mlir][python] expose the shape property of shaped types 2021-11-03 10:49:12 +01:00
lib [mlir] support interfaces in Python bindings 2021-10-25 12:50:42 +02:00
CMakeLists.txt [mlir] support interfaces in Python bindings 2021-10-25 12:50:42 +02:00
develoment_files.py [MLIR][python] Export CAPI headers. 2021-07-29 19:06:32 +00:00
execution_engine.py [mlir] Reintroduce nano time to execution_engine 2021-11-10 13:14:18 +01:00
lit.local.cfg Fix ASAN execution for the MLIR Python tests 2021-10-03 05:07:32 +00:00
pass_manager.py [mlir] Fix broken build in pass_manager.py 2021-08-04 13:12:17 +09:00
python_test_ops.td [mlir][Python] Fix generation of accessors for Optional 2021-11-18 09:42:57 +01:00