MCPcopy Create free account
hub / github.com/chc4/lineiform / new_region

Method new_region

tangle/src/ir.rs:101–109  ·  view source on GitHub ↗

Create a region in this IR instance at the top-most level.

(&mut self, abi: Option<ABI>)

Source from the content-addressed store, hash-verified

99
100 /// Create a region in this IR instance at the top-most level.
101 pub fn new_region<ABI: Abi + 'static>(&mut self, abi: Option<ABI>) -> RegionIdx {
102 let mut r = Region::new();
103 r.live = true;
104 r.abi = abi.map(|a| (box a) as Box<dyn Abi>);
105 let r_x = self.regions.add_node(r);
106 { self.regions.node_weight_mut(r_x).unwrap().idx = r_x; }
107 self.regions.add_edge(self.master_region, r_x, ());
108 r_x
109 }
110
111 pub fn add_function<const A: usize, const O: usize>(&mut self, f: NodeVariant::Function<A, O>) {
112 let mut owner = self.owner.take().unwrap();

Callers 1

newMethod · 0.80

Calls 1

add_nodeMethod · 0.80

Tested by

no test coverage detected