Change GlobalVar to GlobalValue

This commit is contained in:
Lachlan Sneff
2018-06-14 01:07:27 -04:00
committed by Dan Gohman
parent 49cc693d64
commit 5c320a0d30
44 changed files with 324 additions and 237 deletions

View File

@@ -16,8 +16,8 @@ ebb = EntityRefKind(
#: A reference to a stack slot declared in the function preamble.
stack_slot = EntityRefKind('stack_slot', 'A stack slot.')
#: A reference to a global variable.
global_var = EntityRefKind('global_var', 'A global variable.')
#: A reference to a global valueiable.
global_value = EntityRefKind('global_value', 'A global value.')
#: A reference to a function sugnature declared in the function preamble.
#: This is used to provide the call signature in a call_indirect instruction.

View File

@@ -18,7 +18,7 @@ UnaryImm = InstructionFormat(imm64)
UnaryIeee32 = InstructionFormat(ieee32)
UnaryIeee64 = InstructionFormat(ieee64)
UnaryBool = InstructionFormat(boolean)
UnaryGlobalVar = InstructionFormat(entities.global_var)
UnaryGlobalValue = InstructionFormat(entities.global_value)
Binary = InstructionFormat(VALUE, VALUE)
BinaryImm = InstructionFormat(VALUE, imm64)
@@ -79,5 +79,5 @@ CondTrap = InstructionFormat(VALUE, trapcode)
IntCondTrap = InstructionFormat(intcc, VALUE, trapcode)
FloatCondTrap = InstructionFormat(floatcc, VALUE, trapcode)
# Finally extract the names of global variables in this module.
# Finally extract the names of global valueiables in this module.
InstructionFormat.extract_names(globals())

View File

@@ -491,19 +491,19 @@ stack_addr = Instruction(
# Global variables.
#
GV = Operand('GV', entities.global_var)
GV = Operand('GV', entities.global_value)
global_addr = Instruction(
'global_addr', r"""
Compute the address of global variable GV.
global_value = Instruction(
'global_value', r"""
Compute the value of global GV.
""",
ins=GV, outs=addr)
# A specialized form of global_addr instructions that only handles
# A specialized form of global_value instructions that only handles
# symbolic names.
globalsym_addr = Instruction(
'globalsym_addr', r"""
Compute the address of global variable GV, which is a symbolic name.
Compute the address of global GV, which is a symbolic name.
""",
ins=GV, outs=addr)

View File

@@ -62,7 +62,7 @@ expand_flags = XFormGroup('expand_flags', """
# Custom expansions for memory objects.
expand.custom_legalize(insts.global_addr, 'expand_global_addr')
expand.custom_legalize(insts.global_value, 'expand_global_value')
expand.custom_legalize(insts.heap_addr, 'expand_heap_addr')
# Custom expansions for calls.

View File

@@ -2,7 +2,7 @@
Cretonne predicates that consider `Function` fields.
"""
from cdsl.predicates import FieldPredicate
from .formats import UnaryGlobalVar, InstructionFormat
from .formats import UnaryGlobalValue, InstructionFormat
try:
from typing import TYPE_CHECKING
@@ -32,7 +32,7 @@ class IsColocatedData(FieldPredicate):
def __init__(self):
# type: () -> None
super(IsColocatedData, self).__init__(
UnaryGlobalVar.global_var, 'is_colocated_data', ('func',))
UnaryGlobalValue.global_value, 'is_colocated_data', ('func',))
class LengthEquals(FieldPredicate):

View File

@@ -53,7 +53,7 @@ call_conv = EnumSetting(
# Note that Cretonne doesn't currently need an is_pie flag, because PIE is just
# PIC where symbols can't be pre-empted, which can be expressed with the
# `colocated` flag on external functions and global variables.
# `colocated` flag on external functions and global valueiables.
is_pic = BoolSetting("Enable Position-Independent Code generation")
colocated_libcalls = BoolSetting(