Clarify the meaning of the symbol_value instruction.

This commit is contained in:
Dan Gohman
2018-09-27 11:43:41 -07:00
parent 6fdd58d143
commit aa5ba71c97
2 changed files with 10 additions and 5 deletions

View File

@@ -502,15 +502,15 @@ global_value = Instruction(
'global_value', r""" 'global_value', r"""
Compute the value of global GV. Compute the value of global GV.
""", """,
ins=GV, outs=addr) ins=GV, outs=a)
# A specialized form of global_value instructions that only handles # A specialized form of global_value instructions that only handles
# symbolic names. # symbolic names.
symbol_value = Instruction( symbol_value = Instruction(
'symbol_value', r""" 'symbol_value', r"""
Compute the value of global GV, which is a symbolic address. Compute the value of global GV, which is a symbolic value.
""", """,
ins=GV, outs=addr) ins=GV, outs=a)
# #
# WebAssembly bounds-checked heap accesses. # WebAssembly bounds-checked heap accesses.

View File

@@ -39,8 +39,13 @@ pub enum GlobalValueData {
global_type: Type, global_type: Type,
}, },
/// Value is a symbolic address. Cranelift itself does not interpret this name; /// Value is symbolic, meaning it's a name which will be resolved to an
/// it's used by embedders to link with other data structures. /// actual value later (eg. by linking). Cranelift itself does not interpret
/// this name; it's used by embedders to link with other data structures.
///
/// For now, symbolic values always have pointer type, and represent
/// addresses, however in the future they could be used to represent other
/// things as well.
Symbol { Symbol {
/// The symbolic name. /// The symbolic name.
name: ExternalName, name: ExternalName,