From dbbd8b15bf996397e11e375ba692dc032e46ea6e Mon Sep 17 00:00:00 2001 From: George Rimar Date: Thu, 21 Apr 2016 11:21:48 +0000 Subject: [PATCH] [ELF] - Use ArrayRef instead of std::vector& for LinkerScript module. NFC. llvm-svn: 266978 --- lld/ELF/LinkerScript.cpp | 6 +++--- lld/ELF/LinkerScript.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp index ae21039f34cb..966acf3eb6f4 100644 --- a/lld/ELF/LinkerScript.cpp +++ b/lld/ELF/LinkerScript.cpp @@ -185,7 +185,7 @@ bool LinkerScript::shouldKeep(InputSectionBase *S) { template static OutputSectionBase * -findSection(std::vector *> &V, StringRef Name) { +findSection(ArrayRef *> V, StringRef Name) { for (OutputSectionBase *Sec : V) if (Sec->getName() == Name) return Sec; @@ -194,7 +194,7 @@ findSection(std::vector *> &V, StringRef Name) { template void LinkerScript::assignAddresses( - std::vector *> &Sections) { + ArrayRef *> Sections) { typedef typename ELFT::uint uintX_t; // Orphan sections are sections present in the input files which @@ -219,7 +219,7 @@ void LinkerScript::assignAddresses( continue; } - OutputSectionBase *Sec = findSection(Sections, Cmd.SectionName); + OutputSectionBase *Sec = findSection(Sections, Cmd.SectionName); if (!Sec) continue; diff --git a/lld/ELF/LinkerScript.h b/lld/ELF/LinkerScript.h index 8ae41a66f59d..0d3078e0400b 100644 --- a/lld/ELF/LinkerScript.h +++ b/lld/ELF/LinkerScript.h @@ -81,7 +81,7 @@ public: ArrayRef getFiller(StringRef Name); bool isDiscarded(InputSectionBase *S); bool shouldKeep(InputSectionBase *S); - void assignAddresses(std::vector *> &S); + void assignAddresses(ArrayRef *> S); int compareSections(StringRef A, StringRef B); uint32_t getSectionOrder(StringRef Name);