[PATCH] D132929: [WebAssembly][MC] Avoid the need for .size directives for functions

Derek Schuff via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 30 14:36:11 PDT 2022


dschuff added inline comments.


================
Comment at: llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:1702
   if (needFuncLabelsForEHOrDebugInfo(*MF) ||
-      MAI->hasDotTypeDotSizeDirective()) {
+      (MAI->hasDotTypeDotSizeDirective() && !TT.isWasm())) {
     // Create a symbol for the end of function.
----------------
This isn't for .size, but for the func_end symbol. It looks like (line 1727 below) the func end is stored in a list of MBB section ranges, and MBBSectionRanges is used for debug info generation. Does removing this symbol have an effect on debug info?


================
Comment at: llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:1710
   // it.
-  if (MAI->hasDotTypeDotSizeDirective()) {
+  if (MAI->hasDotTypeDotSizeDirective() && !TT.isWasm()) {
     // We can get the size as difference between the function label and the
----------------
It does seem odd that there's a target hook for whether there's a .type/.size directive but we can't use it. Is that just because we want .type (and .size for objects?) but not for functions?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D132929



More information about the llvm-commits mailing list