[−][src]Struct c2rust_transpile::c_ast::IdMapper
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').
Methods
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
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<E> SpecializationError for E
[src]
default fn not_found<S, T>(
trait_name: &'static str,
method_name: &'static str
) -> E where
T: ?Sized,
[src]
trait_name: &'static str,
method_name: &'static str
) -> E where
T: ?Sized,
impl<T> Erased for T
[src]
impl<T> Send for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Sync for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Make for T
[src]
impl<T> MaybeResult for T
[src]
impl<'a, T> Captures for T where
T: ?Sized,
[src]
T: ?Sized,