Skip to content

Commit 76fabbd

Browse files
committed
Fixed typos
1 parent b2297d0 commit 76fabbd

File tree

4 files changed

+13
-27
lines changed

4 files changed

+13
-27
lines changed

bolt/include/bolt/Core/BinaryContext.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ class BinaryContext {
292292
/// tables associated with instructions. Since binary functions can span
293293
/// multiple compilation units, instructions may reference debug line
294294
/// information from multiple CUs.
295-
ClasteredRowsContainer ClasteredRows;
295+
ClusteredRowsContainer ClusteredRows;
296296

297297
// Setup MCPlus target builder
298298
void initializeTarget(std::unique_ptr<MCPlusBuilder> TargetBuilder) {

bolt/include/bolt/Core/DebugData.h

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -834,9 +834,6 @@ class DwarfLineTable {
834834
};
835835

836836
/// ClusteredRows represents a collection of debug line table row references.
837-
/// Since a Binary function can belong to multiple compilation units (CUs),
838-
/// a single MCInst can have multiple debug line table rows associated with it
839-
/// from different CUs. This class manages such clustered row references.
840837
///
841838
/// MEMORY LAYOUT AND DESIGN:
842839
/// This class uses a flexible array member pattern to store all
@@ -846,26 +843,15 @@ class DwarfLineTable {
846843
/// +------------------+
847844
/// | ClusteredRows | <- Object header (Size + first element)
848845
/// | - Size |
849-
/// | - Raws (element) | <- First DebugLineTableRowRef element
846+
/// | - Rows (element) | <- First DebugLineTableRowRef element
850847
/// +------------------+
851848
/// | element[1] | <- Additional DebugLineTableRowRef elements
852849
/// | element[2] | stored immediately after the object
853850
/// | ... |
854851
/// | element[Size-1] |
855852
/// +------------------+
856853
///
857-
/// PERFORMANCE BENEFITS:
858-
/// - Single memory allocation: All elements are stored in one contiguous block,
859-
/// eliminating the need for separate heap allocations for the array.
860-
/// - No extra dereferencing: Elements are accessed directly via pointer
861-
/// arithmetic (beginPtr() + offset) rather than through an additional
862-
/// pointer indirection.
863-
/// - Cache locality: All elements are guaranteed to be adjacent in memory,
864-
/// improving cache performance during iteration.
865-
/// - Memory efficiency: No overhead from separate pointer storage or
866-
/// fragmented allocations.
867-
///
868-
/// The 'Raws' member serves as both the first element storage and the base
854+
/// The 'Rows' member serves as both the first element storage and the base
869855
/// address for pointer arithmetic to access subsequent elements.
870856
class ClusteredRows {
871857
public:
@@ -891,33 +877,33 @@ class ClusteredRows {
891877

892878
private:
893879
uint64_t Size;
894-
DebugLineTableRowRef Raws;
880+
DebugLineTableRowRef Rows;
895881

896882
ClusteredRows(uint64_t Size) : Size(Size) {}
897883
static uint64_t getTotalSize(uint64_t Size) {
898884
assert(Size > 0 && "Size must be greater than 0");
899885
return sizeof(ClusteredRows) + (Size - 1) * sizeof(DebugLineTableRowRef);
900886
}
901887
const DebugLineTableRowRef *beginPtrConst() const {
902-
return reinterpret_cast<const DebugLineTableRowRef *>(&Raws);
888+
return reinterpret_cast<const DebugLineTableRowRef *>(&Rows);
903889
}
904890
DebugLineTableRowRef *beginPtr() {
905-
return reinterpret_cast<DebugLineTableRowRef *>(&Raws);
891+
return reinterpret_cast<DebugLineTableRowRef *>(&Rows);
906892
}
907893

908-
friend class ClasteredRowsContainer;
894+
friend class ClusteredRowsContainer;
909895
};
910896

911-
/// ClasteredRowsContainer manages the lifecycle of ClusteredRows objects.
912-
class ClasteredRowsContainer {
897+
/// ClusteredRowsContainer manages the lifecycle of ClusteredRows objects.
898+
class ClusteredRowsContainer {
913899
public:
914900
ClusteredRows *createClusteredRows(uint64_t Size) {
915901
auto *CR = new (std::malloc(ClusteredRows::getTotalSize(Size)))
916902
ClusteredRows(Size);
917903
Clusters.push_back(CR);
918904
return CR;
919905
}
920-
~ClasteredRowsContainer() {
906+
~ClusteredRowsContainer() {
921907
for (auto *CR : Clusters)
922908
std::free(CR);
923909
}

bolt/lib/Core/BinaryFunction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1502,7 +1502,7 @@ Error BinaryFunction::disassemble() {
15021502
}
15031503
if (!Rows.empty()) {
15041504
ClusteredRows *Cluster =
1505-
BC.ClasteredRows.createClusteredRows(Rows.size());
1505+
BC.ClusteredRows.createClusteredRows(Rows.size());
15061506
Cluster->populate(Rows);
15071507
Instruction.setLoc(Cluster->toSMLoc());
15081508
}

bolt/unittests/Core/ClusteredRows.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ namespace {
1919
class ClusteredRowsTest : public ::testing::Test {
2020
protected:
2121
void SetUp() override {
22-
Container = std::make_unique<ClasteredRowsContainer>();
22+
Container = std::make_unique<ClusteredRowsContainer>();
2323
}
2424

25-
std::unique_ptr<ClasteredRowsContainer> Container;
25+
std::unique_ptr<ClusteredRowsContainer> Container;
2626
};
2727

2828
TEST_F(ClusteredRowsTest, CreateSingleElement) {

0 commit comments

Comments
 (0)