Skip to content

Commit 02cd72e

Browse files
Jameson Nashvchuravy
authored andcommitted
[JuliaJITEventListener] Use llvm::StringMap
1 parent af07387 commit 02cd72e

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/debuginfo.cpp

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -177,13 +177,6 @@ struct revcomp {
177177
{ return lhs>rhs; }
178178
};
179179

180-
struct strrefcomp {
181-
bool operator() (const StringRef& lhs, const StringRef& rhs) const
182-
{
183-
return lhs.compare(rhs) > 0;
184-
}
185-
};
186-
187180
class JuliaJITEventListener: public JITEventListener
188181
{
189182
std::map<size_t, ObjectInfo, revcomp> objectmap;
@@ -234,11 +227,13 @@ class JuliaJITEventListener: public JITEventListener
234227
SavedObject.second.release();
235228

236229
object::section_iterator EndSection = debugObj.section_end();
237-
std::map<StringRef, object::SectionRef, strrefcomp> loadedSections;
230+
StringMap<object::SectionRef> loadedSections;
238231
for (const object::SectionRef &lSection: Object.sections()) {
239232
auto sName = lSection.getName();
240-
if (sName)
241-
loadedSections[*sName] = lSection;
233+
if (sName) {
234+
bool inserted = loadedSections.insert(std::make_pair(*sName, lSection)).second;
235+
assert(inserted); (void)inserted;
236+
}
242237
}
243238
auto getLoadAddress = [&] (const StringRef &sName) -> uint64_t {
244239
auto search = loadedSections.find(sName);

0 commit comments

Comments
 (0)