forked from OSchip/llvm-project
Expose parseXInDimensionList() to the `DialectAsmParser`
This allows custom types and attribute to parse a dimension list that isn't necessarily terminated with `xtype`, for example something like: #tf.shape<4x5> Differential Revision: https://reviews.llvm.org/D100432
This commit is contained in:
parent
00c8be3f93
commit
597207a3c3
|
@ -361,6 +361,11 @@ public:
|
|||
/// static-dimension-list ::= (integer `x`)*
|
||||
virtual ParseResult parseDimensionList(SmallVectorImpl<int64_t> &dimensions,
|
||||
bool allowDynamic = true) = 0;
|
||||
|
||||
/// Parse an 'x' token in a dimension list, handling the case where the x is
|
||||
/// juxtaposed with an element type, as in "xf32", leaving the "f32" as the
|
||||
/// next token.
|
||||
virtual ParseResult parseXInDimensionList() = 0;
|
||||
};
|
||||
|
||||
} // end namespace mlir
|
||||
|
|
|
@ -308,6 +308,10 @@ public:
|
|||
return parser.parseDimensionListRanked(dimensions, allowDynamic);
|
||||
}
|
||||
|
||||
ParseResult parseXInDimensionList() override {
|
||||
return parser.parseXInDimensionList();
|
||||
}
|
||||
|
||||
OptionalParseResult parseOptionalType(Type &result) override {
|
||||
return parser.parseOptionalType(result);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue