WARNING! Access to this system is limited to authorised users only.
Unauthorised users may be subject to prosecution.
Unauthorised access to this system is a criminal offence under Australian law (Federal Crimes Act 1914 Part VIA)
It is a criminal offence to:
(1) Obtain access to data without authority. -Penalty 2 years imprisonment.
(2) Damage, delete, alter or insert data without authority. -Penalty 10 years imprisonment.
User activity is monitored and recorded. Anyone using this system expressly consents to such monitoring and recording.

To protect your data, the CISO officer has suggested users to enable 2FA as soon as possible.
Currently 2.7% of users enabled 2FA.

Commit c75b6257 authored by Eduardo Souza's avatar Eduardo Souza
Browse files

Adding array support in Mu LLVM backend.

parent 7e069cf8
......@@ -479,7 +479,7 @@ impl Exp for ArrayAccess {
let var_type = &current_block.var_type_map.get(self.var()).unwrap().clone();
let iref_var_type = match result_type {
t => vm.get_mu_ref_type(&RefType::IRef(t.clone()))
t => vm.get_mu_ref_type(&RefType::IRef(t.clone())),
};
let var_type = vm.get_mu_type(&result_type);
......@@ -506,7 +506,7 @@ impl Exp for ArrayAccess {
let inst = Instruction_::ShiftIRef {
is_ptr: false,
base: 0,
offset: 1
offset: 1,
};
inst
},
......@@ -532,7 +532,7 @@ impl Exp for ArrayAccess {
let inst = Instruction_::Load {
is_ptr: false,
order: MemoryOrder::SeqCst,
mem_loc: 0
mem_loc: 0,
};
inst
},
......@@ -906,7 +906,7 @@ fn initialize_mu_array(
value: Some(vec![var.clone_value()]),
ops: vec![],
v: {
let inst = Instruction_::New(vm.get_mu_type(&array_elem_type));
let inst = Instruction_::New(vm.get_mu_type(&exp_type));
inst
},
});
......@@ -933,7 +933,7 @@ fn initialize_mu_array(
},
});
let mut first_elem= var;
let mut first_elem = var;
let current_block = vm.blocks_map.get_mut(&vm.curr_block).unwrap();
current_block.instr.push(get_iref_instr);
......@@ -2188,10 +2188,7 @@ impl Exp for Var {
let r = current_block.store.get(self.name.as_str());
match r {
Some(v) => {
println!("{:?}", v);
Ok(v.clone())
}
Some(v) => Ok(v.clone()),
None => unimplemented!(),
}
}
......
var int[] x = {12, 232, 33} in
x[1]
\ No newline at end of file
def int foo(int[] x)
x[0]
var int[] x = {13, 25, 32} in
foo(x)
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment