Skip to content

[clang][OpenMP] Fix bug #62099 - use hash value when inode ID cannot be determined #131646

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 2, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9577,14 +9577,16 @@ OpenMPIRBuilder::getTargetEntryUniqueInfo(FileIdentifierInfoCallbackTy CallBack,
StringRef ParentName) {
sys::fs::UniqueID ID;
auto FileIDInfo = CallBack();
if (auto EC = sys::fs::getUniqueID(std::get<0>(FileIDInfo), ID)) {
report_fatal_error(("Unable to get unique ID for file, during "
"getTargetEntryUniqueInfo, error message: " +
EC.message())
.c_str());
}
uint64_t FileID = 0;
std::error_code EC = sys::fs::getUniqueID(std::get<0>(FileIDInfo), ID);
// If the inode ID could not be determined, create a hash value
// the current file name and use that as an ID.
if (EC)
FileID = hash_value(std::get<0>(FileIDInfo));
else
FileID = ID.getFile();

return TargetRegionEntryInfo(ParentName, ID.getDevice(), ID.getFile(),
return TargetRegionEntryInfo(ParentName, ID.getDevice(), FileID,
std::get<1>(FileIDInfo));
}

Expand Down