diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2018-06-16 12:11:34 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2018-06-16 12:11:34 +0000 |
commit | 88e7be2e6b8e9dfbc20094e833b066c58c1ac1bc (patch) | |
tree | bddb0c5bc4a738dcb571829934035e45166dd67b /lld/ELF/OutputSections.cpp | |
parent | 87bcd4abeffa4f24be049cf1027eceeddc48d49c (diff) | |
download | bcm5719-llvm-88e7be2e6b8e9dfbc20094e833b066c58c1ac1bc.tar.gz bcm5719-llvm-88e7be2e6b8e9dfbc20094e833b066c58c1ac1bc.zip |
[ELF] Pass callables by function_ref
No need to create a heavyweight std::function if it's not stored. No
functionality change intended.
llvm-svn: 334885
Diffstat (limited to 'lld/ELF/OutputSections.cpp')
-rw-r--r-- | lld/ELF/OutputSections.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp index 31e1d196db4..8253b18b486 100644 --- a/lld/ELF/OutputSections.cpp +++ b/lld/ELF/OutputSections.cpp @@ -139,7 +139,7 @@ void OutputSection::addSection(InputSection *IS) { } static void sortByOrder(MutableArrayRef<InputSection *> In, - std::function<int(InputSectionBase *S)> Order) { + llvm::function_ref<int(InputSectionBase *S)> Order) { typedef std::pair<int, InputSection *> Pair; auto Comp = [](const Pair &A, const Pair &B) { return A.first < B.first; }; @@ -162,7 +162,7 @@ bool OutputSection::classof(const BaseCommand *C) { return C->Kind == OutputSectionKind; } -void OutputSection::sort(std::function<int(InputSectionBase *S)> Order) { +void OutputSection::sort(llvm::function_ref<int(InputSectionBase *S)> Order) { assert(Live); for (BaseCommand *B : SectionCommands) if (auto *ISD = dyn_cast<InputSectionDescription>(B)) |