diff options
-rw-r--r-- | lld/ELF/Driver.cpp | 4 | ||||
-rw-r--r-- | lld/ELF/Driver.h | 1 | ||||
-rw-r--r-- | lld/ELF/LinkerScript.cpp | 5 |
3 files changed, 5 insertions, 5 deletions
diff --git a/lld/ELF/Driver.cpp b/lld/ELF/Driver.cpp index 63072fe1995..a11dbc7cc47 100644 --- a/lld/ELF/Driver.cpp +++ b/lld/ELF/Driver.cpp @@ -122,7 +122,7 @@ LinkerDriver::getArchiveMembers(MemoryBufferRef MB) { // Take ownership of memory buffers created for members of thin archives. for (std::unique_ptr<MemoryBuffer> &MB : File->takeThinBuffers()) - OwningMBs.push_back(std::move(MB)); + make<std::unique_ptr<MemoryBuffer>>(std::move(MB)); return V; } @@ -180,7 +180,7 @@ Optional<MemoryBufferRef> LinkerDriver::readFile(StringRef Path) { } std::unique_ptr<MemoryBuffer> &MB = *MBOrErr; MemoryBufferRef MBRef = MB->getMemBufferRef(); - OwningMBs.push_back(std::move(MB)); // take MB ownership + make<std::unique_ptr<MemoryBuffer>>(std::move(MB)); // take MB ownership if (Cpio) Cpio->append(relativeToRoot(Path), MBRef.getBuffer()); diff --git a/lld/ELF/Driver.h b/lld/ELF/Driver.h index a3a3a84add8..cba1eb164fd 100644 --- a/lld/ELF/Driver.h +++ b/lld/ELF/Driver.h @@ -49,7 +49,6 @@ private: bool InBinary = false; std::vector<InputFile *> Files; - std::vector<std::unique_ptr<MemoryBuffer>> OwningMBs; }; // Parses command line options. diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp index 925c9fafe37..5057b57a4a5 100644 --- a/lld/ELF/LinkerScript.cpp +++ b/lld/ELF/LinkerScript.cpp @@ -1184,8 +1184,9 @@ void ScriptParser::readInclude() { setError("cannot open " + Tok); return; } - std::unique_ptr<MemoryBuffer> &MB = *MBOrErr; - tokenize({Saver.save(MB->getBuffer()), unquote(Tok)}); + MemoryBufferRef MBRef = (*MBOrErr)->getMemBufferRef(); + make<std::unique_ptr<MemoryBuffer>>(std::move(*MBOrErr)); // take MB ownership + tokenize(MBRef); } void ScriptParser::readOutput() { |