[PATCH] D15191: [ELF] Support PHDRS command

Denis Protivensky via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 16 01:44:18 PST 2015


denis-protivensky added inline comments.

================
Comment at: ELF/Writer.cpp:873
@@ +872,3 @@
+  bool NewPhdrs = false;
+  const std::vector<StringRef> &NewPhdrNames =
+      OutputSectionToPhdrs.lookup(SecName);
----------------
ruiu wrote:
> Instead of const std::vector<X> &, you want to use ArrayRef<X>.
I can't do that because `lookup` returns temporary object, and I bind it to const reference to prolong its lifetime to the end of the scope. `ArrayRef` constructs without copying the vector, so it'll be destroyed before used.


http://reviews.llvm.org/D15191





More information about the llvm-commits mailing list