[PATCH] D126010: Make sure the AsmPrinter doesn't emit any zero-sized symbols to `.debug_aranges`.

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 20 11:06:18 PDT 2022


rnk added a comment.

I agree with David, I would like to see LLVM move in the direction of never emitting empty functions. These are just labels that snap to the next function in the same section, and that's silly. I'm not sure what happens if you use function sections. We should just emit some trap instruction, and let the linker do identical code folding (ICF) to merge them back together. This will regress code size, but I doubt out users will complain, and ICF will recover most of the size regression.

Regarding global symbols, I don't know about Rust, but I believe it is possible to emit empty global variables in LLVM IR with zero-sized arrays. So, I think this change probably has merit on its own, without getting into the handling of empty function bodies.

Lastly, this code change requires a test.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126010



More information about the llvm-commits mailing list