[PATCH] D110577: [llvm-cxxfilt] Enable support for D programming language demangling

Luís Ferreira via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 8 08:58:51 PDT 2021


ljmf00 added a comment.

Updated the diff to add the requested header. Also added a simpler test to be able to change the parent diff and stack with the diff implementing simple symbols.



================
Comment at: llvm/tools/llvm-cxxfilt/llvm-cxxfilt.cpp:21
 #include <cstdlib>
+#include <cstring>
 #include <iostream>
----------------
dblaikie wrote:
> ljmf00 wrote:
> > dblaikie wrote:
> > > jhenderson wrote:
> > > > ljmf00 wrote:
> > > > > jhenderson wrote:
> > > > > > I don't think you need to include this header - `strncmp` is already used in this file, so it's clearly being included through the existing include hierarchy. See also https://llvm.org/docs/CodingStandards.html#include-as-little-as-possible.
> > > > > Yeah, my editor LSP plugin probably added it automatically by mistake, and no apparent duplication was detected. I'm going to remove it!
> > > > No problem!
> > > Generally we should include anything we depend on - not rely on indirect inclusions. (the style guide gives some allowance for this - like if some other header just has to have provided a definition/inclusion of a thing, that's fine - but in this case there's no strong connection between whatever header includes something for strncmp so it's suitable to include it here, so if that other header is refactored to remove the need/use of the header it doesn't break this code)
> > > 
> > > So this #include is probably good/proper here.
> > > 
> > > The advice in the style guide is about not including unused headers and not including headers when a forward declaration would suffice.
> > I can agree on that, I just also agreed with @jhenderson more likely because `itanium` and `rust` code parts are also using `strncmp` without such include.
> Yeah, I think good tooling probably trumps whatever people did before - most of us in the absence of tooling just add #includes whenever we notice they're needed, I think. So good tooling probably is doing a better job than us mere humans. It sounds like the include is appropriate to me.
> 
> But I'm not super fussed.
I added the header again.


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

https://reviews.llvm.org/D110577



More information about the llvm-commits mailing list