Base on the discussion here: https://github.com/llvm/llvm-project/pull/149232#discussion_r2237507164, we need to: 1) Add a new version of `enumToString` that returns `StringRef` instead of `std::string`. 2) Replace all usages of `getResourceName` with such new function.