mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-23 05:40:09 +00:00
[BOLT] Fix unconditional output of boltedcollection in merge-fdata (#78653)
Fix the bug where merge-fdata unconditionally outputs boltedcollection line, regardless of whether input files have it set. Test Plan: Added bolt/test/X86/merge-fdata-nobat-mode.test which fails without this fix.
This commit is contained in:
parent
9fec33aadc
commit
6735ce9d25
@ -4,6 +4,5 @@ RUN: merge-fdata %S/Inputs/bat_profile_1.fdata \
|
||||
RUN: %S/Inputs/bat_profile_2.fdata \
|
||||
RUN: | FileCheck %s --check-prefix=CHECK-FDATA
|
||||
|
||||
CHECK-FDATA: boltedcollection
|
||||
CHECK-FDATA: 1 main 451 1 SolveCubic 0 0 302
|
||||
|
||||
|
||||
|
6
bolt/test/X86/merge-fdata-nobat-mode.test
Normal file
6
bolt/test/X86/merge-fdata-nobat-mode.test
Normal file
@ -0,0 +1,6 @@
|
||||
# Check that merge-fdata tool doesn't spuriously print boltedcollection
|
||||
|
||||
RUN: merge-fdata %S/Inputs/blarge.fdata %S/Inputs/blarge.fdata \
|
||||
RUN: | FileCheck %s --check-prefix=CHECK-FDATA
|
||||
|
||||
CHECK-FDATA-NOT: boltedcollection
|
@ -329,7 +329,7 @@ void mergeLegacyProfiles(const SmallVectorImpl<std::string> &Filenames) {
|
||||
MergedProfile.insert_or_assign(Key, Count);
|
||||
}
|
||||
|
||||
if (BoltedCollection)
|
||||
if (BoltedCollection.value_or(false))
|
||||
output() << "boltedcollection\n";
|
||||
for (const auto &[Key, Value] : MergedProfile)
|
||||
output() << Key << " " << Value << "\n";
|
||||
|
Loading…
Reference in New Issue
Block a user