diff --git a/TP05/tp5b.pdf b/TP05/tp5b.pdf
index 2023fc1..1326560 100644
Binary files a/TP05/tp5b.pdf and b/TP05/tp5b.pdf differ
diff --git a/docs/html/.buildinfo b/docs/html/.buildinfo
index 1f994e9..f2ba597 100644
--- a/docs/html/.buildinfo
+++ b/docs/html/.buildinfo
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
-config: 486d1ff73ffb3f41d31651516deff8a8
+config: 33a23b4514891ef44049bf19634072fc
tags: 645f666f9bcd5a90fca523b33c5a78b7
diff --git a/docs/html/_modules/Lib/Allocator.html b/docs/html/_modules/Lib/Allocator.html
index 0abe9c5..2c64d77 100644
--- a/docs/html/_modules/Lib/Allocator.html
+++ b/docs/html/_modules/Lib/Allocator.html
@@ -92,7 +92,7 @@
[docs]class Allocator():
-
"""General base class for Naive, AllInMem and Smart Allocators.
+
"""General base class for Naive, AllInMem and Smart Allocators.
Replace all temporaries in the code with actual data locations.
Allocation is done in two steps:
@@ -118,23 +118,23 @@
pass
[docs] def replace(self, old_instr: Instruction) -> List[Instruction]:
-
"""Transform an instruction with temporaries into a list of instructions."""
+
"""Transform an instruction with temporaries into a list of instructions."""
return [old_instr]
[docs] def rewriteCode(self, listcode) -> None:
-
"""Modify the code to replace temporaries with
+
"""Modify the code to replace temporaries with
registers or memory locations.
"""
listcode.iter_statements(self.replace)
[docs]class NaiveAllocator(Allocator):
-
"""Naive Allocator: try to assign a register to each temporary,
+
"""Naive Allocator: try to assign a register to each temporary,
fails if there are more temporaries than registers.
"""
[docs] def replace(self, old_instr: Instruction) -> List[Instruction]:
-
"""Replace Temporary operands with the corresponding allocated Register."""
+
"""Replace Temporary operands with the corresponding allocated Register."""
new_args: List[Operand] = []
for arg in old_instr.args():
if isinstance(arg, Temporary):
@@ -145,7 +145,7 @@
return [new_instr]
[docs] def prepare(self) -> None:
-
"""Allocate all temporaries to registers.
+
"""Allocate all temporaries to registers.
Fail if there are too many temporaries."""
regs = list(GP_REGS) # Get a writable copy
temp_allocation: Dict[Temporary, DataLocation] = dict()
diff --git a/docs/html/_modules/Lib/CFG.html b/docs/html/_modules/Lib/CFG.html
index 6764529..12e2257 100644
--- a/docs/html/_modules/Lib/CFG.html
+++ b/docs/html/_modules/Lib/CFG.html
@@ -102,7 +102,7 @@
[docs]class Block:
-
"""
+
"""
A basic block of a :py:class:`CFG` is made of three main parts:
- a start :py:class:`label <Lib.Statement.Label>` that uniquely identifies the block in the CFG
@@ -138,7 +138,7 @@
return s
[docs] def to_dot(self) -> str: # pragma: no cover
-
"""Outputs all statements of the block as a string."""
+
"""Outputs all statements of the block as a string."""
# dot is weird: lines ending with \l instead of \n are left-aligned.
NEWLINE = '\\l '
instr = []
@@ -153,11 +153,11 @@
return str(self._label)
[docs] def get_body(self) -> List[BlockInstr]:
-
"""Return the statements in the body of the block (no phi-node nor the terminator)."""
+
"""Return the statements in the body of the block (no phi-node nor the terminator)."""
return self._instructions
[docs] def get_all_statements(self) -> List[Statement]:
-
"""
+
"""
Return all statements of the block
(including phi-nodes and the terminator, but not the label of the block).
"""
@@ -166,7 +166,7 @@
[self.get_terminator()])
[docs] def get_body_and_terminator(self) -> List[Statement]:
-
"""
+
"""
Return all statements of the block, except phi-nodes
(and the label of the block).
"""
@@ -174,39 +174,39 @@
[self.get_terminator()])
[docs] def get_label(self) -> Label:
-
"""Return the label of the block."""
+
"""Return the label of the block."""
return self._label
[docs] def get_in(self) -> List['Block']:
-
"""Return the list of blocks with an edge to the considered block."""
+
"""Return the list of blocks with an edge to the considered block."""
return self._in
[docs] def get_terminator(self) -> Terminator:
-
"""Return the terminator of the block."""
+
"""Return the terminator of the block."""
return self._terminator
[docs] def set_terminator(self, term: Terminator) -> None:
-
"""Set the terminator of the block."""
+
"""Set the terminator of the block."""
self._terminator = term
[docs] def get_phis(self) -> List[Statement]:
-
"""Return the list of all φ instructions of the block."""
+
"""Return the list of all φ instructions of the block."""
return self._phis
[docs] def add_phi(self, phi: Statement) -> None:
-
"""Add a φ instruction to the block."""
+
"""Add a φ instruction to the block."""
self._phis.append(phi)
[docs] def set_phis(self, phis: List[Statement]) -> None:
-
"""Replace the φ instructions in the block by the given list `phis`."""
+
"""Replace the φ instructions in the block by the given list `phis`."""
self._phis = phis
[docs] def remove_all_phis(self) -> None:
-
"""Remove all φ instructions in the block."""
+
"""Remove all φ instructions in the block."""
self._phis = []
[docs] def iter_statements(self, f) -> None:
-
"""Iterate over instructions.
+
"""Iterate over instructions.
For each real instruction i (not label or comment), replace it
with the list of instructions given by f(i).
@@ -225,12 +225,12 @@
.format(self.get_terminator(), end_statements))
[docs] def add_instruction(self, instr: BlockInstr) -> None:
-
"""Add an instruction to the body of the block."""
+
"""Add an instruction to the body of the block."""
self._instructions.append(instr)
[docs]class CFG:
-
"""
+
"""
A complete control-flow graph representing a function.
This class is mainly made of a list of basic :py:class:`Block`,
a label indicating the :py:meth:`entry point of the function <get_start>`,
@@ -254,7 +254,7 @@
self._end = self.fdata.fresh_label("end")
def _init_blks(self) -> None:
-
"""Add a block for division by 0."""
+
"""Add a block for division by 0."""
# Label for the address of the error message
# This address is added by print_code
label_div_by_zero_msg = Label(self.fdata._label_div_by_zero.name + "_msg")
@@ -267,53 +267,53 @@
self.add_block(blk)
[docs] def get_start(self) -> Label:
-
"""Return the entry label of the CFG."""
+
"""Return the entry label of the CFG."""
return self._start
[docs] def set_start(self, start: Label) -> None:
-
"""Set the entry label of the CFG."""
+
"""Set the entry label of the CFG."""
assert (start in self._blocks)
self._start = start
[docs] def get_end(self) -> Label:
-
"""Return the exit label of the CFG."""
+
"""Return the exit label of the CFG."""
return self._end
[docs] def add_block(self, blk: Block) -> None:
-
"""Add a new block to the CFG."""
+
"""Add a new block to the CFG."""
self._blocks[blk._label] = blk
[docs] def get_block(self, name: Label) -> Block:
-
"""Return the block with label `name`."""
+
"""Return the block with label `name`."""
return self._blocks[name]
[docs] def get_blocks(self) -> List[Block]:
-
"""Return all the blocks."""
+
"""Return all the blocks."""
return [b for b in self._blocks.values()]
[docs] def get_entries(self) -> List[Block]:
-
"""Return all the blocks with no predecessors."""
+
"""Return all the blocks with no predecessors."""
return [b for b in self._blocks.values() if not b.get_in()]
[docs] def add_edge(self, src: Block, dest: Block) -> None:
-
"""Add the edge src -> dest in the control flow graph."""
+
"""Add the edge src -> dest in the control flow graph."""
dest.get_in().append(src)
# assert (dest.get_label() in src.get_terminator().targets())
[docs] def remove_edge(self, src: Block, dest: Block) -> None:
-
"""Remove the edge src -> dest in the control flow graph."""
+
"""Remove the edge src -> dest in the control flow graph."""
dest.get_in().remove(src)
# assert (dest.get_label() not in src.get_terminator().targets())
[docs] def out_blocks(self, block: Block) -> List[Block]:
-
"""
+
"""
Return the list of blocks in the CFG targeted by
the Terminator of Block block.
"""
return [self.get_block(dest) for dest in block.get_terminator().targets()]
[docs] def gather_defs(self) -> Dict[Any, Set[Block]]:
-
"""
+
"""
Return a dictionary associating variables to all the blocks
containing one of their definitions.
"""
@@ -328,12 +328,12 @@
return defs
[docs] def iter_statements(self, f) -> None:
-
"""Apply f to all instructions in all the blocks."""
+
"""Apply f to all instructions in all the blocks."""
for b in self.get_blocks():
b.iter_statements(f)
[docs] def linearize_naive(self) -> Iterator[Statement]:
-
"""
+
"""
Linearize the given control flow graph as a list of instructions.
Naive procedure that adds jumps everywhere.
"""
@@ -353,13 +353,13 @@
[docs] def print_code(self, output, linearize=(lambda cfg: list(cfg.linearize_naive())),
comment=None) -> None:
-
"""Print the linearization of the CFG."""
+
"""Print the linearization of the CFG."""
statements = linearize(self)
_print_code(statements, self.fdata, output, init_label=self._start,
fin_label=self._end, fin_div0=False, comment=comment)
[docs] def print_dot(self, filename, DF=None, view=False) -> None: # pragma: no cover
-
"""Print the CFG as a graph."""
+
"""Print the CFG as a graph."""
graph = Digraph()
# nodes
for name, blk in self._blocks.items():
diff --git a/docs/html/_modules/Lib/Dominators.html b/docs/html/_modules/Lib/Dominators.html
index 657816f..7c2f30f 100644
--- a/docs/html/_modules/Lib/Dominators.html
+++ b/docs/html/_modules/Lib/Dominators.html
@@ -92,7 +92,7 @@
[docs]def computeDom(cfg: CFG) -> Dict[Block, Set[Block]]:
-
"""
+
"""
`computeDom(cfg)` computes the table associating blocks to their
dominators in `cfg`.
It works by solving the equation system.
@@ -123,7 +123,7 @@
[docs]def printDT(filename: str, graph: Dict[Block, Set[Block]]) -> None: # pragma: no cover
-
"""Display a graphical rendering of the given domination tree."""
+
"""Display a graphical rendering of the given domination tree."""
dot = Digraph()
for k in graph:
dot.node(str(k.get_label()))
@@ -135,7 +135,7 @@
[docs]def computeDT(cfg: CFG, dominators: Dict[Block, Set[Block]],
dom_graphs: bool, basename: str) -> Dict[Block, Set[Block]]:
-
"""
+
"""
`computeDT(cfg, dominators)` computes the domination tree of `cfg`
using the previously computed `dominators`.
It returns `DT`, a dictionary which associates a block with its children
@@ -174,7 +174,7 @@
DT: Dict[Block, Set[Block]],
b: Block,
DF: Dict[Block, Set[Block]]) -> None:
-
"""
+
"""
`_computeDF_at_block(...)` computes the dominance frontier at the given block,
by updating `DF`.
@@ -192,7 +192,7 @@
[docs]def computeDF(cfg: CFG, dominators: Dict[Block, Set[Block]],
DT: Dict[Block, Set[Block]], dom_graphs: bool, basename: str
) -> Dict[Block, Set[Block]]:
-
"""
+
"""
`computeDF(...)` computes the dominance frontier of a CFG.
It returns `DF` which associates a block to its frontier.
diff --git a/docs/html/_modules/Lib/FunctionData.html b/docs/html/_modules/Lib/FunctionData.html
index ef804b1..d4179ba 100644
--- a/docs/html/_modules/Lib/FunctionData.html
+++ b/docs/html/_modules/Lib/FunctionData.html
@@ -94,7 +94,7 @@
[docs]class FunctionData:
-
"""
+
"""
Stores some metadata on a RiscV function:
name of the function, label names, temporary variables
(using :py:class:`Lib.Operands.TemporaryPool`),
@@ -119,18 +119,18 @@
self._label_div_by_zero = self.fresh_label("div_by_zero")
[docs] def get_name(self) -> str:
-
"""Return the name of the function."""
+
"""Return the name of the function."""
return self._name
[docs] def fresh_tmp(self) -> Temporary:
-
"""
+
"""
Return a new fresh Temporary,
which is added to the pool.
"""
return self._pool.fresh_tmp()
[docs] def fresh_offset(self) -> Offset:
-
"""
+
"""
Return a new offset in the memory stack.
Offsets are decreasing relative to FP.
"""
@@ -144,20 +144,20 @@
return Offset(FP, -8 * self._dec)
[docs] def get_offset(self) -> int:
-
"""
+
"""
Return the current offset in the memory stack.
"""
return self._dec
def _fresh_label_name(self, name) -> str:
-
"""
+
"""
Return a new unique label name based on the given string.
"""
self._nblabel = self._nblabel + 1
return name + "_" + str(self._nblabel) + "_" + self._name
[docs] def fresh_label(self, name) -> Label:
-
"""
+
"""
Return a new label, with a unique name based on the given string.
"""
return Label(self._fresh_label_name(name))
@@ -171,7 +171,7 @@
def _iter_statements(
listIns: List[_T], f: Callable[[_T], List[_T]]) -> List[_T | Comment]:
-
"""Iterate over instructions.
+
"""Iterate over instructions.
For each real instruction i (not label or comment), replace it
with the list of instructions given by f(i).
"""
@@ -191,7 +191,7 @@
def _print_code(listIns: List, fdata: FunctionData, output,
init_label=None, fin_label=None, fin_div0=False, comment=None) -> None:
-
"""
+
"""
Please use print_code from LinearCode or CFG, not directly this one.
Print the instructions from listIns, forming fdata, on output.
@@ -214,9 +214,9 @@
# We use t0 because it is caller-saved
output.write("""
.text
-
.globl {0}
+
.globl {0}
{0}:
-
li t0, {1}
+
li t0, {1}
sub sp, sp, t0
sd ra, 0(sp)
sd fp, 8(sp)
@@ -226,7 +226,7 @@
if init_label is not None:
# Add a jump to init_label before the generated code.
output.write("""
-
j {0}
+
j {0}
""".format(init_label))
output.write("\n\n##Generated Code\n")
# Generated code
@@ -243,7 +243,7 @@
output.write("""
ld ra, 0(sp)
ld fp, 8(sp)
-
li t0, {0}
+
li t0, {0}
add sp, sp, t0
ret
""".format(cardoffset))
diff --git a/docs/html/_modules/Lib/Graphes.html b/docs/html/_modules/Lib/Graphes.html
index 8530b26..049b6c4 100644
--- a/docs/html/_modules/Lib/Graphes.html
+++ b/docs/html/_modules/Lib/Graphes.html
@@ -87,7 +87,7 @@
[docs]class GraphError(Exception):
-
"""Exception raised for self loops.
+
"""Exception raised for self loops.
"""
message: str
@@ -97,7 +97,7 @@
[docs]class GeneralGraph(object):
-
"""
+
"""
General class regrouping similarities
between directed and non oriented graphs.
The only differences between the two are:
@@ -113,7 +113,7 @@
graph_dict: Dict[Any, Set]
def __init__(self, graph_dict=None):
-
"""
+
"""
Initializes a graph object.
If no dictionary or None is given,
an empty dictionary will be used.
@@ -123,11 +123,11 @@
self.graph_dict = graph_dict
[docs] def vertices(self) -> List[Any]:
-
"""Return the vertices of a graph."""
+
"""Return the vertices of a graph."""
return list(self.graph_dict.keys())
[docs] def add_vertex(self, vertex: Any) -> None:
-
"""
+
"""
If the vertex "vertex" is not in
self.graph_dict, a key "vertex" with an empty
list as a value is added to the dictionary.
@@ -137,7 +137,7 @@
self.graph_dict[vertex] = set()
[docs] def edges(self) -> List[Set]:
-
"""Return the edges of the graph."""
+
"""Return the edges of the graph."""
return []
def __str__(self):
@@ -150,7 +150,7 @@
return res
[docs] def dfs_traversal(self, root: Any) -> List[Any]:
-
"""
+
"""
Compute a depth first search of the graph,
from the vertex root.
"""
@@ -165,11 +165,11 @@
return seen
[docs] def is_reachable_from(self, v1: Any, v2: Any) -> bool:
-
"""True if there is a path from v1 to v2."""
+
"""True if there is a path from v1 to v2."""
return v2 in self.dfs_traversal(v1)
[docs] def connected_components(self) -> List[List[Any]]:
-
"""
+
"""
Compute the list of all connected components of the graph,
each component being a list of vetices.
"""
@@ -183,7 +183,7 @@
return components
[docs] def bfs_traversal(self, root: Any) -> List[Any]:
-
"""
+
"""
Compute a breadth first search of the graph,
from the vertex root.
"""
@@ -199,10 +199,10 @@
[docs]class Graph(GeneralGraph):
-
"""Class for non oriented graphs."""
+
"""Class for non oriented graphs."""
[docs] def edges(self) -> List[Set]:
-
"""
+
"""
A static method generating the set of edges
(they appear twice in the dictionnary).
Return a list of sets.
@@ -215,7 +215,7 @@
return edges
[docs] def add_edge(self, edge: Tuple[Any, Any]) -> None:
-
"""
+
"""
Add an edge in the graph.
edge should be a pair and not (c,c)
(we call g.add_edge((v1,v2)))
@@ -234,7 +234,7 @@
self.graph_dict[vertex2] = {vertex1}
[docs] def print_dot(self, name: str, colors={}) -> None:
-
"""Print the graph."""
+
"""Print the graph."""
color_names = ['red', 'blue', 'green', 'yellow', 'cyan', 'magenta'] + \
[f"grey{i}" for i in range(0, 100, 10)]
color_shapes = ['ellipse', 'box', 'diamond', 'trapezium', 'egg',
@@ -261,20 +261,20 @@
dot.render(name, view=True) # print in pdf
[docs] def delete_vertex(self, vertex: Any) -> None:
-
"""Delete a vertex and all the adjacent edges."""
+
"""Delete a vertex and all the adjacent edges."""
gdict = self.graph_dict
for neighbour in gdict[vertex]:
gdict[neighbour].remove(vertex)
del gdict[vertex]
[docs] def delete_edge(self, edge: Tuple[Any, Any]):
-
"""Delete an edge."""
+
"""Delete an edge."""
(v1, v2) = edge
self.graph_dict[v1].remove(v2)
self.graph_dict[v2].remove(v1)
[docs] def color(self) -> Dict[Any, int]:
-
"""
+
"""
Color the graph with an unlimited number of colors.
Return a dict vertex -> color, where color is an integer (0, 1, ...).
"""
@@ -283,7 +283,7 @@
# see algo of the course
[docs] def color_with_k_colors(self, K=None, avoidingnodes=()) -> Tuple[Dict[Any, int], bool, List]:
-
"""
+
"""
Color with <= K colors (if K is unspecified, use unlimited colors).
Return 3 values:
@@ -336,18 +336,18 @@
[docs]class DiGraph(GeneralGraph):
-
"""Class for directed graphs."""
+
"""Class for directed graphs."""
[docs] def pred(self, v: Any) -> Set:
-
"""Return all predecessors of the vertex `v` in the graph."""
+
"""Return all predecessors of the vertex `v` in the graph."""
return {src for src, dests in self.graph_dict.items() if v in dests}
[docs] def neighbourhoods(self) -> List[Tuple[Any, Set]]:
-
"""Return all neighbourhoods in the graph."""
+
"""Return all neighbourhoods in the graph."""
return list(self.graph_dict.items())
[docs] def edges(self) -> List[Set]:
-
""" A static method generating the set of edges"""
+
""" A static method generating the set of edges"""
edges = []
for vertex in self.graph_dict:
for neighbour in self.graph_dict[vertex]:
@@ -355,7 +355,7 @@
return edges
[docs] def add_edge(self, edge: Tuple[Any, Any]) -> None:
-
"""
+
"""
Add an edge in the graph.
edge should be a pair and not (c,c)
(we call g.add_edge((v1,v2)))
@@ -369,7 +369,7 @@
self.graph_dict[vertex2] = set()
[docs] def print_dot(self, name: str) -> None:
-
"""Print the graph."""
+
"""Print the graph."""
dot = Digraph(comment='Conflict Graph')
for k in self.graph_dict:
shape = None
@@ -381,14 +381,14 @@
dot.render(name, view=True) # print in pdf
[docs] def delete_vertex(self, vertex: Any) -> None:
-
"""Delete a vertex and all the adjacent edges."""
+
"""Delete a vertex and all the adjacent edges."""
for node, neighbours in self.graph_dict.items():
if vertex in neighbours:
neighbours.remove(vertex)
del self.graph_dict[vertex]
[docs] def delete_edge(self, edge: Tuple[Any, Any]) -> None:
-
"""Delete an edge."""
+
"""Delete an edge."""
(v1, v2) = edge
self.graph_dict[v1].remove(v2)
diff --git a/docs/html/_modules/Lib/LinearCode.html b/docs/html/_modules/Lib/LinearCode.html
index cc12086..63046f3 100644
--- a/docs/html/_modules/Lib/LinearCode.html
+++ b/docs/html/_modules/Lib/LinearCode.html
@@ -97,7 +97,7 @@
[docs]class LinearCode:
-
"""
+
"""
Representation of a RiscV program as a list of instructions.
:py:meth:`add_instruction` is repeatedly called in the codegen visitor
@@ -111,7 +111,7 @@
the RiscV program to a file.
"""
-
"""
+
"""
The :py:attr:`fdata` member variable contains some meta-information
on the program, for instance to allocate a new temporary.
See :py:class:`Lib.FunctionData.FunctionData`.
@@ -125,7 +125,7 @@
self.fdata = FunctionData(name)
[docs] def add_instruction(self, i: CodeStatement) -> None:
-
"""
+
"""
Utility function to add an instruction in the program.
See also :py:mod:`Lib.RiscV` to generate relevant instructions.
@@ -133,7 +133,7 @@
self._listIns.append(i)
[docs] def iter_statements(self, f) -> None:
-
"""Iterate over instructions.
+
"""Iterate over instructions.
For each real instruction i (not label or comment), replace it
with the list of instructions given by f(i).
"""
@@ -144,20 +144,20 @@
self._listIns = new_list_ins
[docs] def get_instructions(self) -> List[CodeStatement]:
-
"""Return the list of instructions of the program."""
+
"""Return the list of instructions of the program."""
return self._listIns
# each instruction has its own "add in list" version
[docs] def add_label(self, s: Label) -> None:
-
"""Add a label in the program."""
+
"""Add a label in the program."""
return self.add_instruction(s)
[docs] def add_instruction_PRINTLN_INT(self, reg: DataLocation) -> None:
-
"""Print integer value, with newline. (see Expand)"""
+
"""Print integer value, with newline. (see Expand)"""
# A print instruction generates the temp it prints.
self.add_instruction(mv(A0, reg))
self.add_instruction(call(Function('println_int')))
@@ -166,12 +166,12 @@
return '\n'.join(map(str, self._listIns))
[docs] def print_code(self, output, comment=None) -> None:
-
"""Outputs the RiscV program as text to a file at the given path."""
+
"""Outputs the RiscV program as text to a file at the given path."""
_print_code(self._listIns, self.fdata, output, init_label=None,
fin_label=None, fin_div0=True, comment=comment)
[docs] def print_dot(self, filename: str, DF=None, view=False) -> None: # pragma: no cover
-
"""Outputs the RiscV program as graph to a file at the given path."""
+
"""Outputs the RiscV program as graph to a file at the given path."""
# import graphviz here so that students who don't have it can still work on lab4
from graphviz import Digraph
graph = Digraph()
diff --git a/docs/html/_modules/Lib/Operands.html b/docs/html/_modules/Lib/Operands.html
index e2aead9..16ce5a7 100644
--- a/docs/html/_modules/Lib/Operands.html
+++ b/docs/html/_modules/Lib/Operands.html
@@ -118,7 +118,7 @@
[docs]class Condition(Operand):
-
"""Condition, i.e. comparison operand for a CondJump.
+
"""Condition, i.e. comparison operand for a CondJump.
Example usage :
@@ -144,7 +144,7 @@
raise MiniCInternalError(f"Unsupported comparison operator {optype}")
[docs] def negate(self) -> 'Condition':
-
"""Return the opposite condition."""
+
"""Return the opposite condition."""
return Condition(opnot_dict[self._op])
def __str__(self):
@@ -152,7 +152,7 @@
[docs]class Function(Operand):
-
"""Operand for build-in function call."""
+
"""Operand for build-in function call."""
_name: str
@@ -164,7 +164,7 @@
[docs]class DataLocation(Operand):
-
""" A Data Location is either a register, a temporary
+
""" A Data Location is either a register, a temporary
or a place in memory (offset).
"""
@@ -181,7 +181,7 @@
[docs]class Register(DataLocation):
-
""" A (physical) register."""
+
""" A (physical) register."""
_number: int
@@ -234,7 +234,7 @@
[docs]class Offset(DataLocation):
-
""" Offset = address in memory computed with base + offset."""
+
""" Offset = address in memory computed with base + offset."""
_basereg: Register
_offset: int
@@ -247,12 +247,12 @@
return ("{}({})".format(self._offset, self._basereg))
[docs] def get_offset(self) -> int:
-
"""Return the value of the offset."""
+
"""Return the value of the offset."""
return self._offset