Skip to content

Commit e406aee

Browse files
kazutakahiratatomtor
authored andcommitted
[BPF] Use heterogeneous lookup with std::map (NFC) (llvm#143395)
1 parent 89c1c6e commit e406aee

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

llvm/lib/Target/BPF/BTFDebug.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1438,7 +1438,7 @@ void BTFDebug::processGlobals(bool ProcessingMapDef) {
14381438
// constant with private linkage and if it won't be in .rodata.str<#>
14391439
// and .rodata.cst<#> sections.
14401440
if (SecName == ".rodata" && Global.hasPrivateLinkage() &&
1441-
DataSecEntries.find(std::string(SecName)) == DataSecEntries.end()) {
1441+
DataSecEntries.find(SecName) == DataSecEntries.end()) {
14421442
// skip .rodata.str<#> and .rodata.cst<#> sections
14431443
if (!GVKind->isMergeableCString() && !GVKind->isMergeableConst()) {
14441444
DataSecEntries[std::string(SecName)] =

llvm/lib/Target/BPF/BTFDebug.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,8 @@ class BTFDebug : public DebugHandlerBase {
300300
std::map<uint32_t, std::vector<BTFLineInfo>> LineInfoTable;
301301
std::map<uint32_t, std::vector<BTFFieldReloc>> FieldRelocTable;
302302
StringMap<std::vector<std::string>> FileContent;
303-
std::map<std::string, std::unique_ptr<BTFKindDataSec>> DataSecEntries;
303+
std::map<std::string, std::unique_ptr<BTFKindDataSec>, std::less<>>
304+
DataSecEntries;
304305
std::vector<BTFTypeStruct *> StructTypes;
305306
std::map<const GlobalVariable *, std::pair<int64_t, uint32_t>> PatchImms;
306307
std::map<const DICompositeType *,

0 commit comments

Comments
 (0)