-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Closed
Labels
Description
With clang-tidy built at current head and applying it on MLIR:
$ clang-tidy -p build mlir/lib/Target/LLVMIR/Dialect/GPU/SelectObjectAttr.cpp --checks=-*,llvm-twine-local -fix -fix-errors
diff --git a/mlir/lib/Target/LLVMIR/Dialect/GPU/SelectObjectAttr.cpp b/mlir/lib/Target/LLVMIR/Dialect/GPU/SelectObjectAttr.cpp
index 453b9bc1b58b..78402e5ea896 100644
--- a/mlir/lib/Target/LLVMIR/Dialect/GPU/SelectObjectAttr.cpp
+++ b/mlir/lib/Target/LLVMIR/Dialect/GPU/SelectObjectAttr.cpp
@@ -416,7 +416,7 @@ llvm::LaunchKernel::createKernelLaunch(mlir::gpu::LaunchFuncOp op,
// Load the kernel function.
StringRef moduleName = op.getKernelModuleName().getValue();
- Twine moduleIdentifier = getModuleIdentifier(moduleName);
+ std::string moduleIdentifier = (getModuleIdentifier(moduleName)).str();
Value *modulePtr = module.getGlobalVariable(moduleIdentifier.str(), true);
if (!modulePtr)
return op.emitError() << "Couldn't find the binary: " << moduleIdentifier;
mlir/lib/Target/LLVMIR/Dialect/GPU/SelectObjectAttr.cpp:420:64: error: no member named 'str' in 'std::basic_string<char>'
420 | Value *modulePtr = module.getGlobalVariable(moduleIdentifier.str(), true);
| ~~~~~~~~~~~~~~~~ ^
1 error generated.