Exemplo n.º 1
0
 def fresh_stmt_id(self, prefix):
     """Return an statement name that is guaranteed not to be in use and
     not to be generated in the future."""
     from pytools import generate_unique_names
     for possible_id in generate_unique_names(prefix):
         if possible_id not in self.id_set and possible_id not in \
                 self.generated_id_set:
             self.generated_id_set.add(possible_id)
             return possible_id
Exemplo n.º 2
0
    def make_unique_instruction_id(self, insns=None, based_on="insn",
            extra_used_ids=set()):
        if insns is None:
            insns = self.instructions

        used_ids = set(insn.id for insn in insns) | extra_used_ids

        for id_str in generate_unique_names(based_on):
            if id_str not in used_ids:
                return intern(id_str)
Exemplo n.º 3
0
    def make_unique_instruction_id(self, insns=None, based_on="insn",
            extra_used_ids=set()):
        if insns is None:
            insns = self.instructions

        used_ids = set(insn.id for insn in insns) | extra_used_ids

        for id_str in generate_unique_names(based_on):
            if id_str not in used_ids:
                return intern(id_str)
Exemplo n.º 4
0
 def _var_name_generator(self, prefix):
     from pytools import generate_unique_names
     return generate_unique_names(prefix)