[PATCH] D51089: [LLD] [COFF] Add support for creating range extension thunks for ARM

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 28 23:28:37 PDT 2018


ruiu added inline comments.


================
Comment at: COFF/Chunks.cpp:50
+// indicates.
+void SectionChunk::finalizeContents() {
+  if (!RelocTargets.empty())
----------------
We generally don't micro-optimize code, but for relocations, we do, because the number of relocations can be an order of tens of millions for large programs. Spending one more microsecond for each relocation adds up to one second if your program has one million relocations. This function is a bit concerning in that regard. Could you measure the performance impact?

Also, it looks odd that you do this in `finalizeContents`, as it doesn't correspond to finalizing contents. Perhaps this function should be given a new name.


================
Comment at: COFF/Chunks.h:369-372
+  Defined *getTarget() const { return Target; }
+
+private:
+  Defined *Target;
----------------
We generally don't define trivial accessors like this; instead, just define a member as a public one.


https://reviews.llvm.org/D51089





More information about the llvm-commits mailing list