[mlir][ods] Fix StringRef initialization in builders
authorLei Zhang <antiagainst@google.com>
Fri, 17 Jan 2020 21:39:59 +0000 (16:39 -0500)
committerLei Zhang <antiagainst@google.com>
Tue, 21 Jan 2020 19:12:27 +0000 (14:12 -0500)
commitf2dc179d686a77de8daa1b31c8984b39823e9a3d
treecc6c232cf73e862bfe4f6d881e049afcb797bfc0
parent7c9bcba644c4fc2178e20060d9ba2ff1f50ae15e
[mlir][ods] Fix StringRef initialization in builders

For the generated builder taking in unwrapped attribute values,
if the argument is a string, we should avoid wrapping it in quotes;
otherwise we are always setting the string attribute to contain
the string argument's name. The quotes come from StrinAttr's
`constBuilderCall`, which is reasonable for string literals, but
not function arguments containing strings.

Differential Revision: https://reviews.llvm.org/D72977
mlir/include/mlir/TableGen/Attribute.h
mlir/test/mlir-tblgen/op-attribute.td
mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp