fixed formatting issues

parent 612f3aa0
Pipeline #3553 passed with stages
in 47 minutes and 59 seconds
......@@ -13,9 +13,9 @@
// limitations under the License.
use ir::*;
use op::*;
use ptr::*;
use types::*;
use op::*;
use utils::vec_utils;
......@@ -32,7 +32,7 @@ pub struct Instruction {
/// This design makes it easy for the compiler to iterate through all the children
pub ops: Vec<P<TreeNode>>,
/// used for pattern matching
pub v: Instruction_
pub v: Instruction_,
}
// Instruction implements MuEntity
......@@ -52,66 +52,66 @@ impl Instruction {
use inst::Instruction_::*;
match self.v {
Return(_) |
ThreadExit |
Throw(_) |
TailCall(_) |
Branch1(_) |
Branch2 { .. } |
Watchpoint { .. } |
WPBranch { .. } |
Call { .. } |
CCall { .. } |
SwapStackExc { .. } |
SwapStackKill { .. } |
Switch { .. } |
ExnInstruction { .. } => true,
BinOp(_, _, _) |
BinOpWithStatus(_, _, _, _) |
CmpOp(_, _, _) |
ConvOp { .. } |
ExprCall { .. } |
ExprCCall { .. } |
Load { .. } |
Store { .. } |
CmpXchg { .. } |
AtomicRMW { .. } |
New(_) |
AllocA(_) |
NewHybrid(_, _) |
AllocAHybrid(_, _) |
NewStack(_) |
NewThread { .. } |
NewFrameCursor(_) |
GetIRef(_) |
GetFieldIRef { .. } |
GetElementIRef { .. } |
ShiftIRef { .. } |
GetVarPartIRef { .. } |
Select { .. } |
Fence(_) |
CommonInst_GetThreadLocal |
CommonInst_SetThreadLocal(_) |
CommonInst_Pin(_) |
CommonInst_Unpin(_) |
CommonInst_GetAddr(_) |
CommonInst_Tr64IsFp(_) |
CommonInst_Tr64IsInt(_) |
CommonInst_Tr64IsRef(_) |
CommonInst_Tr64FromFp(_) |
CommonInst_Tr64FromInt(_) |
CommonInst_Tr64FromRef(_, _) |
CommonInst_Tr64ToFp(_) |
CommonInst_Tr64ToInt(_) |
CommonInst_Tr64ToRef(_) |
CommonInst_Tr64ToTag(_) |
Move(_) |
PrintHex(_) |
SetRetval(_) |
GetVMThreadLocal |
KillStack(_) |
CurrentStack |
SwapStackExpr { .. } => false
Return(_)
| ThreadExit
| Throw(_)
| TailCall(_)
| Branch1(_)
| Branch2 { .. }
| Watchpoint { .. }
| WPBranch { .. }
| Call { .. }
| CCall { .. }
| SwapStackExc { .. }
| SwapStackKill { .. }
| Switch { .. }
| ExnInstruction { .. } => true,
BinOp(_, _, _)
| BinOpWithStatus(_, _, _, _)
| CmpOp(_, _, _)
| ConvOp { .. }
| ExprCall { .. }
| ExprCCall { .. }
| Load { .. }
| Store { .. }
| CmpXchg { .. }
| AtomicRMW { .. }
| New(_)
| AllocA(_)
| NewHybrid(_, _)
| AllocAHybrid(_, _)
| NewStack(_)
| NewThread { .. }
| NewFrameCursor(_)
| GetIRef(_)
| GetFieldIRef { .. }
| GetElementIRef { .. }
| ShiftIRef { .. }
| GetVarPartIRef { .. }
| Select { .. }
| Fence(_)
| CommonInst_GetThreadLocal
| CommonInst_SetThreadLocal(_)
| CommonInst_Pin(_)
| CommonInst_Unpin(_)
| CommonInst_GetAddr(_)
| CommonInst_Tr64IsFp(_)
| CommonInst_Tr64IsInt(_)
| CommonInst_Tr64IsRef(_)
| CommonInst_Tr64FromFp(_)
| CommonInst_Tr64FromInt(_)
| CommonInst_Tr64FromRef(_, _)
| CommonInst_Tr64ToFp(_)
| CommonInst_Tr64ToInt(_)
| CommonInst_Tr64ToRef(_)
| CommonInst_Tr64ToTag(_)
| Move(_)
| PrintHex(_)
| SetRetval(_)
| GetVMThreadLocal
| KillStack(_)
| CurrentStack
| SwapStackExpr { .. } => false,
}
}
......@@ -128,66 +128,66 @@ impl Instruction {
use inst::Instruction_::*;
match self.v {
ExprCall { .. } |
ExprCCall { .. } |
Load { .. } |
Store { .. } |
CmpXchg { .. } |
AtomicRMW { .. } |
New(_) |
AllocA(_) |
NewHybrid(_, _) |
AllocAHybrid(_, _) |
NewStack(_) |
NewThread { .. } |
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(_) |
KillStack(_) => true,
BinOp(_, _, _) |
BinOpWithStatus(_, _, _, _) |
CmpOp(_, _, _) |
ConvOp { .. } |
GetIRef(_) |
GetFieldIRef { .. } |
GetElementIRef { .. } |
ShiftIRef { .. } |
GetVarPartIRef { .. } |
Select { .. } |
CommonInst_Tr64IsFp(_) |
CommonInst_Tr64IsInt(_) |
CommonInst_Tr64IsRef(_) |
CommonInst_Tr64FromFp(_) |
CommonInst_Tr64FromInt(_) |
CommonInst_Tr64FromRef(_, _) |
CommonInst_Tr64ToFp(_) |
CommonInst_Tr64ToInt(_) |
CommonInst_Tr64ToRef(_) |
CommonInst_Tr64ToTag(_) |
Move(_) |
CurrentStack |
GetVMThreadLocal => false
ExprCall { .. }
| ExprCCall { .. }
| Load { .. }
| Store { .. }
| CmpXchg { .. }
| AtomicRMW { .. }
| New(_)
| AllocA(_)
| NewHybrid(_, _)
| AllocAHybrid(_, _)
| NewStack(_)
| NewThread { .. }
| 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(_)
| KillStack(_) => true,
BinOp(_, _, _)
| BinOpWithStatus(_, _, _, _)
| CmpOp(_, _, _)
| ConvOp { .. }
| GetIRef(_)
| GetFieldIRef { .. }
| GetElementIRef { .. }
| ShiftIRef { .. }
| GetVarPartIRef { .. }
| Select { .. }
| CommonInst_Tr64IsFp(_)
| CommonInst_Tr64IsInt(_)
| CommonInst_Tr64IsRef(_)
| CommonInst_Tr64FromFp(_)
| CommonInst_Tr64FromInt(_)
| CommonInst_Tr64FromRef(_, _)
| CommonInst_Tr64ToFp(_)
| CommonInst_Tr64ToInt(_)
| CommonInst_Tr64ToRef(_)
| CommonInst_Tr64ToTag(_)
| Move(_)
| CurrentStack
| GetVMThreadLocal => false,
}
}
......@@ -197,66 +197,66 @@ impl Instruction {
use inst::Instruction_::*;
match self.v {
Watchpoint { .. } |
Call { .. } |
CCall { .. } |
SwapStackExc { .. } |
ExnInstruction { .. } => true,
BinOp(_, _, _) |
BinOpWithStatus(_, _, _, _) |
CmpOp(_, _, _) |
ConvOp { .. } |
ExprCall { .. } |
ExprCCall { .. } |
Load { .. } |
Store { .. } |
CmpXchg { .. } |
AtomicRMW { .. } |
New(_) |
AllocA(_) |
NewHybrid(_, _) |
AllocAHybrid(_, _) |
NewStack(_) |
NewThread { .. } |
NewFrameCursor(_) |
GetIRef(_) |
GetFieldIRef { .. } |
GetElementIRef { .. } |
ShiftIRef { .. } |
GetVarPartIRef { .. } |
Fence(_) |
Return(_) |
ThreadExit |
Throw(_) |
TailCall(_) |
Branch1(_) |
Branch2 { .. } |
Select { .. } |
WPBranch { .. } |
Switch { .. } |
CommonInst_GetThreadLocal |
CommonInst_SetThreadLocal(_) |
CommonInst_Pin(_) |
CommonInst_Unpin(_) |
CommonInst_GetAddr(_) |
CommonInst_Tr64IsFp(_) |
CommonInst_Tr64IsInt(_) |
CommonInst_Tr64IsRef(_) |
CommonInst_Tr64FromFp(_) |
CommonInst_Tr64FromInt(_) |
CommonInst_Tr64FromRef(_, _) |
CommonInst_Tr64ToFp(_) |
CommonInst_Tr64ToInt(_) |
CommonInst_Tr64ToRef(_) |
CommonInst_Tr64ToTag(_) |
Move(_) |
PrintHex(_) |
SetRetval(_) |
GetVMThreadLocal |
KillStack(_) |
CurrentStack |
SwapStackExpr { .. } |
SwapStackKill { .. } => false
Watchpoint { .. }
| Call { .. }
| CCall { .. }
| SwapStackExc { .. }
| ExnInstruction { .. } => true,
BinOp(_, _, _)
| BinOpWithStatus(_, _, _, _)
| CmpOp(_, _, _)
| ConvOp { .. }
| ExprCall { .. }
| ExprCCall { .. }
| Load { .. }
| Store { .. }
| CmpXchg { .. }
| AtomicRMW { .. }
| New(_)
| AllocA(_)
| NewHybrid(_, _)
| AllocAHybrid(_, _)
| NewStack(_)
| NewThread { .. }
| NewFrameCursor(_)
| GetIRef(_)
| GetFieldIRef { .. }
| GetElementIRef { .. }
| ShiftIRef { .. }
| GetVarPartIRef { .. }
| Fence(_)
| Return(_)
| ThreadExit
| Throw(_)
| TailCall(_)
| Branch1(_)
| Branch2 { .. }
| Select { .. }
| WPBranch { .. }
| Switch { .. }
| CommonInst_GetThreadLocal
| CommonInst_SetThreadLocal(_)
| CommonInst_Pin(_)
| CommonInst_Unpin(_)
| CommonInst_GetAddr(_)
| CommonInst_Tr64IsFp(_)
| CommonInst_Tr64IsInt(_)
| CommonInst_Tr64IsRef(_)
| CommonInst_Tr64FromFp(_)
| CommonInst_Tr64FromInt(_)
| CommonInst_Tr64FromRef(_, _)
| CommonInst_Tr64ToFp(_)
| CommonInst_Tr64ToInt(_)
| CommonInst_Tr64ToRef(_)
| CommonInst_Tr64ToTag(_)
| Move(_)
| PrintHex(_)
| SetRetval(_)
| GetVMThreadLocal
| KillStack(_)
| CurrentStack
| SwapStackExpr { .. }
| SwapStackKill { .. } => false,
}
}
......@@ -270,66 +270,66 @@ impl Instruction {
pub fn get_exception_target(&self) -> Option<MuID> {
use inst::Instruction_::*;
match self.v {
Watchpoint { ref resume, .. } |
Call { ref resume, .. } |
CCall { ref resume, .. } |
SwapStackExc { ref resume, .. } |
ExnInstruction { ref resume, .. } => Some(resume.exn_dest.target.id()),
BinOp(_, _, _) |
BinOpWithStatus(_, _, _, _) |
CmpOp(_, _, _) |
ConvOp { .. } |
ExprCall { .. } |
ExprCCall { .. } |
Load { .. } |
Store { .. } |
CmpXchg { .. } |
AtomicRMW { .. } |
New(_) |
AllocA(_) |
NewHybrid(_, _) |
AllocAHybrid(_, _) |
NewStack(_) |
NewThread { .. } |
NewFrameCursor(_) |
GetIRef(_) |
GetFieldIRef { .. } |
GetElementIRef { .. } |
ShiftIRef { .. } |
GetVarPartIRef { .. } |
Fence(_) |
Return(_) |
ThreadExit |
Throw(_) |
TailCall(_) |
Branch1(_) |
Branch2 { .. } |
Select { .. } |
WPBranch { .. } |
Switch { .. } |
CommonInst_GetThreadLocal |
CommonInst_SetThreadLocal(_) |
CommonInst_Pin(_) |
CommonInst_Unpin(_) |
CommonInst_GetAddr(_) |
CommonInst_Tr64IsFp(_) |
CommonInst_Tr64IsInt(_) |
CommonInst_Tr64IsRef(_) |
CommonInst_Tr64FromFp(_) |
CommonInst_Tr64FromInt(_) |
CommonInst_Tr64FromRef(_, _) |
CommonInst_Tr64ToFp(_) |
CommonInst_Tr64ToInt(_) |
CommonInst_Tr64ToRef(_) |
CommonInst_Tr64ToTag(_) |
Move(_) |
PrintHex(_) |
SetRetval(_) |
GetVMThreadLocal |
KillStack(_) |
CurrentStack |
SwapStackExpr { .. } |
SwapStackKill { .. } => None
Watchpoint { ref resume, .. }
| Call { ref resume, .. }
| CCall { ref resume, .. }
| SwapStackExc { ref resume, .. }
| ExnInstruction { ref resume, .. } => Some(resume.exn_dest.target.id()),
BinOp(_, _, _)
| BinOpWithStatus(_, _, _, _)
| CmpOp(_, _, _)
| ConvOp { .. }
| ExprCall { .. }
| ExprCCall { .. }
| Load { .. }
| Store { .. }
| CmpXchg { .. }
| AtomicRMW { .. }
| New(_)
| AllocA(_)
| NewHybrid(_, _)
| AllocAHybrid(_, _)
| NewStack(_)
| NewThread { .. }
| NewFrameCursor(_)
| GetIRef(_)
| GetFieldIRef { .. }
| GetElementIRef { .. }
| ShiftIRef { .. }
| GetVarPartIRef { .. }
| Fence(_)
| Return(_)
| ThreadExit
| Throw(_)
| TailCall(_)
| Branch1(_)
| Branch2 { .. }
| Select { .. }
| WPBranch { .. }
| Switch { .. }
| CommonInst_GetThreadLocal
| CommonInst_SetThreadLocal(_)
| CommonInst_Pin(_)
| CommonInst_Unpin(_)
| CommonInst_GetAddr(_)
| CommonInst_Tr64IsFp(_)
| CommonInst_Tr64IsInt(_)
| CommonInst_Tr64IsRef(_)
| CommonInst_Tr64FromFp(_)
| CommonInst_Tr64FromInt(_)
| CommonInst_Tr64FromRef(_, _)
| CommonInst_Tr64ToFp(_)
| CommonInst_Tr64ToInt(_)
| CommonInst_Tr64ToRef(_)
| CommonInst_Tr64ToTag(_)
| Move(_)
| PrintHex(_)
| SetRetval(_)
| GetVMThreadLocal
| KillStack(_)
| CurrentStack
| SwapStackExpr { .. }
| SwapStackKill { .. } => None,
}
}
......@@ -413,16 +413,14 @@ impl Instruction {
&Instruction_::BinOp(op, op1, op2) => {
format!("{}<{}> {} {}", op, ops[op1].ty(), ops[op1], ops[op2])
}
&Instruction_::BinOpWithStatus(op, status, op1, op2) => {
format!(
"{}{}<{}> {} {}",
op,
status,
ops[op1].ty(),
ops[op1],
ops[op2]
)
}
&Instruction_::BinOpWithStatus(op, status, op1, op2) => format!(
"{}{}<{}> {} {}",
op,
status,
ops[op1].ty(),
ops[op1],
ops[op2]
),
&Instruction_::CmpOp(op, op1, op2) => {
format!("{}<{}> {} {}", op, ops[op1].ty(), ops[op1], ops[op2])
}
......@@ -430,7 +428,7 @@ impl Instruction {
operation,
ref from_ty,
ref to_ty,
operand
operand,
} => format!("{} <{} {}> {}", operation, from_ty, to_ty, ops[operand]),
&Instruction_::ExprCall { ref data, is_abort } => {
if is_abort {
......@@ -447,7 +445,7 @@ impl Instruction {
&Instruction_::Load {
is_ptr,
mem_loc,
order
order,
} => {
let ptr = select_value!(is_ptr, " PTR", "");
format!(
......@@ -462,7 +460,7 @@ impl Instruction {
value,
is_ptr,
mem_loc,
order
order,
} => {
let ptr = select_value!(is_ptr, " PTR", "");
format!(
......@@ -481,7 +479,7 @@ impl Instruction {
fail_order,
mem_loc,
expected_value,
desired_value
desired_value,
} => {
let ptr = select_value!(is_ptr, " PTR", "");
let weak = select_value!(is_weak, " WEAK", "");
......@@ -502,7 +500,7 @@ impl Instruction {
order,
op,
mem_loc,
value
value,
} => {
let ptr = select_value!(is_ptr, " PTR", "");
format!(
......@@ -523,18 +521,16 @@ impl Instruction {
&Instruction_::AllocAHybrid(ref ty, len) => {
format!("ALLOCAHYBRID<{} {}> {}", ty, ops[len].ty(), ops[len])
}
&Instruction_::NewStack(func) => {
format!(
"COMMINST @uvm.new_stack<[{}]>({})",
ops[func].ty().get_sig().unwrap(),
ops[func]