clover: Use explicit conversion from llvm::StringRef to std::string
authorJan Vesely <jan.vesely@rutgers.edu>
Thu, 30 Jan 2020 06:23:54 +0000 (01:23 -0500)
committerJan Vesely <jan.vesely@rutgers.edu>
Mon, 3 Feb 2020 21:25:59 +0000 (21:25 +0000)
Fixes build after llvm 777180a32b61070a10dd330b4f038bf24e916af1
("[ADT] Make StringRef's std::string conversion operator explicit")

CC: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
src/gallium/state_trackers/clover/llvm/codegen/common.cpp
src/gallium/state_trackers/clover/llvm/metadata.hpp

index 36e2adad0abee9c04c70303c082587038afee62d..730ba5a2ff7038d91f9c448a38058cdea942fa7e 100644 (file)
@@ -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));
index 5e8e720843daa91052ebd5f768781cef8dba4139..58042f4b4da340e0f40dae0171e0a157fcaf2884 100644 (file)
@@ -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();
       }
 
       ///