comparison python/ide.py @ 279:2ccd57b1d78c

Fix register allocator to do burn2 OK
author Windel Bouwman
date Sat, 12 Oct 2013 09:56:23 +0200
parents 046017431c6a
children 4496cae24d7f
comparison
equal deleted inserted replaced
278:9fca39eebe50 279:2ccd57b1d78c
280 280
281 # Set errors: 281 # Set errors:
282 self.builderrors.setErrorList(self.diag.diags) 282 self.builderrors.setErrorList(self.diag.diags)
283 ce.setErrors(self.diag.diags) 283 ce.setErrors(self.diag.diags)
284 self.astViewer.setAst(pkg) 284 self.astViewer.setAst(pkg)
285 c3.AstPrinter().printAst(pkg)
285 self.logger.info('Done!') 286 self.logger.info('Done!')
286 287
287 def buildFile(self): 288 def buildFile(self):
288 ce = self.activeMdiChild() 289 ce = self.activeMdiChild()
289 if not ce: 290 if not ce:
290 return 291 return
292 fn = ce.FileName
293 wd = os.path.dirname(fn)
291 self.diag.clear() 294 self.diag.clear()
292 outs = outstream.TextOutputStream() 295 outs = outstream.TextOutputStream()
293 if not zcc.zcc(ce.Source, outs, self.diag): 296 if not zcc.zcc(ce.Source, outs, self.diag, pack_dir=wd):
294 # Set errors: 297 # Set errors:
295 self.builderrors.setErrorList(self.diag.diags) 298 self.builderrors.setErrorList(self.diag.diags)
296 ce.setErrors(self.diag.diags) 299 ce.setErrors(self.diag.diags)
297 return 300 return
298 301
299 def buildFileAndFlash(self): 302 def buildFileAndFlash(self):
300 ce = self.activeMdiChild() 303 ce = self.activeMdiChild()
301 if not ce: 304 if not ce:
302 return 305 return
306 fn = ce.FileName
307 wd = os.path.dirname(fn)
303 self.diag.clear() 308 self.diag.clear()
304 outs = outstream.TextOutputStream() 309 outs = outstream.TextOutputStream()
305 if not zcc.zcc(ce.Source, outs, self.diag, do_optimize=True): 310 if not zcc.zcc(ce.Source, outs, self.diag, do_optimize=True, pack_dir=wd):
306 # Set errors: 311 # Set errors:
307 self.builderrors.setErrorList(self.diag.diags) 312 self.builderrors.setErrorList(self.diag.diags)
308 ce.setErrors(self.diag.diags) 313 ce.setErrors(self.diag.diags)
309 return 314 return
310 315
316 outs.dump()
311 code_s = outs.getSection('code') 317 code_s = outs.getSection('code')
312 self.debugInfo = code_s.debugInfos() 318 self.debugInfo = code_s.debugInfos()
313 if self.ctrlToolbar.device: 319 if self.ctrlToolbar.device:
314 logging.info('Flashing stm32f4 discovery') 320 logging.info('Flashing stm32f4 discovery')
315 bts = code_s.to_bytes() 321 bts = code_s.to_bytes()