mirror of
https://github.com/kmc7468/cs420.git
synced 2025-12-16 07:28:52 +00:00
Bump
This commit is contained in:
@@ -1064,7 +1064,7 @@ impl Byte {
|
||||
izip!(fields, offsets).for_each(|(f, o)| {
|
||||
let result = Self::value_to_bytes(f.deref(), structs);
|
||||
let size_of_data = f.deref().dtype().size_align_of(structs).unwrap().0;
|
||||
let _unused = values.splice(*o..(*o + size_of_data), result.into_iter());
|
||||
let _unused = values.splice(*o..(*o + size_of_data), result);
|
||||
});
|
||||
|
||||
values
|
||||
@@ -1134,7 +1134,7 @@ impl Memory {
|
||||
let block = self.inner[bid].as_mut().unwrap();
|
||||
|
||||
if 0 <= offset && end <= block.len() {
|
||||
let _unused = block.splice(offset as usize..end, bytes.into_iter());
|
||||
let _unused = block.splice(offset as usize..end, bytes);
|
||||
Ok(())
|
||||
} else {
|
||||
Err(())
|
||||
|
||||
@@ -57,7 +57,7 @@ impl Translate<TranslationUnit> for Visualizer {
|
||||
}
|
||||
}
|
||||
|
||||
let inner = vec![subgraphs, edges].concat().join("\n");
|
||||
let inner = [subgraphs, edges].concat().join("\n");
|
||||
|
||||
Ok(format!("digraph G {{\n{inner}\n}}"))
|
||||
}
|
||||
@@ -176,7 +176,7 @@ impl Visualizer {
|
||||
}
|
||||
|
||||
// TODO: Add init information (bid_init, allocations)
|
||||
let inner = vec![subgraphs, vec![label], edges].concat().join("\n");
|
||||
let inner = [subgraphs, vec![label], edges].concat().join("\n");
|
||||
|
||||
Ok(format!("subgraph \"cluster.{name}\" {{\n{inner}\n}}"))
|
||||
}
|
||||
@@ -208,7 +208,7 @@ impl Visualizer {
|
||||
|
||||
let edges = (0..block.instructions.len())
|
||||
.map(|iid| self.translate_instruction_node(name, *bid, iid))
|
||||
.chain([self.translate_block_exit_node(name, *bid)].into_iter())
|
||||
.chain([self.translate_block_exit_node(name, *bid)])
|
||||
.collect::<Vec<String>>()
|
||||
.join(" -> ");
|
||||
|
||||
@@ -221,7 +221,7 @@ impl Visualizer {
|
||||
.block_first_instruction
|
||||
.insert((name.to_string(), *bid), first_instruction);
|
||||
|
||||
let inner = vec![header, nodes, vec![edges]].concat().join("\n");
|
||||
let inner = [header, nodes, vec![edges]].concat().join("\n");
|
||||
|
||||
Ok(format!("subgraph \"cluster.{name}.{bid}\" {{\n{inner}\n}}"))
|
||||
}
|
||||
|
||||
@@ -635,7 +635,7 @@ impl IrgenFunc<'_> {
|
||||
/// %b0:i1:unit = store %b0:p1:i32 %l1:i32*
|
||||
/// %b0:i2:unit = store %b0:p2:i32 %l2:i32*
|
||||
/// ```
|
||||
///
|
||||
///
|
||||
/// In particular, note that it is added to the local allocation list and store them to the
|
||||
/// initial phinodes.
|
||||
///
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
#![deny(unused_macro_rules)]
|
||||
#![deny(unused_qualifications)]
|
||||
#![deny(unused_results)]
|
||||
#![deny(unused_tuple_struct_fields)]
|
||||
// Allowed for more flexible variants.
|
||||
// #![deny(variant_size_differences)]
|
||||
|
||||
|
||||
12
src/tests.rs
12
src/tests.rs
@@ -76,7 +76,7 @@ const SKIP_TEST: i32 = 102;
|
||||
pub fn test_write_c(path: &Path) {
|
||||
// Check if the file has .c extension
|
||||
assert_eq!(path.extension(), Some(std::ffi::OsStr::new("c")));
|
||||
let unit = c::Parse::default()
|
||||
let unit = Parse
|
||||
.translate(&path)
|
||||
.unwrap_or_else(|_| panic!("parse failed {}", path.display()));
|
||||
|
||||
@@ -86,7 +86,7 @@ pub fn test_write_c(path: &Path) {
|
||||
|
||||
write(&unit, &mut temp_file).unwrap();
|
||||
|
||||
let new_unit = c::Parse::default()
|
||||
let new_unit = Parse
|
||||
.translate(&temp_file_path.as_path())
|
||||
.expect("parse failed while parsing the output from implemented printer");
|
||||
drop(temp_file);
|
||||
@@ -98,7 +98,7 @@ pub fn test_write_c(path: &Path) {
|
||||
pub fn test_irgen(path: &Path) {
|
||||
// Check if the file has .c extension
|
||||
assert_eq!(path.extension(), Some(std::ffi::OsStr::new("c")));
|
||||
let unit = c::Parse::default()
|
||||
let unit = Parse
|
||||
.translate(&path)
|
||||
.unwrap_or_else(|_| panic!("parse failed {}", path.display()));
|
||||
|
||||
@@ -194,12 +194,12 @@ pub fn test_irgen(path: &Path) {
|
||||
pub fn test_irparse(path: &Path) {
|
||||
// Check if the file has .c extension
|
||||
assert_eq!(path.extension(), Some(std::ffi::OsStr::new("c")));
|
||||
let unit = c::Parse::default()
|
||||
let unit = Parse
|
||||
.translate(&path)
|
||||
.unwrap_or_else(|_| panic!("parse failed {}", path.display()));
|
||||
|
||||
// Test parse
|
||||
let _unused = c::Parse::default()
|
||||
let _unused = Parse
|
||||
.translate(&path)
|
||||
.expect("failed to parse the given program");
|
||||
|
||||
@@ -384,7 +384,7 @@ pub fn test_end_to_end(path: &Path) {
|
||||
assert_eq!(path.extension(), Some(std::ffi::OsStr::new("c")));
|
||||
|
||||
// Test parse
|
||||
let unit = c::Parse::default()
|
||||
let unit = Parse
|
||||
.translate(&path)
|
||||
.unwrap_or_else(|_| panic!("parse failed {}", path.display()));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user