This is an archive of the discontinued LLVM Phabricator instance.

[mlir][EnumGen] Generate utility symbolizeEnum and stringifyEnum methods during EnumGen
ClosedPublic

Authored by rriddle on Apr 11 2020, 2:08 AM.

Details

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.

Diff Detail

Event Timeline

rriddle created this revision.Apr 11 2020, 2:08 AM
antiagainst accepted this revision.Apr 12 2020, 5:05 PM

Nice! Thanks River! :)

This revision is now accepted and ready to land.Apr 12 2020, 5:05 PM
This revision was automatically updated to reflect the committed changes.