aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorMichal Terepeta <michal.terepeta@gmail.com>2021-11-18 09:41:57 +0100
committerAlex Zinenko <zinenko@google.com>2021-11-18 09:42:57 +0100
commit54c99842079997b0fe208acdab01e540c0d81b51 (patch)
treeecb31cef4e67441899804062e4e2bcb0c7370203 /clang/lib/Frontend/CompilerInvocation.cpp
parentb10562612f2e67bda7813ae9586f0afd37dc3c29 (diff)
downloadllvm-54c99842079997b0fe208acdab01e540c0d81b51.zip
llvm-54c99842079997b0fe208acdab01e540c0d81b51.tar.gz
llvm-54c99842079997b0fe208acdab01e540c0d81b51.tar.bz2
[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
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions