mirror of
https://github.com/kmc7468/cs420.git
synced 2025-12-16 07:28:52 +00:00
Update skeleton
This commit is contained in:
@@ -9,7 +9,7 @@ use core::ops::{Deref, DerefMut};
|
||||
use hexf::{parse_hexf32, parse_hexf64};
|
||||
use lang_c::ast;
|
||||
use ordered_float::OrderedFloat;
|
||||
use std::collections::HashMap;
|
||||
use std::collections::{BTreeMap, HashMap};
|
||||
use std::hash::{Hash, Hasher};
|
||||
|
||||
pub use dtype::{Dtype, DtypeError, HasDtype};
|
||||
@@ -18,7 +18,7 @@ pub use parse::Parse;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub struct TranslationUnit {
|
||||
pub decls: HashMap<String, Declaration>,
|
||||
pub decls: BTreeMap<String, Declaration>,
|
||||
pub structs: HashMap<String, Option<Dtype>>,
|
||||
}
|
||||
|
||||
@@ -161,7 +161,7 @@ pub struct FunctionDefinition {
|
||||
pub allocations: Vec<Named<Dtype>>,
|
||||
|
||||
/// Basic blocks.
|
||||
pub blocks: HashMap<BlockId, Block>,
|
||||
pub blocks: BTreeMap<BlockId, Block>,
|
||||
|
||||
/// The initial block id.
|
||||
pub bid_init: BlockId,
|
||||
|
||||
@@ -16,7 +16,7 @@ peg::parser! {
|
||||
|
||||
pub rule translation_unit() -> TranslationUnit
|
||||
= _ ds:(named_decl() ** __) _ {
|
||||
let mut decls = HashMap::new();
|
||||
let mut decls = BTreeMap::new();
|
||||
for decl in ds {
|
||||
let result = decls.insert(decl.name.unwrap(), decl.inner);
|
||||
assert!(result.is_none());
|
||||
|
||||
Reference in New Issue
Block a user