[llvm] [Offload] Print Image location rather than casting it (PR #160309)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 23 07:22:17 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-offload
Author: Ross Brunton (RossBrunton)
<details>
<summary>Changes</summary>
This squishes a warning where the runtime tries to bind a StringRef to
a `%p`.
---
Full diff: https://github.com/llvm/llvm-project/pull/160309.diff
1 Files Affected:
- (modified) offload/plugins-nextgen/common/src/PluginInterface.cpp (+2-2)
``````````diff
diff --git a/offload/plugins-nextgen/common/src/PluginInterface.cpp b/offload/plugins-nextgen/common/src/PluginInterface.cpp
index 30b5db782370d..53449d3fda992 100644
--- a/offload/plugins-nextgen/common/src/PluginInterface.cpp
+++ b/offload/plugins-nextgen/common/src/PluginInterface.cpp
@@ -1714,7 +1714,7 @@ int32_t GenericPluginTy::is_initialized() const { return Initialized; }
int32_t GenericPluginTy::isPluginCompatible(StringRef Image) {
auto HandleError = [&](Error Err) -> bool {
[[maybe_unused]] std::string ErrStr = toString(std::move(Err));
- DP("Failure to check validity of image %p: %s", Image, ErrStr.c_str());
+ DP("Failure to check validity of image %p: %s", Image.data(), ErrStr.c_str());
return false;
};
switch (identify_magic(Image)) {
@@ -1742,7 +1742,7 @@ int32_t GenericPluginTy::isPluginCompatible(StringRef Image) {
int32_t GenericPluginTy::isDeviceCompatible(int32_t DeviceId, StringRef Image) {
auto HandleError = [&](Error Err) -> bool {
[[maybe_unused]] std::string ErrStr = toString(std::move(Err));
- DP("Failure to check validity of image %p: %s", Image, ErrStr.c_str());
+ DP("Failure to check validity of image %p: %s", Image.data(), ErrStr.c_str());
return false;
};
switch (identify_magic(Image)) {
``````````
</details>
https://github.com/llvm/llvm-project/pull/160309
More information about the llvm-commits
mailing list