Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DIBuilder class #40

Open
vihanb opened this issue Feb 26, 2018 · 3 comments
Open

DIBuilder class #40

vihanb opened this issue Feb 26, 2018 · 3 comments

Comments

@vihanb
Copy link
Contributor

vihanb commented Feb 26, 2018

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.

@MichaReiser
Copy link
Owner

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.

@vihanb
Copy link
Contributor Author

vihanb commented May 27, 2019

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?

static inline Nan::Persistent<v8::Function>& irBuilderConstructor() {
static Nan::Persistent<v8::Function> constructor {};
return constructor;
}

@MichaReiser
Copy link
Owner

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants