summaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2020-07-26 19:36:28 +0000
committerDimitry Andric <dim@FreeBSD.org>2020-07-26 19:36:28 +0000
commitcfca06d7963fa0909f90483b42a6d7d194d01e08 (patch)
tree209fb2a2d68f8f277793fc8df46c753d31bc853b /llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
parent706b4fc47bbc608932d3b491ae19a3b9cde9497b (diff)
Notes
Diffstat (limited to 'llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp')
-rw-r--r--llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp b/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
index 9b84c46d39010..be5dbdd1c5597 100644
--- a/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
+++ b/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
@@ -189,7 +189,7 @@ class TrivialMemoryManager : public RTDyldMemoryManager {
public:
struct SectionInfo {
SectionInfo(StringRef Name, sys::MemoryBlock MB, unsigned SectionID)
- : Name(Name), MB(std::move(MB)), SectionID(SectionID) {}
+ : Name(std::string(Name)), MB(std::move(MB)), SectionID(SectionID) {}
std::string Name;
sys::MemoryBlock MB;
unsigned SectionID = ~0U;
@@ -599,7 +599,7 @@ void applySpecificSectionMappings(RuntimeDyld &Dyld,
for (StringRef Mapping : SpecificSectionMappings) {
size_t EqualsIdx = Mapping.find_first_of("=");
- std::string SectionIDStr = Mapping.substr(0, EqualsIdx);
+ std::string SectionIDStr = std::string(Mapping.substr(0, EqualsIdx));
size_t ComaIdx = Mapping.find_first_of(",");
if (ComaIdx == StringRef::npos)
@@ -612,7 +612,7 @@ void applySpecificSectionMappings(RuntimeDyld &Dyld,
ExitOnErr(getSectionId(FileToSecIDMap, FileName, SectionName));
auto* OldAddr = Dyld.getSectionContent(SectionID).data();
- std::string NewAddrStr = Mapping.substr(EqualsIdx + 1);
+ std::string NewAddrStr = std::string(Mapping.substr(EqualsIdx + 1));
uint64_t NewAddr;
if (StringRef(NewAddrStr).getAsInteger(0, NewAddr))