[llvm] [openmp] [OpenMP][DeviceRTL] Report the source location in __kmpc_error diagnostics (PR #224298)
Caroline Newcombe via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 28 14:00:07 PDT 2026
================
@@ -61,6 +61,46 @@ static FnPtrTy indirectCallLookup(FnPtrTy HstPtr) {
return HstPtr;
}
+/// Split the ";file;function;line;column;;" string carried by an ident into its
+/// filename and line/column. \p File is not NUL-terminated, so \p FileLen gives
+/// its length. Returns false only if the string is missing or malformed; calls
+/// with no debug location parse successfully as "unknown" at 0:0, which the
+/// host runtime also reports.
+static bool getSourceLocation(const IdentTy *Loc, const char *&File,
----------------
cenewcombe wrote:
Thanks — right, the `DeviceRTL` has no C++ standard library, so neither `SourceInfo` nor the host runtime's `__kmp_str_loc_init` can be reused here. I've added a comment explaining that above `getSourceLocation`. Please let me know if you'd rather I go forward with making `SourceInfo` device-safe. I had originally decided against that route since that would change it and its `libomptarget` callers just to share a small parser with a single device user.
https://github.com/llvm/llvm-project/pull/224298
More information about the llvm-commits
mailing list