[][src]Struct c2rust_transpile::c_ast::IdMapper

pub struct IdMapper { /* fields omitted */ }

Correspondence between old/new IDs.

We need to re-ID nodes since the mapping from Clang's AST to ours is not one-to-one. Sometimes we need to add nodes (such as 'Semi' nodes to make the lifting of expressions into statements explicit), sometimes we need to collapse (such as inlining 'FieldDecl' into the 'StructDecl').


impl IdMapper[src]

pub fn new() -> IdMapper[src]

pub fn get_new(&mut self, old_id: u64) -> Option<u64>[src]

Lookup the NEW_ID corresponding to a CLANG_ID

pub fn get_or_create_new(&mut self, old_id: u64) -> u64[src]

Lookup (or create if not a found) a NEW_ID corresponding to a CLANG_ID

pub fn get_old(&mut self, new_id: u64) -> Option<u64>[src]

Lookup the CLANG_ID corresponding to a NEW_ID

pub fn merge_old(&mut self, old_id: u64, other_old_id: u64) -> Option<u64>[src]

If the old_id is present in the mapper, make other_old_id map to the same value. Note that other_old_id should not already be in the mapper.

Trait Implementations

impl Debug for IdMapper[src]

Auto Trait Implementations

impl Send for IdMapper

impl Sync for IdMapper

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 

impl<T, U> TryFrom for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> BorrowMut for T where
    T: ?Sized

impl<T, U> TryInto for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<E> SpecializationError for E[src]

impl<T> Erased for T[src]

impl<T> Send for T where
    T: ?Sized

impl<T> Sync for T where
    T: ?Sized

impl<T> Make for T[src]

impl<T> MaybeResult for T[src]

impl<'a, T> Captures for T where
    T: ?Sized

impl<T> Erased for T