[all-commits] [llvm/llvm-project] decac2: [mlir][EnumGen] Generate utility symbolizeEnum and...

River Riddle via All-commits all-commits at lists.llvm.org
Sun Apr 12 19:09:06 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: decac2d9ea9a5e7f2cce4326db198bf8f8980a78
      https://github.com/llvm/llvm-project/commit/decac2d9ea9a5e7f2cce4326db198bf8f8980a78
  Author: River Riddle <riddleriver at gmail.com>
  Date:   2020-04-12 (Sun, 12 Apr 2020)

  Changed paths:
    M mlir/include/mlir/Dialect/SPIRV/SPIRVOps.h
    M mlir/lib/Dialect/SPIRV/SPIRVDialect.cpp
    M mlir/lib/Dialect/SPIRV/SPIRVOps.cpp
    M mlir/tools/mlir-tblgen/EnumsGen.cpp
    M mlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp

  Log Message:
  -----------
  [mlir][EnumGen] Generate utility symbolizeEnum and stringifyEnum methods during EnumGen

Summary:
This revision adds generation of two utility methods during EnumGen:
```
llvm::Optional<EnumType> symbolizeEnum<EnumType>(llvm::StringRef)
<stringifyResult> stringifyEnum(EnumType);
```

This provides a generic interface for stringifying/symbolizing any enum that can be used in a template environment.

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




More information about the All-commits mailing list