Skip to content

Commit

Permalink
Merge pull request #830 from Panhaolin2001/development
Browse files Browse the repository at this point in the history
[Inst2vec] add string_of_items to fix inst2vec_preprocess.py
  • Loading branch information
ChrisCummins authored Jun 11, 2024
2 parents 9e0c0be + ead8811 commit 366ff95
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions compiler_gym/third_party/inst2vec/inst2vec_preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,21 @@
from compiler_gym.third_party.inst2vec import rgx_utils as rgx


########################################################################################################################
# Helper functions: list and stmt handling
########################################################################################################################
def string_of_items(dic):
"""
Return a string containing all keys of a dictionary, separated by a comma
(Helper function for structure inlining)
:param dic: dictionary [key=string: value=string]
:return: string constructed of the dictionaries' keys
"""
s = ''
for k, v in dic.items():
s += k + ': ' + v + '\n'
return s

########################################################################################################################
# LLVM IR preprocessing
########################################################################################################################
Expand Down

0 comments on commit 366ff95

Please sign in to comment.