[PATCH] D54667: [CodeView] Emit proper debug info for ref-qualified member functions

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 27 10:41:00 PST 2018


rnk added a comment.

In D54667#1341110 <https://reviews.llvm.org/D54667#1341110>, @andrewrk wrote:

> In Zig, a struct acts as a namespace full of static functions, so what you said works perfectly.
>
> I'm also open for suggestions if there was a better way to represent this in LLVM's debug info.


In that case, you might want to add the DINode::FlagStaticMember flag to all your methods. If a DISubprogram lists a DICompositeType as its scope or is used as an element of the composite type, it gets treated as a C++-style method where the first argument is assumed to be 'this'. That's a very C++-centric way to do things, so it might be nicer if we explicitly marked C++ instance methods, but that's the way things are today and changing it would require thinking about backwards compatibility. >_>

The benefit of explicitly marking everything as a "static" method for zig is that if the first argument happens to be a pointer type it won't end up looking like an instance method.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D54667





More information about the llvm-commits mailing list