-
Notifications
You must be signed in to change notification settings - Fork 748
objc: Implement whitelist tracing #557
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
Conversation
Allows to disambiguate protocols and interfaces in whitelists
Follows all the method signatures
Keeps note of the ItemIds that the Objective C interface conforms to, and when tracing, visits also them.
Hm, yeah, I know why that is and it's unfortunate :(. It's temporary though. This looks fine, thanks for doing it! @bors-servo r+ |
📌 Commit 35159dc has been approved by |
objc: Implement whitelist tracing This implements the tracing facility to enable whitelisting. The most ugly thing is the collecting of the protocol ItemIds that a interface conforms to. I couldn't use the Item::from_ty because the protocols aren't actually types (in clang), I'm just making them look like one, as thats how they behave in bindgens perspective. So I resorted in linear search of all ItemIds, as it was easyish to implement (local to objc.rs), but there are several good avenues to make that faster if it needs to. The change to naming the types with the rust_name is also a suspect, I'm not totally sure of all the consequences but this allows the protocols/categories to be disambiguated, otherwise there could be multiple type items with the same name. Somehow I feel that I'm forgetting another rationale as well, from when I originally wrote that line few days ago. Locally I also got a test failure, but to me that does not seem like it was caused by these changes. In call-conv-field.rs: ```diff extern "stdcall" { - #[link_name = "_bar@0"] + #[link_name = "bar@0"] pub fn bar(); } ```
I invited you to have write access to the repo (feel free to accept or not if you don't want to). This wouldn't give you review privileges (we usually require a few reviews before that), but would allow you to file/triage/report issues if you need or want to do so. Thanks for all the good stuff! :) |
☀️ Test successful - status-travis |
This implements the tracing facility to enable whitelisting.
The most ugly thing is the collecting of the protocol ItemIds that a interface conforms to. I couldn't use the Item::from_ty because the protocols aren't actually types (in clang), I'm just making them look like one, as thats how they behave in bindgens perspective. So I resorted in linear search of all ItemIds, as it was easyish to implement (local to objc.rs), but there are several good avenues to make that faster if it needs to.
The change to naming the types with the rust_name is also a suspect, I'm not totally sure of all the consequences but this allows the protocols/categories to be disambiguated, otherwise there could be multiple type items with the same name. Somehow I feel that I'm forgetting another rationale as well, from when I originally wrote that line few days ago.
Locally I also got a test failure, but to me that does not seem like it was caused by these changes. In call-conv-field.rs: