pub fn prepend_addrs(&self, addrs: &AbsAddr) -> AbsAddr {
        let mut acc = AbsAddr::default();
        for a in addrs.iter() {
            match a {
                Addr::Footprint(ap) => {
                    let mut new_ap = self.clone();
                    new_ap.prepend(ap.clone());
                    acc.insert(Addr::footprint(new_ap));
                }
                Addr::Constant(c) => {
                    if self.offsets.is_empty() {
                        acc.insert(Addr::constant(c.clone()));
                    } else {
                        // access path with constant base and offsets (e.g., 0x1/M::S/f/g)
                        // normalize by converting into a path with a global base instead
                        match &self.offsets[0] {
                            Offset::Global(struct_type) => {
                                let root = Root::Global(GlobalKey::constant(
                                    c.clone(),
                                    struct_type.clone(),
                                ));
                                let mut new_offsets = vec![];
                                for v in self.offsets[1..].iter() {
                                    new_offsets.push(v.clone())
                                }
                                acc.insert(Addr::footprint(AccessPath::new(root, new_offsets)));
                            }
                            _ => panic!(
                                "Invariant violation: constant root with bad offsets {:?}",
                                self.offsets
                            ),
                        }
                    }
                }
            }
        }
        acc
    }
/// Construct a new abstract address by prepending the addresses in `addrs` to `self`
Construct a new abstract address by prepending the addresses in `addrs` to `self`
Construct a new abstract address by prepending the addresses in ` addrs ` to ` self `
pub fn prepend_addrs(&self, addrs: &AbsAddr) -> AbsAddr {
        let mut acc = AbsAddr::default();
        for a in addrs.iter() {
            match a {
                Addr::Footprint(ap) => {
                    let mut new_ap = self.clone();
                    new_ap.prepend(ap.clone());
                    acc.insert(Addr::footprint(new_ap));
                }
                Addr::Constant(c) => {
                    if self.offsets.is_empty() {
                        acc.insert(Addr::constant(c.clone()));
                    } else {
                        // access path with constant base and offsets (e.g., 0x1/M::S/f/g)
                        // normalize by converting into a path with a global base instead
                        match &self.offsets[0] {
                            Offset::Global(struct_type) => {
                                let root = Root::Global(GlobalKey::constant(
                                    c.clone(),
                                    struct_type.clone(),
                                ));
                                let mut new_offsets = vec![];
                                for v in self.offsets[1..].iter() {
                                    new_offsets.push(v.clone())
                                }
                                acc.insert(Addr::footprint(AccessPath::new(root, new_offsets)));
                            }
                            _ => panic!(
                                "Invariant violation: constant root with bad offsets {:?}",
                                self.offsets
                            ),
                        }
                    }
                }
            }
        }
        acc
    }
pub fn prepend_addrs ( & self , addrs : & AbsAddr ) -> AbsAddr { let mut acc = AbsAddr :: default ( ) ; for a in addrs . iter ( ) { match a { Addr :: Footprint ( ap ) => { let mut new_ap = self . clone ( ) ; new_ap . prepend ( ap . clone ( ) ) ; acc . insert ( Addr :: footprint ( new_ap ) ) ; } Addr :: Constant ( c ) => { if self . offsets . is_empty ( ) { acc . insert ( Addr :: constant ( c . clone ( ) ) ) ; } else { // access path with constant base and offsets (e.g., 0x1/M::S/f/g) // normalize by converting into a path with a global base instead match & self . offsets [ 0 ] { Offset :: Global ( struct_type ) => { let root = Root :: Global ( GlobalKey :: constant ( c . clone ( ) , struct_type . clone ( ) , ) ) ; let mut new_offsets = vec ! [ ] ; for v in self . offsets [ 1 .. ] . iter ( ) { new_offsets . push ( v . clone ( ) ) } acc . insert ( Addr :: footprint ( AccessPath :: new ( root , new_offsets ) ) ) ; } _ => panic ! ( " " self offsets ) , } } } } } acc }
Construct a new abstract address by prepending the addresses in `addrs` to `self`
Construct a new abstract address by prepending the addresses in ` addrs ` to ` self `
&self
addrs
&AbsAddr