[mlir][ODS] Use StringLiteral instead of StringRef when applicable
authorVladislav Vinogradov <vlad.vinogradov@intel.com>
Thu, 4 Feb 2021 17:12:15 +0000 (17:12 +0000)
committerVladislav Vinogradov <vlad.vinogradov@intel.com>
Wed, 3 Mar 2021 13:15:12 +0000 (16:15 +0300)
commit5d613e42d3761e106e5dd8d1731517f410605144
tree8a223f2f8c32d98f6b433e3a09c1ad75b91af4d3
parente3b350ce83a049c1608147754319c27d5fff684b
[mlir][ODS] Use StringLiteral instead of StringRef when applicable

Use `StringLiteral` for function return type if it is known to return
constant string literals only.

This will make it visible to API users, that such values can be safely
stored, since they refers to constant data, which will never be deallocated.

`StringRef` is general is not safe to store for a long term,
since it might refer to temporal data allocated in heap.

Add `inline` and `constexpr` methods support to `OpMethod`.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D97390
mlir/include/mlir/TableGen/OpClass.h
mlir/lib/TableGen/OpClass.cpp
mlir/test/mlir-tblgen/op-decl-and-defs.td
mlir/test/mlir-tblgen/typedefs.td
mlir/tools/mlir-tblgen/DialectGen.cpp
mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
mlir/tools/mlir-tblgen/PassGen.cpp
mlir/tools/mlir-tblgen/TypeDefGen.cpp