Skip to content

Commit

Permalink
add debug_print test dependency.
Browse files Browse the repository at this point in the history
  • Loading branch information
YancyParker committed Jan 31, 2024
1 parent 31cce04 commit 4f2e2b6
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ola-lang"
version = "0.1.0"
version = "0.1.1"
edition = "2021"
license = "Apache-2.0"
authors = ["[email protected]"]
Expand Down
8 changes: 4 additions & 4 deletions examples/source/types/u256.ola
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down
2 changes: 2 additions & 0 deletions src/codegen/isa/ola/lower/extractv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
2 changes: 2 additions & 0 deletions src/codegen/isa/ola/lower/gep.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
2 changes: 2 additions & 0 deletions src/codegen/isa/ola/lower/insertv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
2 changes: 2 additions & 0 deletions src/codegen/isa/ola/lower/zext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
2 changes: 2 additions & 0 deletions src/codegen/isa/ola/pass/eliminate_phi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ pub fn run_on_function(function: &mut Function<Ola>) {

#[cfg(test)]
mod test {
use debug_print::debug_println;

use crate::codegen::{
core::ir::module::Module,
isa::ola::{asm::AsmProgram, Ola},
Expand Down
2 changes: 2 additions & 0 deletions src/codegen/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
8 changes: 4 additions & 4 deletions src/sema/symtable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -71,7 +71,7 @@ pub enum VariableUsage {
}

#[derive(Debug, Clone)]
struct VarScope(HashMap<String, usize>, Option<HashSet<usize>>);
struct VarScope(HashMap<String, usize>);

#[derive(Default, Debug, Clone)]
pub struct Symtable {
Expand All @@ -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(),
}
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 4f2e2b6

Please sign in to comment.