diff options
| author | George Rimar <grimar@accesssoftek.com> | 2019-04-26 13:09:11 +0000 |
|---|---|---|
| committer | George Rimar <grimar@accesssoftek.com> | 2019-04-26 13:09:11 +0000 |
| commit | 5fcdebe75fc484491cdb9ae48c484d1f142eb002 (patch) | |
| tree | 6d67ccd464a2d3bd3d43f69e226398e763f65062 /llvm/tools/yaml2obj/yaml2elf.cpp | |
| parent | c1da14941fb70a5c0995bd73d64b30e7e57acd2c (diff) | |
| download | bcm5719-llvm-5fcdebe75fc484491cdb9ae48c484d1f142eb002.tar.gz bcm5719-llvm-5fcdebe75fc484491cdb9ae48c484d1f142eb002.zip | |
[yaml2obj] - Make implicitSectionNames() return std::vector<StringRef>. NFCI.
No need to use SmallVector of char* here.
This simplifies the code.
llvm-svn: 359301
Diffstat (limited to 'llvm/tools/yaml2obj/yaml2elf.cpp')
| -rw-r--r-- | llvm/tools/yaml2obj/yaml2elf.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/tools/yaml2obj/yaml2elf.cpp b/llvm/tools/yaml2obj/yaml2elf.cpp index bb5ca4ce86a..1f83656a606 100644 --- a/llvm/tools/yaml2obj/yaml2elf.cpp +++ b/llvm/tools/yaml2obj/yaml2elf.cpp @@ -170,7 +170,7 @@ class ELFState { bool writeSectionContent(Elf_Shdr &SHeader, const ELFYAML::DynamicSection &Section, ContiguousBlobAccumulator &CBA); - SmallVector<const char *, 5> implicitSectionNames() const; + std::vector<StringRef> implicitSectionNames() const; // - SHT_NULL entry (placed first, i.e. 0'th entry) // - symbol table (.symtab) (defaults to after last yaml section) @@ -792,7 +792,7 @@ template <class ELFT> bool ELFState<ELFT>::buildSectionIndex() { auto SecNo = 1 + Doc.Sections.size(); // Add special sections after input sections, if necessary. - for (const auto &Name : implicitSectionNames()) + for (StringRef Name : implicitSectionNames()) if (!SN2I.addName(Name, SecNo)) { // Account for this section, since it wasn't in the Doc ++SecNo; @@ -894,7 +894,7 @@ int ELFState<ELFT>::writeELF(raw_ostream &OS, const ELFYAML::Object &Doc) { return 1; // Populate SHeaders with implicit sections not present in the Doc - for (const auto &Name : State.implicitSectionNames()) + for (StringRef Name : State.implicitSectionNames()) if (State.SN2I.get(Name) >= SHeaders.size()) SHeaders.push_back({}); @@ -925,7 +925,7 @@ int ELFState<ELFT>::writeELF(raw_ostream &OS, const ELFYAML::Object &Doc) { } template <class ELFT> -SmallVector<const char *, 5> ELFState<ELFT>::implicitSectionNames() const { +std::vector<StringRef> ELFState<ELFT>::implicitSectionNames() const { if (Doc.DynamicSymbols.empty()) return {".symtab", ".strtab", ".shstrtab"}; return {".symtab", ".strtab", ".shstrtab", ".dynsym", ".dynstr"}; |

