-
Notifications
You must be signed in to change notification settings - Fork 28
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Vihan <[email protected]>
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]>
There was a problem hiding this 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" |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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?
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]