[llvm] [mlir] [NFC][TableGen] Use `Twine` for Name argument in CodeGenHelpers (PR #163581)

Rahul Joshi via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 16 13:08:03 PDT 2025


jurahul wrote:

> > Maybe I should go through https://discourse.llvm.org/t/correct-use-of-stringref-and-twine/20142
> 
> I think this deserves a Discourse post: it seems that 14y old discussion didn't lead to definitive conclusion, and the codebase does not seem to consistently prefer Twine to StringRef in general as far as I can tell (?). At least I probably used Twine only a handful of time in APIs for the last 6 years, I assumed StringRef to be the default and the pattern of `(...+...).str()` to be usual at call-sites. A guideline (in the coding standard) would be great for this!

I was thinking the same. Let me post something to start a discussion.

https://github.com/llvm/llvm-project/pull/163581


More information about the llvm-commits mailing list