[PATCH] D126257: Round up zero-sized symbols to 1 byte in `.debug_aranges`.

Patrick Walton via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 25 13:03:54 PDT 2022


pcwalton added a comment.

Oh, what I mean is that our choices in the case in which zero-sized global symbols are forbidden at the IR level would be (1) don't emit source-level zero-sized symbols into LLVM IR (or don't emit DWARF metadata for them), or (2) round all zero-sized symbols up to one byte. If we pick (1), I don't think they would show up in the debug info, which could be confusing for programmers. If we pick (2), then certain abstractions which are zero-cost today in Rust become non-zero-cost.

Mind you, I don't know of any applications specifically for which adding one extra byte per zero-sized symbol would be a problem. But I'm worried that someone might be, for example, writing a macro which creates thousands of zero-sized globals, as part of some trick along the lines of traits types in C++, and then the runtime space cost of rounding all globals up to size 1 could become noticeable.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126257



More information about the llvm-commits mailing list