def obsolete_dependent_units(self, unit, antideps): """Obsolete units that depends of :param unit:""" udeps = antideps.get(unit, None) if udeps is None: # There are no units. return # Avoid infinite recursion antideps[unit] = None for un in udeps: log.debug("obsolete %d %s", un, pyutils.name_image(nodes.Get_Identifier(un))) # Recurse self.obsolete_dependent_units(un, antideps) if nodes.Set_Date_State(un) == nodes.Date_State.Disk: # Already obsolete! continue # FIXME: just de-analyze ? nodes.Set_Date_State(un, nodes.Date_State.Disk) sem_lib.Free_Dependence_List(un) loc = nodes.Get_Location(un) fil = files_map.Location_To_File(loc) pos = files_map.Location_File_To_Pos(loc, fil) line = files_map.Location_File_To_Line(loc, fil) col = files_map.Location_File_Line_To_Offset(loc, fil, line) nodes.Set_Design_Unit_Source_Pos(un, pos) nodes.Set_Design_Unit_Source_Line(un, line) nodes.Set_Design_Unit_Source_Col(un, col)
def compute_diags(self): log.debug("parse doc %d %s", self._fe, self.uri) self.parse_document() if self._tree == nodes.Null_Iir: # No units, nothing to add. return # Semantic analysis. unit = nodes.Get_First_Design_Unit(self._tree) while unit != nodes.Null_Iir: sem.Semantic(unit) nodes.Set_Date_State(unit, nodes.Date_State.Analyze) unit = nodes.Get_Chain(unit)