Rename the VOID type to INVALID and clean up obsolete comments.

The VOID type isn't used for anything resembling what "void" means in C,
so rename it to INVALID to avoid confusion.
This commit is contained in:
Dan Gohman
2018-09-04 21:46:22 -07:00
parent 18900df4d5
commit d4b8622393
11 changed files with 61 additions and 58 deletions

View File

@@ -179,7 +179,7 @@ class SpecialType(ValueType):
def __init__(self, name, membytes, doc):
# type: (str, int, str) -> None
super(SpecialType, self).__init__(name, membytes, doc)
# Assign numbers starting from 1. (0 is VOID)
# Assign numbers starting from 1. (0 is INVALID)
ValueType.all_special_types.append(self)
self.number = len(ValueType.all_special_types)
assert self.number < LANE_BASE, 'Too many special types'

View File

@@ -22,8 +22,8 @@ This is the information available to us:
## Level 1 table lookup
The CPU mode provides the first table. The key is the instruction's controlling
type variable. If the instruction is not polymorphic, use `VOID` for the type
variable. The table values are level 2 tables.
type variable. If the instruction is not polymorphic, use `INVALID` for the
type variable. The table values are level 2 tables.
## Level 2 table lookup
@@ -682,7 +682,7 @@ def emit_level1_hashtable(cpumode, level1, offt, fmt):
# Empty hash table entry. Include the default legalization action.
if not level2:
fmt.format(
'Level1Entry {{ ty: ir::types::VOID, log2len: !0, '
'Level1Entry {{ ty: ir::types::INVALID, log2len: !0, '
'offset: 0, legalize: {} }},',
level1.legalize_code)
continue
@@ -690,7 +690,7 @@ def emit_level1_hashtable(cpumode, level1, offt, fmt):
if level2.ty is not None:
tyname = level2.ty.rust_name()
else:
tyname = 'ir::types::VOID'
tyname = 'ir::types::INVALID'
lcode = cpumode.isa.legalize_code(level2.legalize)

View File

@@ -705,7 +705,7 @@ def gen_inst_builder(inst, fmt):
args.append(inst.ctrl_typevar.name)
elif not inst.is_polymorphic:
# No controlling type variable needed.
args.append('types::VOID')
args.append('types::INVALID')
else:
assert inst.is_polymorphic and inst.use_typevar_operand
# Infer the controlling type variable from the input operands.