llvm-node icon indicating copy to clipboard operation
llvm-node copied to clipboard

DIBuilder class

Open vihanb opened this issue 7 years ago • 3 comments
trafficstars

LLVM has a LLVM::DIBuilder which provides tools for creating debug information.

I'll attempt to make a PR for this in the upcoming weeks.

vihanb avatar Feb 26 '18 04:02 vihanb

Hy vihanb.

Let me know if you need any help to get started. I'm happy to assist you and look forward for the DIBuilder. Something I probably could also make use of in my other project.

MichaReiser avatar Feb 26 '18 17:02 MichaReiser

Hi, so today I was working on implementing some of the DIBuilder classes and due to the similarity between DIBuilder and IRBuilder I was referencing the existing IRBuilder implementation to help me make the DIBuilder bindings.

One item I had a question on however is why the constructor is implemented as a static function that just returns the static constructor instance rather than just being a static variable?

https://github.com/MichaReiser/llvm-node/blob/0c6182a15d41c511e37b0e94536ff832579d7090/src/ir/ir-builder.h#L64-L67

vihanb avatar May 27 '19 01:05 vihanb

@vihanb Sorry that I didn't found the time to reply to you sooner.

I don't remember but my assumption is that the reason is that I've done the same in all other files, e.g. the integer-type. It makes more sense for those types to use a function since the template configuration code is inside of the factory function but no such code is needed for the IRBuilder.

MichaReiser avatar Jun 23 '19 14:06 MichaReiser