MCPcopy Create free account
hub / github.com/Amanieu/regalloc3 / check_limits

Method check_limits

src/debug_utils/validate_func.rs:139–156  ·  view source on GitHub ↗

Check the limits on the number of entities.

(&self)

Source from the content-addressed store, hash-verified

137
138 /// Check the limits on the number of entities.
139 fn check_limits(&self) -> Result<()> {
140 ensure!(
141 self.func.num_values() <= MAX_VALUES,
142 "Too many values: {} (max: {MAX_VALUES})",
143 self.func.num_values(),
144 );
145 ensure!(
146 self.func.num_blocks() <= MAX_BLOCKS,
147 "Too many blocks: {} (max: {MAX_BLOCKS})",
148 self.func.num_blocks(),
149 );
150 ensure!(
151 self.func.num_insts() <= MAX_INSTS,
152 "Too many instructions: {} (max: {MAX_INSTS})",
153 self.func.num_insts(),
154 );
155 Ok(())
156 }
157
158 /// Record the definition of a value and check for duplicate definitions.
159 fn check_value_def(&mut self, value: Value, def: ValueDef) -> Result<()> {

Callers 1

check_functionMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected