annotate python/ir/context.py @ 158:9683a4cd848f

Added some functions for code generation
author Windel Bouwman
date Fri, 08 Mar 2013 16:52:44 +0100
parents 4e79484a9d47
children
rev   line source
104
ed230e947dc6 Added hexviewer
windel
parents: 95
diff changeset
1 from .llvmtype import IntegerType, llvmType, typeID, FunctionType
70
35286e8abd03 Added some llvm classes
windel
parents:
diff changeset
2
35286e8abd03 Added some llvm classes
windel
parents:
diff changeset
3 class Context:
104
ed230e947dc6 Added hexviewer
windel
parents: 95
diff changeset
4 """ Global context """
ed230e947dc6 Added hexviewer
windel
parents: 95
diff changeset
5 def __init__(self):
110
9e552d34bd60 Work on compiler
Windel Bouwman
parents: 104
diff changeset
6 self.Int8Type = IntegerType(8)
9e552d34bd60 Work on compiler
Windel Bouwman
parents: 104
diff changeset
7 self.Int16Type = IntegerType(16)
9e552d34bd60 Work on compiler
Windel Bouwman
parents: 104
diff changeset
8 self.Int32Type = IntegerType(32)
9e552d34bd60 Work on compiler
Windel Bouwman
parents: 104
diff changeset
9 self.Int64Type = IntegerType(64)
9e552d34bd60 Work on compiler
Windel Bouwman
parents: 104
diff changeset
10 self.VoidType = llvmType(typeID.Void)
9e552d34bd60 Work on compiler
Windel Bouwman
parents: 104
diff changeset
11 self.DoubleType = llvmType(typeID.Double)
70
35286e8abd03 Added some llvm classes
windel
parents:
diff changeset
12