diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2016-09-08 20:47:52 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2016-09-08 20:47:52 +0000 |
| commit | c0028d3d3b9bf9e09137480aca48f684093ca544 (patch) | |
| tree | 1abf5b2397ca12ebef0215ae966f1c1bb7d75fc4 | |
| parent | 881406e787e4d5feec3c3035c07ad2e85c0a9b4d (diff) | |
| download | bcm5719-llvm-c0028d3d3b9bf9e09137480aca48f684093ca544.tar.gz bcm5719-llvm-c0028d3d3b9bf9e09137480aca48f684093ca544.zip | |
Reduce templating. NFC.
llvm-svn: 280986
| -rw-r--r-- | lld/ELF/LinkerScript.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp index 7af2a1ad7de..eeb6dc278be 100644 --- a/lld/ELF/LinkerScript.cpp +++ b/lld/ELF/LinkerScript.cpp @@ -130,26 +130,22 @@ LinkerScript<ELFT>::getInputSections(const InputSectionDescription *I) { return Ret; } -template <class ELFT> -static bool compareName(InputSectionBase<ELFT> *A, InputSectionBase<ELFT> *B) { +static bool compareName(InputSectionData *A, InputSectionData *B) { return A->Name < B->Name; } -template <class ELFT> -static bool compareAlignment(InputSectionBase<ELFT> *A, - InputSectionBase<ELFT> *B) { +static bool compareAlignment(InputSectionData *A, InputSectionData *B) { // ">" is not a mistake. Larger alignments are placed before smaller // alignments in order to reduce the amount of padding necessary. // This is compatible with GNU. return A->Alignment > B->Alignment; } -template <class ELFT> -static std::function<bool(InputSectionBase<ELFT> *, InputSectionBase<ELFT> *)> +static std::function<bool(InputSectionData *, InputSectionData *)> getComparator(SortKind K) { if (K == SortByName) - return compareName<ELFT>; - return compareAlignment<ELFT>; + return compareName; + return compareAlignment; } template <class ELFT> @@ -200,9 +196,9 @@ LinkerScript<ELFT>::createInputSectionList(OutputSectionCommand &OutCmd) { if (!matchConstraints<ELFT>(V, OutCmd.Constraint)) continue; if (Cmd->SortInner) - std::stable_sort(V.begin(), V.end(), getComparator<ELFT>(Cmd->SortInner)); + std::stable_sort(V.begin(), V.end(), getComparator(Cmd->SortInner)); if (Cmd->SortOuter) - std::stable_sort(V.begin(), V.end(), getComparator<ELFT>(Cmd->SortOuter)); + std::stable_sort(V.begin(), V.end(), getComparator(Cmd->SortOuter)); // Add all input sections corresponding to rule 'Cmd' to // resulting vector. We do not add duplicate input sections. |

