From: Jan Vesely Date: Thu, 30 Jan 2020 06:23:54 +0000 (-0500) Subject: clover: Use explicit conversion from llvm::StringRef to std::string X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0ccda2ebff83816cecf4dcb48f367a0d5c8f5fb1;p=mesa.git clover: Use explicit conversion from llvm::StringRef to std::string Fixes build after llvm 777180a32b61070a10dd330b4f038bf24e916af1 ("[ADT] Make StringRef's std::string conversion operator explicit") CC: Signed-off-by: Jan Vesely Reviewed-by: Francisco Jerez --- diff --git a/src/gallium/state_trackers/clover/llvm/codegen/common.cpp b/src/gallium/state_trackers/clover/llvm/codegen/common.cpp index 36e2adad0ab..730ba5a2ff7 100644 --- a/src/gallium/state_trackers/clover/llvm/codegen/common.cpp +++ b/src/gallium/state_trackers/clover/llvm/codegen/common.cpp @@ -196,8 +196,9 @@ clover::llvm::build_module_common(const Module &mod, const clang::CompilerInstance &c) { module m; - for (const auto &name : map(std::mem_fn(&Function::getName), + for (const auto &llvm_name : map(std::mem_fn(&Function::getName), get_kernels(mod))) { + const ::std::string name(llvm_name); if (offsets.count(name)) m.syms.emplace_back(name, 0, offsets.at(name), make_kernel_args(mod, name, c)); diff --git a/src/gallium/state_trackers/clover/llvm/metadata.hpp b/src/gallium/state_trackers/clover/llvm/metadata.hpp index 5e8e720843d..58042f4b4da 100644 --- a/src/gallium/state_trackers/clover/llvm/metadata.hpp +++ b/src/gallium/state_trackers/clover/llvm/metadata.hpp @@ -62,7 +62,7 @@ namespace clover { const std::string &name) { return ::llvm::cast< ::llvm::MDString>( detail::get_kernel_metadata_operands(f, name)[arg.getArgNo()]) - ->getString(); + ->getString().str(); } ///