Age | Commit message (Collapse) | Author |
|
And I don't want nor have the time to debug it right now.
|
|
|
|
This sucks, but works.
The full solution is a refactoring that needs more thought than the time I'm
able to dedicate to bindgen right now, see the comment for details.
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
|
|
clang: Avoid a hot FFI call for getting the cursor kind.
This is a sorta-hot call already.
I've noticed #544 wants to add more assertions about this, and was going to
suggest moving them to `debug_assert!`.
But there's an easier way :)
r? @fitzgen
|
|
This is a sorta-hot call already.
I've noticed #544 wants to add more assertions about this, and was going to
suggest moving them to `debug_assert!`.
But there's an easier way :)
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
|
|
Add option to not add enum name to bitfield or constant variants
Many C libraries prefix the variants of their enums already, because C enums are not scoped. That means if bindgen prefixes them again that can lead to ugly names like `cs_arch_CS_ARCH_ARM`. The `cs_arch_` part comes from the name of the enum itself and `CS_ARCH_ARM` is the name of the actual variant.
This pull request introduces a variable for changing this behaviour, alongside command line flags and a test case. If `prepend_enum_names` is set to false the resulting variant name will be `CS_ARCH_ARM` instead of `cs_arch_CS_ARCH_ARM` as it is now.
If there is anything that could be improved, or this toggle already exists (I have not found anything like that), please let me know.
|
|
|
|
|
|
Currently the name of a enum is always prepended to the beginning of a const or bitfield like variant. This can result in some quite unintuivite naming, if the library already prefixes its variants. For example hundreds of variants are named like this `cs_arch_CS_ARCH_ARM` when binding to the capstone library.
This commit introduces a toggle for prepending the `cs_arch_` part. By default it is enabled to preserve current behaviour. It can be toggled with the `prepend_enum_name` function on the Builder.
|
|
lib: Simplify the libclang setup.
r? @fitzgen
|
|
Add a workaround for #528, and fix #527
r? @fitzgen
|
|
Gotta land some of this stuff...
My patch queue is getting quite large, as I refactor templates in bindgen, so I figure I should land the stuff that is in good shape sooner rather than later :-P
This stuff tweaks the named template parameter analysis, adds some edge kinds, stuff like that. This is still not used by codegen, yet. I have another branch where I de-dupe named types and all of that, and there is only two tests failing now, but still some clean up needed.
This also contains the expanded documentation for te named template parameter analysis that I promised.
See each commit message for details.
r? @emilio
|
|
More objective c features
These changes implement the `id` and `SEL` type, `@class` forward declaration handling (though very superficially), and also renames the traits generated from protocols to have a `protocol_` prefix.
With these, I'm able to parse and compile NSObject.h, but I haven't really tested using it yet.
|
|
Disable osx testing.
Not only for the large build times, but also because builds have been stalled
for long, and I had to merge a few PRs manually already.
r? @fitzgen
|
|
Not only for the large build times, but also because builds have been stalled
for long, and I had to merge a few PRs manually already.
|
|
Apparently protocols and interface names live in a separate namespace,
so there is a chance of collision, like the NSObject interface implements NSObject category
|
|
|
|
Rather than determining whether any given template parameter is used at all
globally, determine the set of template parameters used by any given IR node.
|
|
|
|
The all_template_parameters method gets the complete set of template parameters
that can affect a given item.
Note that this item doesn't need to be a template declaration itself for `Some`
to be returned from this method (in contrast to `self_template_params`). If this
item is a member of a template declaration, then the parent's template
parameters are included here. See the example in TemplateDeclaration's doc
comment for details.
|
|
|
|
limit padding bytes align less than structure’s
|
|
Support older clang
|
|
Add more information to the graphviz output
|
|
force pad bytes before field with large aligement
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This gives us more debug information in the emitted graphviz dot files.
|
|
|
|
Create ISSUE_TEMPLATE.md
Github will automatically fill this in when people file new issues.
New PR because apparently I can't push to servo anymore... I think this is the same issue as with tags...
|
|
Add an example image of our IR rendered with graphviz
This turned out really great! I can't wait to use this when debugging :)
r? @emilio
cc @impowski :)
cc @jdm here is a screenshot for TWiS :)
|
|
|
|
Github will automatically fill this in when people file new issues.
|
|
Rework how bitfields are handled.
This fixes #111, and unblocks stylo.
The problem with this as of right now is that it drops the accessors (though before that this code was buggy so I'm not sure it's a loss).
I can probably try to re-implement those (though it'd be more complex). WDYT @fitzgen?
Also, note that I changed the max_align_nonce because it was incorrect (we shouldn't generate padding, because `long double` was `128` bits).
|
|
|
|
|
|
typedef struct {} name
Fixes #427
It looks like clang is doing the hard work of getting the right name from the typedef, but it falls back to arbitrary pretty-printed descriptions if it can't find a typedef. I couldn't find an API to check whether the name comes from a typedef, so I just filter out non-ident-like spellings.
|
|
Graphviz implementation
This will solve #484 . Right now it's really basic and I will change some of things in future commits like docs and other things.
r? @fitzgen
|
|
|
|
|
|
|
|
|
|
Update clang-sys.
Fixes https://github.com/servo/rust-bindgen/issues/439
r? @fitzgen
|
|
|