1.1 --- a/micropython/__init__.py Tue Nov 01 01:16:09 2011 +0100
1.2 +++ b/micropython/__init__.py Thu Nov 17 01:49:57 2011 +0100
1.3 @@ -40,6 +40,7 @@
1.4 from micropython.common import *
1.5 from micropython.data import *
1.6 import micropython.ast
1.7 +import micropython.native
1.8 import micropython.opt
1.9 import micropython.inspect
1.10 import micropython.table
1.11 @@ -68,6 +69,7 @@
1.12
1.13 self.importer = importer
1.14 self.optimisations = optimisations or set()
1.15 + self.native = micropython.native.NativeLibrary(self)
1.16
1.17 # Remember the tables once generated.
1.18
1.19 @@ -122,6 +124,8 @@
1.20 for const in self.importer.constants():
1.21 self.code.append(const)
1.22
1.23 + # Generate each module.
1.24 +
1.25 last_module = self.importer.modules_ordered[-1]
1.26
1.27 for module in self.importer.modules_ordered:
1.28 @@ -203,6 +207,10 @@
1.29 code = trans.get_module_code()
1.30 self.code += code
1.31
1.32 + # Generate the native library once we know how much of it is used.
1.33 +
1.34 + self.code += self.native.get_native_code()
1.35 +
1.36 return self.code
1.37
1.38 def get_raw_image(self, architecture=None, with_builtins=0):