view python/ppci/core/function.py @ 110:9e552d34bd60

Work on compiler
author Windel Bouwman
date Fri, 04 Jan 2013 15:25:58 +0100
parents f2d980eef509
children
line wrap: on
line source


class Argument:
   def __init__(self, argtype, name, function):
      self.t = argtype
      self.name = name
      self.function = function

class Function(GlobalValue):
   def __init__(self, functiontype, name, module):
      super().__init__()
      self.functiontype = functiontype
      self.name = name
      self.module = module

      self.module.Functions.append(self)
      self.basicblocks = []
      self.arguments = []
      # Construct formal arguments depending on function type

   BasicBlocks = property(lambda self: self.basicblocks)
   Arguments = property(lambda self: self.arguments)
   ReturnType = property(lambda self: self.functiontype.returnType)
   FunctionType = property(lambda self: self.functiontype)