================
@@ -24,6 +26,48 @@ using namespace llvm;
using namespace llvm::dxil;
namespace {
+static const char *ResourceClassToString(llvm::dxil::ResourceClass Class) {
----------------
llvm-beanz wrote:
```suggestion
static StringRef ResourceClassToString(llvm::dxil::ResourceClass Class) {
```
Prefer `StringRef` over `const char*`. Most users of strings require knowing
the length at some point. The constructor for `StringRef` is a `constexpr` so
the size is computed at compile time and preserved, that avoids needing to walk
the string at runtime to figure out how long it is.
https://github.com/llvm/llvm-project/pull/146785
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits