Skip to main content

PrefixMaps

Struct PrefixMaps 

Source
pub struct PrefixMaps {
    pub macros: PrefixMap,
    pub debug: PrefixMap,
    pub profile: PrefixMap,
}
Expand description

The three answers to the question the -f*-prefix-map= family asks, which is one question asked about three kinds of output.

They are separate because gcc’s flags are separate and a build uses that: a distribution maps its debug paths to something a debugger can find the sources under and leaves __FILE__ alone, or maps __FILE__ so that an assertion message does not name a build directory and leaves the debug info pointing at the real tree. -ffile-prefix-map= is the shorthand for all three and is what a build that simply wants to be reproducible writes.

Fields§

§macros: PrefixMap

What __FILE__ and __BASE_FILE__ are rewritten by, from -fmacro-prefix-map=.

The only one of the three this compiler acts on today, because it is the only one whose output exists: __FILE__ is a string literal in the binary and an assertion message a user reads.

§debug: PrefixMap

What a path in the debug info is rewritten by, from -fdebug-prefix-map=.

Read by the driver rather than by rucc-debug, because the driver is the layer where a path is still a path and by the time one reaches the DWARF writer it is a string in a table that nothing is allowed to reinterpret. Every path that reaches the line table goes through it, the unit’s own name and the directory it was compiled in among them.

§profile: PrefixMap

What a path in the profile data is rewritten by, from -fprofile-prefix-map=.

Nothing reads this yet either, and for the same reason: there is no profile data.

Trait Implementations§

Source§

impl Clone for PrefixMaps

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PrefixMaps

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for PrefixMaps

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for PrefixMaps

Source§

impl PartialEq for PrefixMaps

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for PrefixMaps

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.