mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 18:54:02 +01:00
[llvm-profdata] Make sure to consume Error on the error path of setIsIRLevelProfile
Encountered a crash while running a debug build, where this code path would be taken due to a mismatch in profile coverage data versions. Without consuming the error, an assert would be triggered inside the destructor of Error. Differential Revision: https://reviews.llvm.org/D99457
This commit is contained in:
parent
6c2532788a
commit
c3d482652f
6
test/tools/llvm-profdata/Inputs/fe-basic.proftext
Normal file
6
test/tools/llvm-profdata/Inputs/fe-basic.proftext
Normal file
@ -0,0 +1,6 @@
|
||||
:fe
|
||||
foo
|
||||
29667547796
|
||||
2
|
||||
100
|
||||
90
|
6
test/tools/llvm-profdata/Inputs/ir-basic.proftext
Normal file
6
test/tools/llvm-profdata/Inputs/ir-basic.proftext
Normal file
@ -0,0 +1,6 @@
|
||||
:ir
|
||||
foo2
|
||||
29667547796
|
||||
2
|
||||
100
|
||||
90
|
2
test/tools/llvm-profdata/merge-incompatible.test
Normal file
2
test/tools/llvm-profdata/merge-incompatible.test
Normal file
@ -0,0 +1,2 @@
|
||||
RUN: not llvm-profdata merge %p/Inputs/fe-basic.proftext %p/Inputs/ir-basic.proftext -o /dev/null 2>&1 | FileCheck %s
|
||||
CHECK: ir-basic.proftext: Merge IR generated profile with Clang generated profile.
|
@ -251,7 +251,8 @@ static void loadInput(const WeightedFile &Input, SymbolRemapper *Remapper,
|
||||
auto Reader = std::move(ReaderOrErr.get());
|
||||
bool IsIRProfile = Reader->isIRLevelProfile();
|
||||
bool HasCSIRProfile = Reader->hasCSIRLevelProfile();
|
||||
if (WC->Writer.setIsIRLevelProfile(IsIRProfile, HasCSIRProfile)) {
|
||||
if (Error E = WC->Writer.setIsIRLevelProfile(IsIRProfile, HasCSIRProfile)) {
|
||||
consumeError(std::move(E));
|
||||
WC->Errors.emplace_back(
|
||||
make_error<StringError>(
|
||||
"Merge IR generated profile with Clang generated profile.",
|
||||
|
Loading…
Reference in New Issue
Block a user