[PATCH] D65633: [Object] Create MutableELFObject Class for Doing Mutations on ELFObjectFiles [Part 3]
Jordan Rupprecht via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 21 11:32:05 PDT 2019
rupprecht added inline comments.
================
Comment at: llvm/unittests/Object/MutableELFObjectTest.cpp:22-23
+template <typename T, typename Range>
+std::vector<T> collect(
+ Range TheRange,
----------------
Is T ever going to be something besides `StringRef`? If not, removing that template parameter may be better.
================
Comment at: llvm/unittests/Object/MutableELFObjectTest.cpp:145-149
+ std::vector<StringRef> SectionNames =
+ collect<StringRef>(MutableObject.sections(), getSectionName);
+ EXPECT_THAT(SectionNames,
+ ::testing::ElementsAre("", ".sec0", ".sec1", ".sec2", ".symtab",
+ ".strtab", ".shstrtab"));
----------------
Can `SectionNames` be inlined to avoid variable reuse?
```
EXPECT_THAT(collect<StringRef>(MutableObject.sections(), getSectionName),
::testing::ElementsAre("", ".sec0", ".sec1", ".sec2", ".symtab",
".strtab", ".shstrtab"));
```
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D65633/new/
https://reviews.llvm.org/D65633
More information about the llvm-commits
mailing list