Skip to content

Commit 0646a8c

Browse files
committed
debug windows bitfield
1 parent 51f24bf commit 0646a8c

File tree

1 file changed

+53
-4
lines changed

1 file changed

+53
-4
lines changed

llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp

Lines changed: 53 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,6 +1394,44 @@ static uint32_t getBBAddrMapMetadata(const MachineBasicBlock &MBB) {
13941394
.encode();
13951395
}
13961396

1397+
static llvm::object::BBAddrMap::Features
1398+
debugGetFeature1(const MachineFunction &MF, int NumMBBSectionRanges) {
1399+
return llvm::object::BBAddrMap::Features{true, false, false, false, true};
1400+
}
1401+
1402+
static llvm::object::BBAddrMap::Features
1403+
debugGetFeature2(const MachineFunction &MF, int NumMBBSectionRanges) {
1404+
return llvm::object::BBAddrMap::Features{true, false, false, false,
1405+
SkipEmitBBEntries};
1406+
}
1407+
1408+
static llvm::object::BBAddrMap::Features
1409+
debugGetFeature3(const MachineFunction &MF, int NumMBBSectionRanges) {
1410+
return {true, false, false, MF.hasBBSections() && NumMBBSectionRanges > 1,
1411+
static_cast<bool>(SkipEmitBBEntries)};
1412+
}
1413+
1414+
static llvm::object::BBAddrMap::Features
1415+
debugGetFeature4(const MachineFunction &MF, int NumMBBSectionRanges) {
1416+
llvm::object::BBAddrMap::Features F = llvm::object::BBAddrMap::Features{
1417+
true, false, false, false, static_cast<bool>(SkipEmitBBEntries)};
1418+
return F;
1419+
}
1420+
1421+
static llvm::object::BBAddrMap::Features
1422+
debugGetFeature5(const MachineFunction &MF, int NumMBBSectionRanges) {
1423+
llvm::object::BBAddrMap::Features F;
1424+
F.NoBBEntries = true;
1425+
return F;
1426+
}
1427+
1428+
static llvm::object::BBAddrMap::Features
1429+
debugGetFeature6(const MachineFunction &MF, int NumMBBSectionRanges) {
1430+
llvm::object::BBAddrMap::Features F;
1431+
F.NoBBEntries = SkipEmitBBEntries;
1432+
return F;
1433+
}
1434+
13971435
static llvm::object::BBAddrMap::Features
13981436
getBBAddrMapFeature(const MachineFunction &MF, int NumMBBSectionRanges) {
13991437
// Ensure that the user has not passed in additional options while also
@@ -1425,11 +1463,22 @@ getBBAddrMapFeature(const MachineFunction &MF, int NumMBBSectionRanges) {
14251463
}
14261464
dbgs() << "getBBAddrMapFeature::SkipEmitBBEntries: " << SkipEmitBBEntries
14271465
<< "\n";
1428-
llvm::object::BBAddrMap::Features F1 = {true, false, false, false, true};
1466+
llvm::object::BBAddrMap::Features F1 = llvm::object::BBAddrMap::Features{
1467+
FuncEntryCountEnabled, BBFreqEnabled, BrProbEnabled,
1468+
MF.hasBBSections() && NumMBBSectionRanges > 1, SkipEmitBBEntries};
14291469
dbgs() << "F1.NoBBEntries: " << F1.NoBBEntries << "\n";
1430-
llvm::object::BBAddrMap::Features F2 =
1431-
llvm::object::BBAddrMap::Features{true, false, false, false, true};
1432-
dbgs() << "F2.NoBBEntries: " << F2.NoBBEntries << "\n";
1470+
auto DF1 = debugGetFeature1(MF, NumMBBSectionRanges);
1471+
dbgs() << "DF1.NoBBEntries: " << DF1.NoBBEntries << "\n";
1472+
auto DF2 = debugGetFeature2(MF, NumMBBSectionRanges);
1473+
dbgs() << "DF2.NoBBEntries: " << DF2.NoBBEntries << "\n";
1474+
auto DF3 = debugGetFeature3(MF, NumMBBSectionRanges);
1475+
dbgs() << "DF3.NoBBEntries: " << DF3.NoBBEntries << "\n";
1476+
auto DF4 = debugGetFeature4(MF, NumMBBSectionRanges);
1477+
dbgs() << "DF4.NoBBEntries: " << DF4.NoBBEntries << "\n";
1478+
auto DF5 = debugGetFeature5(MF, NumMBBSectionRanges);
1479+
dbgs() << "DF5.NoBBEntries: " << DF5.NoBBEntries << "\n";
1480+
auto DF6 = debugGetFeature6(MF, NumMBBSectionRanges);
1481+
dbgs() << "DF6.NoBBEntries: " << DF6.NoBBEntries << "\n";
14331482

14341483
return llvm::object::BBAddrMap::Features{
14351484
FuncEntryCountEnabled, BBFreqEnabled, BrProbEnabled,

0 commit comments

Comments
 (0)