[all-commits] [llvm/llvm-project] edcd83: [mlir] NFC: Rename index_t to index_type

rorth via All-commits all-commits at lists.llvm.org
Fri Mar 6 05:39:40 PST 2020


  Branch: refs/heads/release/10.x
  Home:   https://github.com/llvm/llvm-project
  Commit: edcd83a669b68a2d371a54dc46e647a2efe97a4f
      https://github.com/llvm/llvm-project/commit/edcd83a669b68a2d371a54dc46e647a2efe97a4f
  Author: Rainer Orth <ro at CeBiTec.Uni-Bielefeld.DE>
  Date:   2020-03-06 (Fri, 06 Mar 2020)

  Changed paths:
    M mlir/docs/EDSC.md
    M mlir/include/mlir/EDSC/Builders.h
    M mlir/include/mlir/EDSC/Intrinsics.h
    M mlir/lib/Conversion/VectorToLoops/ConvertVectorToLoops.cpp
    M mlir/lib/EDSC/Builders.cpp
    M mlir/lib/EDSC/Helpers.cpp
    M mlir/test/EDSC/builder-api-test.cpp

  Log Message:
  -----------
  [mlir] NFC: Rename index_t to index_type

mlir currently fails to build on Solaris:

  /vol/llvm/src/llvm-project/dist/mlir/lib/Conversion/VectorToLoops/ConvertVectorToLoops.cpp:78:20: error: reference to 'index_t' is ambiguous
    IndexHandle zero(index_t(0)), one(index_t(1));
                     ^
  /usr/include/sys/types.h:103:16: note: candidate found by name lookup is 'index_t'
  typedef short           index_t;
                          ^
  /vol/llvm/src/llvm-project/dist/mlir/include/mlir/EDSC/Builders.h:27:8: note: candidate found by name lookup is 'mlir::edsc::index_t'
  struct index_t {
         ^

and many more.

Given that POSIX reserves all identifiers ending in `_t` 2.2.2 The Name Space <https://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html>, it seems
quite unwise to use such identifiers in user code, even more so without a distinguished
prefix.

The following patch fixes this by renaming `index_t` to `index_type`.
cases.

Tested on `amd64-pc-solaris2.11` and `sparcv9-sun-solaris2.11`.

Differential Revision: https://reviews.llvm.org/D72619

(cherry picked from commit 002ec79f979b9da9dedafe7ea036e00c90a9fbb7)




More information about the All-commits mailing list