VM Maker: VMMaker.oscog-eem.2170.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

VM Maker: VMMaker.oscog-eem.2170.mcz

commits-2
 
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.2170.mcz

==================== Summary ====================

Name: VMMaker.oscog-eem.2170
Author: eem
Time: 20 March 2017, 9:48:01.637419 am
UUID: 452a2719-74af-4669-b228-3ad41ad1342d
Ancestors: VMMaker.oscog-eem.2169

Cogit:
And don't get hung up if no #ABI is defined.

=============== Diff against VMMaker.oscog-eem.2169 ===============

Item was changed:
  ----- Method: Cogit class>>generateCodeStringForCogitDotC (in category 'translation') -----
  generateCodeStringForCogitDotC
  "Generate a skeletal cogit.c that includes the relevant cogitFOO.c
  for the appropriate subclasses of CogAbstractInstruction."
 
  ^String streamContents:
  [:s|
  s nextPutAll: '/* Automatically generated by\ ' withCRs.
  s nextPutAll: (CCodeGenerator monticelloDescriptionFor: self).
  s cr; nextPutAll: ' */'.
  s cr; cr; nextPut: $#.
  self translateableInstructionSubclassesAndInstalledOptionsDo:
  [:class | | abi |
  s nextPutAll: 'if '.
+ (abi := initializationOptions at: #ABI ifAbsent: []) ifNotNil:
- (abi := initializationOptions at: #ABI) ifNotNil:
  [s nextPutAll: 'defined('; nextPutAll: abi; nextPutAll: ') && ('].
  class identifyingPredefinedMacros
  do: [:predefinedMacro| s nextPutAll: 'defined('; nextPutAll: predefinedMacro; nextPut: $)]
  separatedBy: [s nextPutAll: ' || '].
  abi ifNotNil: [s nextPut: $)].
  s cr; cr; nextPutAll: '# include "'; nextPutAll: class moduleName; nextPutAll: '.c"'.
  s cr; cr; nextPutAll: '#el'].
  s nextPutAll: 'se'.
  #( 'As yet no Cogit implementation appears to exist for your platform.'
  'Consider implementing it, starting by adding a subclass of CogAbstractInstruction.') do:
  [:msg| s cr; nextPutAll: '# error '; nextPutAll: msg].
  s cr; nextPutAll: '#endif'; cr]!