Skip to content

Commit

Permalink
Remove prints
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcere committed Nov 11, 2024
1 parent a5f9c15 commit 3fc3ccc
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 20 deletions.
6 changes: 3 additions & 3 deletions src/greedy/greedy.py
Original file line number Diff line number Diff line change
Expand Up @@ -1714,9 +1714,9 @@ def greedy_from_json(json_data: Dict[str, Any], verb=False) -> Tuple[
# print(name, encoding._b0, encoding._b0)
error = 0
except Exception:
print(json_data)
_, _, tb = sys.exc_info()
traceback.print_tb(tb)
# print(json_data)
# _, _, tb = sys.exc_info()
# traceback.print_tb(tb)
# print("Error")
res = None
resids = None
Expand Down
5 changes: 1 addition & 4 deletions src/liveness/layout_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,8 @@ def compute_variable_depth(liveness_info: Dict[str, LivenessAnalysisInfo], topol

current_variable_depth_in = current_variable_depth_out.copy()

if block_info.block_id == "fun_supportsInterface_985_Block2":
print("HOLA")

# Finally, we update the corresponding variables that are defined in the blocks
for used_variable in set(block_info.defs).union(block_info.phi_defs):
for used_variable in set(block_info.uses).union(block_info.phi_uses):
current_variable_depth_out[used_variable] = 0

variable_depth_out[node] = current_variable_depth_out
Expand Down
9 changes: 1 addition & 8 deletions src/liveness/liveness_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,19 +81,12 @@ def propagate_information(self) -> None:
self.in_state.live_vars = self.block_info.upward_exposed.union(
self.out_state.live_vars.difference(self.block_info.defs.union(self.block_info.phi_defs)))

def propagate_state(self, current_state: LivenessState) -> None:
if self.block_info.block_id == "extract_byte_array_length_Block1_copy_0":
print(self.out_state.live_vars)

# Live out variables: the live in variables + those selected from the phi functions
def propagate_state(self, current_state: LivenessState) -> None: # Live out variables: the live in variables + those selected from the phi functions
self.out_state.live_vars = set().union(self.out_state.live_vars,
self.block_info.phi_uses,
current_state.live_vars)

def dot_repr(self) -> str:
if self.block_info.block_id == "extract_byte_array_length_Block1_copy_0":
print(self.out_state.live_vars)

instr_repr = '\n'.join([instr.dot_repr() for instr in self.block_info._instructions])

combined_repr = instr_repr if instr_repr != "" else "[]"
Expand Down
2 changes: 0 additions & 2 deletions src/liveness/liveness_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,6 @@ def _block_id_to_phi_uses(block_id: block_id_T, successor_instructions: List[CFG
"""
# First we retrieve the arguments for every phi function
i = 0
if block_id == "extract_byte_array_length_Block1_copy_0":
print("HOLA")

corresponding_arg = successor_entry_list.index(block_id)
phi_uses, phi_defs = set(), set()
Expand Down
6 changes: 3 additions & 3 deletions src/parser/utils_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,15 +204,15 @@ def are_dependent_accesses(exp1: expression_T, exp2: expression_T) -> bool:
val1 = exp1[0]
val2 = exp2[0]

print(exp1)
print(exp2)
# print(exp1)
# print(exp2)

if val1 == "inf" or val2 == "inf":
return True
elif isinstance(val1, int) and isinstance(val2, int): # constants
return val1 == val2
elif isinstance(val1, str) and isinstance(val2, str): # variables
print("Check with ssa")
# print("Check with ssa")
return True # val1 == val2
elif isinstance(val1, str) and isinstance(val2, tuple): # One expression is contained in the other
return not is_member_recursive(val1, val2)
Expand Down

0 comments on commit 3fc3ccc

Please sign in to comment.