summaryrefslogtreecommitdiffstats
path: root/mlir/lib/Transforms/LoopTiling.cpp
diff options
context:
space:
mode:
authorAlex Zinenko <zinenko@google.com>2019-02-05 11:47:02 -0800
committerjpienaar <jpienaar@google.com>2019-03-29 16:14:50 -0700
commit40d5d09f9d52c581fd4419e8a54f4b952d904bb2 (patch)
tree726a32361aa6fada028ba34728eb1f2a7928573a /mlir/lib/Transforms/LoopTiling.cpp
parent1b1f293a5d50b9dc90f9a9a00b78e9d0c9df667d (diff)
downloadbcm5719-llvm-40d5d09f9d52c581fd4419e8a54f4b952d904bb2.tar.gz
bcm5719-llvm-40d5d09f9d52c581fd4419e8a54f4b952d904bb2.zip
Print parens around the return type of a function if it is also a function type
Existing type syntax contains the following productions: function-type ::= type-list-parens `->` type-list type-list ::= type | type-list-parens type ::= <..> | function-type Due to these rules, when the parser sees `->` followed by `(`, it cannot disambiguate if `(` starts a parenthesized list of function result types, or a parenthesized list of operands of another function type, returned from the current function. We would need an unknown amount of lookahead to try to find the `->` at the right level of function nesting to differentiate between type lists and singular function types. Instead, require the result type of the function that is a function type itself to be always parenthesized, at the syntax level. Update the spec and the parser to correspond to the production rule names used in the spec (although it would have worked without modifications). Fix the function type parsing bug in the process, as it used to accept the non-parenthesized list of types for arguments, disallowed by the spec. PiperOrigin-RevId: 232528361
Diffstat (limited to 'mlir/lib/Transforms/LoopTiling.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud