diff --git a/Cargo.toml b/Cargo.toml index 9b0924c5..9503bc66 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ola-lang" -version = "0.1.0" +version = "0.1.1" edition = "2021" license = "Apache-2.0" authors = ["contact@sin7y.org"] diff --git a/examples/source/types/u256.ola b/examples/source/types/u256.ola index 69d73659..485cfaed 100644 --- a/examples/source/types/u256.ola +++ b/examples/source/types/u256.ola @@ -1,10 +1,10 @@ contract U256BasicTest { - // fn testU256DeclareUninitialized() { - // u256 a; - // print(a); - // } + fn testU256DeclareUninitialized() { + u256 a; + print(a); + } // // BEGIN-CHECK: define void @testU256DeclareInitialized() // fn testU256DeclareInitialized() { diff --git a/src/codegen/isa/ola/lower/extractv.rs b/src/codegen/isa/ola/lower/extractv.rs index 9ac753ce..a4418db8 100644 --- a/src/codegen/isa/ola/lower/extractv.rs +++ b/src/codegen/isa/ola/lower/extractv.rs @@ -62,6 +62,8 @@ pub fn lower_extractvalue( #[cfg(test)] mod test { + use debug_print::debug_println; + use crate::codegen::{ core::ir::module::Module, isa::ola::{asm::AsmProgram, Ola}, diff --git a/src/codegen/isa/ola/lower/gep.rs b/src/codegen/isa/ola/lower/gep.rs index 5c24b2c2..589e5f45 100644 --- a/src/codegen/isa/ola/lower/gep.rs +++ b/src/codegen/isa/ola/lower/gep.rs @@ -164,6 +164,8 @@ pub fn lower_gep( #[cfg(test)] mod test { + use debug_print::debug_println; + use crate::codegen::{ core::ir::module::Module, isa::ola::{asm::AsmProgram, Ola}, diff --git a/src/codegen/isa/ola/lower/insertv.rs b/src/codegen/isa/ola/lower/insertv.rs index eec01f03..87c28fb4 100644 --- a/src/codegen/isa/ola/lower/insertv.rs +++ b/src/codegen/isa/ola/lower/insertv.rs @@ -76,6 +76,8 @@ pub fn lower_insertvalue( #[cfg(test)] mod test { + use debug_print::debug_println; + use crate::codegen::{ core::ir::module::Module, isa::ola::{asm::AsmProgram, Ola}, diff --git a/src/codegen/isa/ola/lower/zext.rs b/src/codegen/isa/ola/lower/zext.rs index 475dd479..240d01ed 100644 --- a/src/codegen/isa/ola/lower/zext.rs +++ b/src/codegen/isa/ola/lower/zext.rs @@ -338,6 +338,8 @@ pub fn lower_zext( #[cfg(test)] mod test { + use debug_print::debug_println; + use crate::codegen::{ core::ir::module::Module, isa::ola::{asm::AsmProgram, Ola}, diff --git a/src/codegen/isa/ola/pass/eliminate_phi.rs b/src/codegen/isa/ola/pass/eliminate_phi.rs index 9daf30e4..9a35a016 100644 --- a/src/codegen/isa/ola/pass/eliminate_phi.rs +++ b/src/codegen/isa/ola/pass/eliminate_phi.rs @@ -77,6 +77,8 @@ pub fn run_on_function(function: &mut Function) { #[cfg(test)] mod test { + use debug_print::debug_println; + use crate::codegen::{ core::ir::module::Module, isa::ola::{asm::AsmProgram, Ola}, diff --git a/src/codegen/mod.rs b/src/codegen/mod.rs index bc78c224..13f00abe 100644 --- a/src/codegen/mod.rs +++ b/src/codegen/mod.rs @@ -10,6 +10,8 @@ pub mod register; #[cfg(test)] mod test { + use debug_print::debug_println; + use crate::codegen::{ core::ir::module::Module, isa::ola::{asm::AsmProgram, Ola}, diff --git a/src/sema/symtable.rs b/src/sema/symtable.rs index 65ea45a9..b7e0db66 100644 --- a/src/sema/symtable.rs +++ b/src/sema/symtable.rs @@ -2,7 +2,7 @@ use indexmap::IndexMap; use ola_parser::diagnostics::{ErrorType, Level, Note}; -use std::collections::{HashMap, HashSet}; +use std::collections::HashMap; use std::str; use std::sync::Arc; @@ -71,7 +71,7 @@ pub enum VariableUsage { } #[derive(Debug, Clone)] -struct VarScope(HashMap, Option>); +struct VarScope(HashMap); #[derive(Default, Debug, Clone)] pub struct Symtable { @@ -85,7 +85,7 @@ impl Symtable { pub fn new() -> Self { Symtable { vars: IndexMap::new(), - names: vec![VarScope(HashMap::new(), None)], + names: vec![VarScope(HashMap::new())], arguments: Vec::new(), returns: Vec::new(), } @@ -177,7 +177,7 @@ impl Symtable { } pub fn new_scope(&mut self) { - self.names.push(VarScope(HashMap::new(), None)); + self.names.push(VarScope(HashMap::new())); } pub fn leave_scope(&mut self) {