Skip to content

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 vihan+github@vihan.org

Signed-off-by: Vihan <vihan+github@vihan.org>
@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 <vihan+github@vihan.org>
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.

"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?

}

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