[llvm] [Object][ELF] Outline section-content validation errors (PR #202758)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 10 00:48:22 PDT 2026


jh7370 wrote:

My first immediate thought is: how are you going to prevent this regressing? It's not obviously better code (without the context of the size info you mention in the PR description) - indeed, I'd argue it at least partially makes the code less readable, because it moves the details of the error messages away from the check site (though I acknowledge that this is a subjective thing). If I came to this code without the context of this PR, I'd want to inline the error reporting, because it doesn't make sense out-of-line: we don't typically have simple helper methods out-of-line if they only have one call site.

I'm assuming that the reasoning for the size decrease is because prior to your change, each of these bits of code would be duplicated, because you'd end up with one instance per template instantiation. Is that correct?

The size gains you've discussed are also tiny. Instinctively, my feeling is that this isn't worth the reduction in readability, as a result.

Fundamentally, I think this sort of change needs a more general RFC, along the lines of "what are we willing to compromise on, in order to get small code size benefits?"

https://github.com/llvm/llvm-project/pull/202758


More information about the llvm-commits mailing list