[PATCH] D57190: [MC] Teach the MachO object writer about N_FUNC_COLD

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 3 16:45:21 PST 2021


vsk added subscribers: davide, pete.
vsk added inline comments.


================
Comment at: llvm/trunk/include/llvm/BinaryFormat/MachO.h:337
   N_ALT_ENTRY = 0x0200u,
+  N_COLD_FUNC = 0x0400u,
   // For undefined symbols coming from libraries, see GET_LIBRARY_ORDINAL()
----------------
thakis wrote:
> This (and the previous bits too) overlap with the ordinal written by http://llvm-cs.pcc.me.uk/include/llvm/BinaryFormat/MachO.h/rSET_LIBRARY_ORDINAL 
> 
> I suppose the thinking is that that's safe because the ordinal is only set on undefs while these 3 bits here can't be set on undefs? If so, maybe this warrants a comment?
I wasn't aware of the overlap and am not sure I understand whether it's safe. I know N_COLD_FUNC /shouldn't/ be set on undefs -- we may want to assert that -- but am not sure about the other two. @pete & @davide - your thoughts?


Repository:
  rL LLVM

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

https://reviews.llvm.org/D57190



More information about the llvm-commits mailing list