[PATCH] D64281: [Object] Create MutableELFObject Class for Doing Mutations on ELFObjectFiles [Part 1]

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 24 06:15:32 PDT 2019


jhenderson added inline comments.


================
Comment at: llvm/include/llvm/Object/MutableELFObject.h:21
+
+template <typename T> static inline DataRefImpl toDataRef(T Ptr) {
+  DataRefImpl Ref;
----------------
In nearly every case I can see, toDataRef is called with a uintptr_t, so do you need the template? What case doesn't work in that case?


================
Comment at: llvm/include/llvm/Object/MutableELFObject.h:50
+  // Returns DataRef with pointer to the correct section header.
+  inline DataRefImpl getSectionRef(DataRefImpl Sec) const {
+    MappingType Mapping = Sections[Sec.p];
----------------
No need for `inline` with class members.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64281/new/

https://reviews.llvm.org/D64281





More information about the llvm-commits mailing list