def __addVarToRoutine__(self, Routine, CrossReference): globalVar = CrossReference.getGlobalByName(self._varName) if not globalVar: # this is to fix a problem with the name convention of a top level global # like ICD9 can be referred as eith ICD9 or ICD9( altName = getAlternateGlobalName(self._varName) globalVar = CrossReference.getGlobalByName(altName) if globalVar: logger.debug("Changing global name from %s to %s" % (self._varName, altName)) self._varName = altName Routine.addGlobalVariables(GlobalVariable(self._varName, self._varPrefix, self._varValue))
def __postParsing__(self, Routine, CrossReference): globalVar = CrossReference.getGlobalByName(self._varName) if not globalVar: globalVar = CrossReference.addNonFileManGlobalByName(self._varName) routineName = Routine.getName() # case to handle the platform dependent routines if CrossReference.isPlatformDependentRoutineByName(routineName): genericRoutine = CrossReference.getGenericPlatformDepRoutineByName(routineName) assert genericRoutine globalVar.addReferencedRoutine(genericRoutine) genericRoutine.addReferredGlobal(globalVar) else: globalVar.addReferencedRoutine(Routine) Routine.addReferredGlobal(globalVar)