Use PackedOption<Value> instead of NO_VALUE.

- Remove NO_VALUE and ExpandedValue::None.
- Remove the Default implelmentation for Value.
- InstructionData::second_result() returns an Option<Value>.
- InstructionData::second_result() returns a reference to the packed
  option.
This commit is contained in:
Jakob Stoklund Olesen
2017-01-19 15:52:29 -08:00
parent f2b9f62f24
commit 2e6cf219e9
7 changed files with 97 additions and 104 deletions

View File

@@ -16,6 +16,7 @@ use ir::condcodes::*;
use ir::types;
use ref_slice::*;
use packed_option::PackedOption;
// Include code generated by `lib/cretonne/meta/gen_instr.py`. This file contains:
//
@@ -126,7 +127,7 @@ pub enum InstructionData {
UnarySplit {
opcode: Opcode,
ty: Type,
second_result: Value,
second_result: PackedOption<Value>,
arg: Value,
},
Binary {
@@ -150,7 +151,7 @@ pub enum InstructionData {
BinaryOverflow {
opcode: Opcode,
ty: Type,
second_result: Value,
second_result: PackedOption<Value>,
args: [Value; 2],
},
Ternary {
@@ -161,7 +162,7 @@ pub enum InstructionData {
TernaryOverflow {
opcode: Opcode,
ty: Type,
second_result: Value,
second_result: PackedOption<Value>,
data: Box<TernaryOverflowData>,
},
InsertLane {
@@ -207,13 +208,13 @@ pub enum InstructionData {
Call {
opcode: Opcode,
ty: Type,
second_result: Value,
second_result: PackedOption<Value>,
data: Box<CallData>,
},
IndirectCall {
opcode: Opcode,
ty: Type,
second_result: Value,
second_result: PackedOption<Value>,
data: Box<IndirectCallData>,
},
Return {