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/MachO/ShimPass.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/MachO/ShimPass.cpp')
-rw-r--r-- | lld/lib/ReaderWriter/MachO/ShimPass.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lld/lib/ReaderWriter/MachO/ShimPass.cpp b/lld/lib/ReaderWriter/MachO/ShimPass.cpp index 24e1937de92..df29e37c183 100644 --- a/lld/lib/ReaderWriter/MachO/ShimPass.cpp +++ b/lld/lib/ReaderWriter/MachO/ShimPass.cpp @@ -44,9 +44,9 @@ public: : _ctx(context), _archHandler(_ctx.archHandler()), _stubInfo(_archHandler.stubInfo()), _file("<mach-o shim pass>") {} - std::error_code perform(std::unique_ptr<SimpleFile> &mergedFile) override { + std::error_code perform(SimpleFile &mergedFile) override { // Scan all references in all atoms. - for (const DefinedAtom *atom : mergedFile->defined()) { + for (const DefinedAtom *atom : mergedFile.defined()) { for (const Reference *ref : *atom) { // Look at non-call branches. if (!_archHandler.isNonCallBranch(*ref)) @@ -77,9 +77,8 @@ public: }); // Add all shims to master file. - for (const DefinedAtom *shim : shims) { - mergedFile->addAtom(*shim); - } + for (const DefinedAtom *shim : shims) + mergedFile.addAtom(*shim); return std::error_code(); } |