Skip to content

Commit

Permalink
[Profile] Fix debug info correlation test failure on mac.
Browse files Browse the repository at this point in the history
  • Loading branch information
ZequanWu committed Nov 2, 2023
1 parent 371a8c5 commit 56e205a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion compiler-rt/lib/profile/InstrProfiling.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,6 @@ COMPILER_RT_VISIBILITY void __llvm_profile_reset_counters(void) {
lprofSetProfileDumped(0);
}

int hasCorrelation() {
COMPILER_RT_VISIBILITY int hasCorrelation() {
return (__llvm_profile_get_version() & VARIANT_MASK_DBG_CORRELATE) != 0ULL;
}
13 changes: 8 additions & 5 deletions llvm/lib/ProfileData/InstrProfCorrelator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,15 @@ InstrProfCorrelator::get(StringRef Filename, ProfCorrelatorKind FileKind) {
"using multiple objects is not yet supported");
Filename = *DsymObjectsOrErr->begin();
}
}
auto BufferOrErr = errorOrToExpected(MemoryBuffer::getFile(Filename));
if (auto Err = BufferOrErr.takeError())
return std::move(Err);
auto BufferOrErr = errorOrToExpected(MemoryBuffer::getFile(Filename));
if (auto Err = BufferOrErr.takeError())
return std::move(Err);

return get(std::move(*BufferOrErr), FileKind);
return get(std::move(*BufferOrErr), FileKind);
}
return make_error<InstrProfError>(
instrprof_error::unable_to_correlate_profile,
"unsupported correlation kind (only DWARF debug info is supported)");
}

llvm::Expected<std::unique_ptr<InstrProfCorrelator>>
Expand Down

0 comments on commit 56e205a

Please sign in to comment.