[llvm] [Symbolizer, DebugInfo] Clean up LLVMSymbolizer API: const string& -> StringRef (PR #104541)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 16 00:11:22 PDT 2024


================
@@ -604,13 +604,13 @@ LLVMSymbolizer::createModuleInfo(const ObjectFile *Obj,
 }
 
 Expected<SymbolizableModule *>
-LLVMSymbolizer::getOrCreateModuleInfo(const std::string &ModuleName) {
-  std::string BinaryName = ModuleName;
-  std::string ArchName = Opts.DefaultArch;
+LLVMSymbolizer::getOrCreateModuleInfo(StringRef ModuleName) {
+  StringRef BinaryName = ModuleName;
+  StringRef ArchName = Opts.DefaultArch;
----------------
jh7370 wrote:

Given that you have to convert them to `std::string` further down, and the syntax for that is a little uglier, I think it would just make sense to use the `std::string` type here like it was before.

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


More information about the llvm-commits mailing list