Skip to content

Commit f2d4bd9

Browse files
committed
ir: Nitpicks of the last docs review that I forgot to push.
I forgot to push when I r=fitzgen in #99.
1 parent 8eb0010 commit f2d4bd9

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

src/ir/item.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,10 @@ impl ItemCanonicalPath for ItemId {
8282
/// module, a type, a function, or a variable (see `ItemKind` for more
8383
/// information).
8484
///
85-
/// Items form a tree, and each item only stores the id of the parent.
85+
/// Items form a graph, and each item only stores the id of the parent.
8686
///
87-
/// The root of this tree is the "root module", a meta-item used to hold all the
88-
/// top-level items.
87+
/// The entry-point of this graph is the "root module", a meta-item used to hold
88+
/// all the top-level items.
8989
///
9090
/// An item may have a comment, and annotations (see the `annotations` module).
9191
///
@@ -163,8 +163,8 @@ impl Item {
163163
/// they aren't.
164164
///
165165
/// This function is used to determine when the codegen phase should call
166-
/// `codegen` on an item, since it's assumed that any item that is not
167-
/// top-level will be generated by its parent.
166+
/// `codegen` on an item, since any item that is not top-level will be
167+
/// generated by its parent.
168168
pub fn is_toplevel(&self, ctx: &BindgenContext) -> bool {
169169
// FIXME: Workaround for some types falling behind when parsing weird
170170
// stl classes, for example.
@@ -610,9 +610,8 @@ impl ClangItemParser for Item {
610610
Self::from_ty_or_ref_with_id(ItemId::next(), ty, location, parent_id, context)
611611
}
612612

613-
/// Parse a type, if we know it before hand, or otherwise store it as an
614-
/// `UnresolvedTypeRef`, which means something like "a reference to a type
615-
/// we still don't know".
613+
/// Parse a C++ type. If we find a reference to a type that has not been
614+
/// defined yet, use UnresolvedTypeRef as a placeholder.
616615
///
617616
/// This logic is needed to avoid parsing items with the incorrect parent
618617
/// and it's sort of complex to explain, so I'll just point to

src/ir/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
//! The module where the Intermediate Representation bindgen uses, and the
2-
//! parsing code that generates it lives.
1+
//! The ir module defines bindgen's intermediate representation.
2+
//!
3+
//! Parsing C/C++ generates the IR, while code generation outputs Rust code from
4+
//! the IR.
35
46
pub mod annotations;
57
pub mod comp;

src/ir/ty.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ use clang::{self, Cursor};
1010

1111
/// The base representation of a type in bindgen.
1212
///
13-
/// A type has an optional name, that can't be empty, a `layout` (size,
14-
/// alignment and packedness) if known, a `Kind`, which determines which kind of
15-
/// type it is, and whether the type is const.
13+
/// A type has an optional name, which if present cannot be empty, a `layout`
14+
/// (size, alignment and packedness) if known, a `Kind`, which determines which
15+
/// kind of type it is, and whether the type is const.
1616
#[derive(Debug)]
1717
pub struct Type {
1818
/// The name of the type, or None if it was an unnamed struct or union.

0 commit comments

Comments
 (0)