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.
This commit is contained in:
Dmitri Gribenko 2021-12-15 12:47:10 +01:00
parent 90bbf79c7b
commit 156b1e6ba8
1 changed files with 1 additions and 1 deletions

View File

@ -521,7 +521,7 @@ void CSProfileConverter::convertProfiles(CSProfileConverter::FrameNode &Node) {
if (NodeProfile) { if (NodeProfile) {
// Add child profile to the callsite profile map. // Add child profile to the callsite profile map.
auto &SamplesMap = NodeProfile->functionSamplesAt(ChildNode.CallSiteLoc); auto &SamplesMap = NodeProfile->functionSamplesAt(ChildNode.CallSiteLoc);
SamplesMap.emplace(OrigChildContext.getName(), *ChildProfile); SamplesMap.emplace(OrigChildContext.getName().str(), *ChildProfile);
NodeProfile->addTotalSamples(ChildProfile->getTotalSamples()); NodeProfile->addTotalSamples(ChildProfile->getTotalSamples());
} }