Skip to content

Commit 56e205a

Browse files
committed
[Profile] Fix debug info correlation test failure on mac.
1 parent 371a8c5 commit 56e205a

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

compiler-rt/lib/profile/InstrProfiling.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,6 @@ COMPILER_RT_VISIBILITY void __llvm_profile_reset_counters(void) {
9090
lprofSetProfileDumped(0);
9191
}
9292

93-
int hasCorrelation() {
93+
COMPILER_RT_VISIBILITY int hasCorrelation() {
9494
return (__llvm_profile_get_version() & VARIANT_MASK_DBG_CORRELATE) != 0ULL;
9595
}

llvm/lib/ProfileData/InstrProfCorrelator.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,15 @@ InstrProfCorrelator::get(StringRef Filename, ProfCorrelatorKind FileKind) {
7474
"using multiple objects is not yet supported");
7575
Filename = *DsymObjectsOrErr->begin();
7676
}
77-
}
78-
auto BufferOrErr = errorOrToExpected(MemoryBuffer::getFile(Filename));
79-
if (auto Err = BufferOrErr.takeError())
80-
return std::move(Err);
77+
auto BufferOrErr = errorOrToExpected(MemoryBuffer::getFile(Filename));
78+
if (auto Err = BufferOrErr.takeError())
79+
return std::move(Err);
8180

82-
return get(std::move(*BufferOrErr), FileKind);
81+
return get(std::move(*BufferOrErr), FileKind);
82+
}
83+
return make_error<InstrProfError>(
84+
instrprof_error::unable_to_correlate_profile,
85+
"unsupported correlation kind (only DWARF debug info is supported)");
8386
}
8487

8588
llvm::Expected<std::unique_ptr<InstrProfCorrelator>>

0 commit comments

Comments
 (0)