[all-commits] [llvm/llvm-project] 5d613e: [mlir][ODS] Use StringLiteral instead of StringRef...

Vladislav Vinogradov via All-commits all-commits at lists.llvm.org
Wed Mar 3 05:16:45 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5d613e42d3761e106e5dd8d1731517f410605144
      https://github.com/llvm/llvm-project/commit/5d613e42d3761e106e5dd8d1731517f410605144
  Author: Vladislav Vinogradov <vlad.vinogradov at intel.com>
  Date:   2021-03-03 (Wed, 03 Mar 2021)

  Changed paths:
    M mlir/include/mlir/TableGen/OpClass.h
    M mlir/lib/TableGen/OpClass.cpp
    M mlir/test/mlir-tblgen/op-decl-and-defs.td
    M mlir/test/mlir-tblgen/typedefs.td
    M mlir/tools/mlir-tblgen/DialectGen.cpp
    M mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
    M mlir/tools/mlir-tblgen/PassGen.cpp
    M mlir/tools/mlir-tblgen/TypeDefGen.cpp

  Log Message:
  -----------
  [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




More information about the All-commits mailing list