Skip to content

Commit 156b1e6

Browse files
committed
Explicitly convert StringRef to std::string for compatibility with libstdc++ 5.4.0
For some reason, the user-defined implicit conversion from StringRef to std::string is not invoked by std::map::emplace in libstdc++ 5.4.0, even though it works fine on modern systems.
1 parent 90bbf79 commit 156b1e6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/ProfileData/SampleProf.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ void CSProfileConverter::convertProfiles(CSProfileConverter::FrameNode &Node) {
521521
if (NodeProfile) {
522522
// Add child profile to the callsite profile map.
523523
auto &SamplesMap = NodeProfile->functionSamplesAt(ChildNode.CallSiteLoc);
524-
SamplesMap.emplace(OrigChildContext.getName(), *ChildProfile);
524+
SamplesMap.emplace(OrigChildContext.getName().str(), *ChildProfile);
525525
NodeProfile->addTotalSamples(ChildProfile->getTotalSamples());
526526
}
527527

0 commit comments

Comments
 (0)