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 Bindings #86

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

DIBuilder Bindings #86

wants to merge 2 commits into from

Conversation

vihanb
Copy link
Contributor

@vihanb vihanb commented May 27, 2019

I've been working on adding some DIBuilder bindings this weekend. This is far from finished but I thought I'd open up a PR just to open a discussion about the classes etc.

Signed-off-by: Vihan [email protected]

@MichaReiser
Copy link
Owner

Hi @vihanb

I'll hopefully soon find time to have a look. By the way. Let us try to have smaller PR's over having PR's that add 100% support for a llvm class so that we can land the changes sooner than later.

Signed-off-by: Vihan <[email protected]>
Copy link
Owner

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this huge contribution!

Could you please implement unit tests for the added methods the same way as there are already tests for existing code.

For the future. Reviewing is easier if the PR's are smaller. I would appreciate it if you could submit smaller PRs.

@@ -23,7 +23,8 @@
"dependencies": {
"bindings": "^1.5.0",
"cmake-js": "^5.2.0",
"nan": "^2.13.2"
"nan": "^2.13.2",
"segfault-handler": "^1.2.0"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason for adding this dependency?

@@ -228,6 +228,113 @@ declare namespace llvm {
private constructor();
}

class DIBasicType extends DIType {
readonly isSigned: bool;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No such method exists on DIBasicType (llvm-node is only a thin wrapper around llvm methods).

I assume it's a simplification for getSignedness. I would prefer exposing the enum and making the return type optional


NAN_GETTER(DIBasicTypeWrapper::getSignedness) {
auto* wrapper = DIBasicTypeWrapper::FromValue(info.Holder())->getDIBasicType();
bool isSigned = wrapper->getSignedness() == llvm::DIBasicType::Signedness::Signed;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if getSignedness returns an absent value?

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

Successfully merging this pull request may close these issues.

2 participants