llvm-node
llvm-node copied to clipboard
DIBuilder class
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.
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.
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 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.