diff options
author | David Blaikie <dblaikie@gmail.com> | 2015-06-19 19:43:43 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2015-06-19 19:43:43 +0000 |
commit | 25ddcb4c27fb17a2173cf43159952900a72b3ac4 (patch) | |
tree | 0948b5742008583ee84126e12d101af81113e3c9 /lld/lib/ReaderWriter/PECOFF/LoadConfigPass.cpp | |
parent | 512c682984e8cfdee9a9e9cdeaebf941cdb5a140 (diff) | |
download | bcm5719-llvm-25ddcb4c27fb17a2173cf43159952900a72b3ac4.tar.gz bcm5719-llvm-25ddcb4c27fb17a2173cf43159952900a72b3ac4.zip |
Simplify Pass::perform to take a SimpleFile& instead of unique_ptr<SimpleFile>&
None of the implementations replace the SimpleFile with some other file,
they just modify the SimpleFile in-place, so a direct reference to the
file is sufficient.
llvm-svn: 240167
Diffstat (limited to 'lld/lib/ReaderWriter/PECOFF/LoadConfigPass.cpp')
-rw-r--r-- | lld/lib/ReaderWriter/PECOFF/LoadConfigPass.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lld/lib/ReaderWriter/PECOFF/LoadConfigPass.cpp b/lld/lib/ReaderWriter/PECOFF/LoadConfigPass.cpp index bebe26bf825..a67416d82ae 100644 --- a/lld/lib/ReaderWriter/PECOFF/LoadConfigPass.cpp +++ b/lld/lib/ReaderWriter/PECOFF/LoadConfigPass.cpp @@ -49,14 +49,14 @@ LoadConfigAtom::LoadConfigAtom(VirtualFile &file, const DefinedAtom *sxdata, } // namespace loadcfg -std::error_code LoadConfigPass::perform(std::unique_ptr<SimpleFile> &file) { +std::error_code LoadConfigPass::perform(SimpleFile &file) { if (_ctx.noSEH()) return std::error_code(); // Find the first atom in .sxdata section. const DefinedAtom *sxdata = nullptr; int sectionSize = 0; - for (const DefinedAtom *atom : file->defined()) { + for (const DefinedAtom *atom : file.defined()) { if (atom->customSectionName() == ".sxdata") { if (!sxdata) sxdata = atom; @@ -68,7 +68,7 @@ std::error_code LoadConfigPass::perform(std::unique_ptr<SimpleFile> &file) { auto *loadcfg = new (_alloc) loadcfg::LoadConfigAtom(_file, sxdata, sectionSize / sizeof(uint32_t)); - file->addAtom(*loadcfg); + file.addAtom(*loadcfg); return std::error_code(); } |