-
Notifications
You must be signed in to change notification settings - Fork 747
Document the ir
module
#155
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
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.
LGTM with those, thanks for doing all this :)
/// /** <div rustbindgen replaces="Bar"></div> */ | ||
/// struct Bar { | ||
/// int x; | ||
/// x: int, |
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.
whoops, thanks for fixing this :)
Can you make this x: ::std::os::raw::c_int
? That way you don't have to ignore it :)
@@ -686,6 +745,8 @@ impl CompInfo { | |||
}) | |||
} | |||
|
|||
/// Does this type's template arguments explicitly name the given type `ty`? | |||
/// See also documentation for `ir::Item::signature_contains_named_type`. |
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.
I write this more like: Do any of the type that participates in this type's "signature" use the named type ty
?
#[derive(Debug)] | ||
pub struct Enum { | ||
/// The representation used for this enum. | ||
/// Should be an IntKind type. | ||
/// The representation used for this enum; it should be an IntKind type. |
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.
Please note something like "or an alias to it".
@@ -1,3 +1,5 @@ | |||
//! Intermediate representation for C/C++ functions. |
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.
Probably worth adding "and methods" here.
@@ -47,10 +51,10 @@ pub trait ItemCanonicalPath { | |||
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] | |||
pub struct ItemId(usize); | |||
|
|||
pub static NEXT_ITEM_ID: AtomicUsize = ATOMIC_USIZE_INIT; |
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.
Whoops, dunno why I made this pub
.
@@ -376,6 +412,8 @@ pub enum TypeKind { | |||
/// | |||
/// see tests/headers/typeref.hpp to see somewhere where this is a problem. | |||
UnresolvedTypeRef(clang::Type, Option<clang::Cursor>, /* parent_id */ Option<ItemId>), | |||
|
|||
/// An indirection to another type. |
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.
It'd be nice to mention that we use them, at least:
- To avoid parsing types that are forward declared too early (pointing to
UnresolvedTypeRef
). - To do type replacement without iterating the whole type graph.
@@ -16,7 +16,7 @@ pub enum ParseResult<T> { | |||
} | |||
|
|||
pub trait ClangSubItemParser : Sized { | |||
/// The fact that is a reference guarantees it's holded by the context, and | |||
/// The fact that is a reference guarantees it's held by the context, and |
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.
Ouch, I'm terrible at English.
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.
Easy mistake to make :)
@bors-servo: delegate+ |
✌️ @fitzgen can now approve this pull request |
@bors-servo r=emilio |
📌 Commit c70baa8 has been approved by |
Document the `ir` module r? @emilio
☀️ Test successful - status-travis |
r? @emilio