To protect your data, the CISO officer has suggested users to enable GitLab 2FA as soon as possible.

Commit 35803ea8 authored by Isaac Oscar Gariano's avatar Isaac Oscar Gariano
Browse files

Fixed formatting

parent 8b6e3f14
......@@ -77,7 +77,7 @@ impl Instruction {
SwapStackKill { .. } |
Switch { .. } |
ExnInstruction { .. } => true,
_ => false,
_ => false
}
}
......@@ -94,13 +94,43 @@ impl Instruction {
use inst::Instruction_::*;
match self.v {
ExprCall { .. } | ExprCCall { .. } | Load { .. } | Store { .. } | CmpXchg { .. } | AtomicRMW { .. } |
New(_) | AllocA(_) | NewHybrid(_, _) | AllocAHybrid(_, _) | NewStack(_) | NewThread(_, _) |
NewThreadExn(_, _) | NewFrameCursor(_) | Fence(_) | Return(_) | ThreadExit | Throw(_) |
TailCall(_) | Branch1(_) | Branch2 { .. } | Watchpoint { .. } | WPBranch { .. } |
Call { .. } | CCall { .. }| SwapStackExpr{..}| SwapStackExc { .. } | SwapStackKill { .. } | Switch { .. } | ExnInstruction { .. } |
CommonInst_GetThreadLocal | CommonInst_SetThreadLocal(_) | CommonInst_Pin(_) | CommonInst_Unpin(_) |
CommonInst_GetAddr(_) | PrintHex(_) | SetRetval(_) => true,
ExprCall { .. } |
ExprCCall { .. } |
Load { .. } |
Store { .. } |
CmpXchg { .. } |
AtomicRMW { .. } |
New(_) |
AllocA(_) |
NewHybrid(_, _) |
AllocAHybrid(_, _) |
NewStack(_) |
NewThread(_, _) |
NewThreadExn(_, _) |
NewFrameCursor(_) |
Fence(_) |
Return(_) |
ThreadExit |
Throw(_) |
TailCall(_) |
Branch1(_) |
Branch2 { .. } |
Watchpoint { .. } |
WPBranch { .. } |
Call { .. } |
CCall { .. } |
SwapStackExpr { .. } |
SwapStackExc { .. } |
SwapStackKill { .. } |
Switch { .. } |
ExnInstruction { .. } |
CommonInst_GetThreadLocal |
CommonInst_SetThreadLocal(_) |
CommonInst_Pin(_) |
CommonInst_Unpin(_) |
CommonInst_GetAddr(_) |
PrintHex(_) |
SetRetval(_) => true,
_ => false
}
}
......@@ -114,9 +144,9 @@ impl Instruction {
Watchpoint { .. } |
Call { .. } |
CCall { .. } |
SwapStackExc {..} |
SwapStackExc { .. } |
ExnInstruction { .. } => true,
_ => false,
_ => false
}
}
......@@ -133,7 +163,7 @@ impl Instruction {
Watchpoint { ref resume, .. } |
Call { ref resume, .. } |
CCall { ref resume, .. } |
SwapStackExc { ref resume, ..} |
SwapStackExc { ref resume, .. } |
ExnInstruction { ref resume, .. } => Some(resume.exn_dest.target),
_ => None
}
......@@ -352,7 +382,7 @@ pub enum Instruction_ {
resume: ResumptionData
},
// A swap stack with an exception clause (i.e. uses the RET_WITH form)
/// A swap stack with an exception clause (i.e. uses the RET_WITH form)
SwapStackExc {
stack: OpIndex,
is_exception: bool,
......@@ -360,20 +390,21 @@ pub enum Instruction_ {
resume: ResumptionData
},
// A swap stack without an exception clause that is not a terminator (i.e. uses the RET_WITH form)
/// A swap stack without an exception clause that is not a terminator
/// (i.e. uses the RET_WITH form)
SwapStackExpr {
stack: OpIndex,
is_exception: bool,
args: Vec<OpIndex>,
args: Vec<OpIndex>
},
// A swapstack without an exception clause that is a terminator (i.e. one with KILL_OLD)
/// A swapstack without an exception clause that is a terminator (i.e. one with KILL_OLD)
SwapStackKill {
stack: OpIndex,
is_exception: bool,
args: Vec<OpIndex>,
args: Vec<OpIndex>
},
/// a multiway branch
Switch {
cond: OpIndex,
......@@ -619,14 +650,14 @@ impl Instruction_ {
ref data,
ref resume
} => format!("CALL {} {}", data.debug_str(ops), resume.debug_str(ops)),
&Instruction_::CCall {
&Instruction_::CCall {
ref data,
ref resume
} => format!("CCALL {} {}", data.debug_str(ops), resume.debug_str(ops)),
&Instruction_::SwapStackExpr {
stack,
is_exception,
ref args,
ref args
} => {
format!(
"SWAPSTACK {} {} {}",
......@@ -653,7 +684,7 @@ impl Instruction_ {
&Instruction_::SwapStackKill {
stack,
is_exception,
ref args,
ref args
} => {
format!(
"SWAPSTACK {} {} {}",
......@@ -662,7 +693,7 @@ impl Instruction_ {
op_vector_str(args, ops),
)
}
&Instruction_::Switch {
cond,
ref default,
......
......@@ -935,7 +935,6 @@ impl TreeNode {
TreeNode_::Value(ref pv) => pv.ty.clone()
}
}
}
impl fmt::Display for TreeNode {
......
......@@ -13,8 +13,7 @@
// limitations under the License.
#[derive(Copy, Clone, Debug, PartialEq)]
pub
enum BinOp {
pub enum BinOp {
// BinOp Int(n) Int(n) -> Int(n)
Add,
Sub,
......@@ -44,11 +43,7 @@ impl BinOp {
pub fn is_fp(self) -> bool {
use op::BinOp::*;
match self {
FAdd |
FSub |
FMul |
FDiv |
FRem => true,
FAdd | FSub | FMul | FDiv | FRem => true,
_ => false
}
}
......@@ -188,19 +183,21 @@ impl CmpOp {
}
}
pub fn is_fp_cmp(self) -> bool { !self.is_int_cmp() }
pub fn is_fp_cmp(self) -> bool {
!self.is_int_cmp()
}
pub fn is_eq_cmp(self) -> bool {
use op::CmpOp::*;
match self {
EQ | NE => true,
EQ | NE => true,
_ => false
}
}
pub fn is_ult_cmp(self) -> bool {
use op::CmpOp::*;
match self {
UGE | UGT | ULE | ULT => true,
_ => false
UGE | UGT | ULE | ULT => true,
_ => false
}
}
......
......@@ -125,8 +125,12 @@ pub struct MuType {
rodal_struct!(MuType { hdr, v });
impl PartialEq for MuType {
fn eq(&self, other: &MuType) -> bool { self.v == other.v }
fn ne(&self, other: &MuType) -> bool { self.v != other.v }
fn eq(&self, other: &MuType) -> bool {
self.v == other.v
}
fn ne(&self, other: &MuType) -> bool {
self.v != other.v
}
}
impl MuType {
......@@ -198,7 +202,8 @@ impl MuType {
}
pub fn is_eq_comparable(&self) -> bool {
self.is_int() || self.is_ptr() || self.is_iref() || self.is_ref() || self.is_opaque_reference()
self.is_int() || self.is_ptr() || self.is_iref() || self.is_ref() ||
self.is_opaque_reference()
}
pub fn is_ult_comparable(&self) -> bool {
......
......@@ -584,7 +584,7 @@ fn copy_inline_blocks(
&Instruction_::Watchpoint { .. } |
&Instruction_::WPBranch { .. } |
&Instruction_::SwapStackExc { .. } | // Should be safe, just inline it like a call...
&Instruction_::SwapStackExc { .. } |
&Instruction_::ExnInstruction { .. } => unimplemented!(),
_ => {
......
......@@ -2407,7 +2407,7 @@ impl<'lb, 'lvm> BundleLoader<'lb, 'lvm> {
assert_ir!(
impl_opnd1.ty() == impl_opnd2.ty() && impl_opnd1.ty() == impl_ty,
"Invalid instruction {:?}: Operand types {} and {} \
are not what was expected {}",
are not what was expected {}",
inst,
impl_opnd1.ty(),
impl_opnd2.ty(),
......@@ -3239,7 +3239,8 @@ impl<'lb, 'lvm> BundleLoader<'lb, 'lvm> {
let impl_ord = self.build_mem_ord(ord);
let impl_loc = self.get_treenode(fcb, loc);
let impl_rvtype = self.get_built_type(refty);
let impl_rv = self.new_ssa(fcb, result_id, self.vm.make_strong_type(impl_rvtype)).clone_value();
let impl_rv = self.new_ssa(fcb, result_id, self.vm.make_strong_type(impl_rvtype))
.clone_value();
let impl_refty = self.get_built_type(refty);
assert_ir!(impl_ord != MemoryOrder::Release && impl_ord != MemoryOrder::AcqRel);
......
......@@ -1222,7 +1222,7 @@ impl<'a> VM {
pub fn new_stack(&self, func_id: MuID) -> Box<MuStack> {
let funcs = self.funcs.read().unwrap();
let func: &MuFunction = &funcs.get(&func_id).unwrap().read().unwrap();
Box::new(MuStack::new(
self.next_id(),
self.get_address_for_func(func_id),
......
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