[lld] r266978 - [ELF] - Use ArrayRef instead of std::vector& for LinkerScript module. NFC.
George Rimar via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 21 04:21:59 PDT 2016
Author: grimar
Date: Thu Apr 21 06:21:48 2016
New Revision: 266978
URL: http://llvm.org/viewvc/llvm-project?rev=266978&view=rev
Log:
[ELF] - Use ArrayRef instead of std::vector& for LinkerScript module. NFC.
Modified:
lld/trunk/ELF/LinkerScript.cpp
lld/trunk/ELF/LinkerScript.h
Modified: lld/trunk/ELF/LinkerScript.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.cpp?rev=266978&r1=266977&r2=266978&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Thu Apr 21 06:21:48 2016
@@ -185,7 +185,7 @@ bool LinkerScript<ELFT>::shouldKeep(Inpu
template <class ELFT>
static OutputSectionBase<ELFT> *
-findSection(std::vector<OutputSectionBase<ELFT> *> &V, StringRef Name) {
+findSection(ArrayRef<OutputSectionBase<ELFT> *> V, StringRef Name) {
for (OutputSectionBase<ELFT> *Sec : V)
if (Sec->getName() == Name)
return Sec;
@@ -194,7 +194,7 @@ findSection(std::vector<OutputSectionBas
template <class ELFT>
void LinkerScript<ELFT>::assignAddresses(
- std::vector<OutputSectionBase<ELFT> *> &Sections) {
+ ArrayRef<OutputSectionBase<ELFT> *> Sections) {
typedef typename ELFT::uint uintX_t;
// Orphan sections are sections present in the input files which
@@ -219,7 +219,7 @@ void LinkerScript<ELFT>::assignAddresses
continue;
}
- OutputSectionBase<ELFT> *Sec = findSection(Sections, Cmd.SectionName);
+ OutputSectionBase<ELFT> *Sec = findSection<ELFT>(Sections, Cmd.SectionName);
if (!Sec)
continue;
Modified: lld/trunk/ELF/LinkerScript.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.h?rev=266978&r1=266977&r2=266978&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.h (original)
+++ lld/trunk/ELF/LinkerScript.h Thu Apr 21 06:21:48 2016
@@ -81,7 +81,7 @@ public:
ArrayRef<uint8_t> getFiller(StringRef Name);
bool isDiscarded(InputSectionBase<ELFT> *S);
bool shouldKeep(InputSectionBase<ELFT> *S);
- void assignAddresses(std::vector<OutputSectionBase<ELFT> *> &S);
+ void assignAddresses(ArrayRef<OutputSectionBase<ELFT> *> S);
int compareSections(StringRef A, StringRef B);
uint32_t getSectionOrder(StringRef Name);
More information about the llvm-commits
mailing list