VM Maker: VMMaker.oscog-eem.2174.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.2174.mcz

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

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

Name: VMMaker.oscog-eem.2174
Author: eem
Time: 20 March 2017, 11:41:55.433626 am
UUID: eefef0d3-2df8-4fe7-9f71-2aca68641ba6
Ancestors: VMMaker.oscog-eem.2173

Have the 64-bit cogit.c file default to SysV to avoid having to hack the unix "make system".

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

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.
+ self generateCodeStringForCogitDotC"
- for the appropriate subclasses of CogAbstractInstruction."
 
+ | string insertPosition abis defaultDef |
+ abis := OrderedCollection new.
+ string := String streamContents:
- ^String streamContents:
  [:s|
  s nextPutAll: '/* Automatically generated by\ ' withCRs.
  s nextPutAll: (CCodeGenerator monticelloDescriptionFor: self).
  s cr; nextPutAll: ' */'.
  s cr; cr; nextPut: $#.
+ insertPosition := s position.
  self translateableInstructionSubclassesAndInstalledOptionsDo:
  [:class | | abi |
  s nextPutAll: 'if '.
  (abi := initializationOptions at: #ABI ifAbsent: []) ifNotNil:
+ [s nextPutAll: (abis addLast: abi, 'ABI'); nextPutAll: ' && ('].
- [s nextPutAll: abi; nextPutAll: 'ABI && ('].
  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].
+ abis isEmpty ifTrue:
+ [^string].
+ defaultDef := String streamContents:
+ [:s|
+ s nextPutAll: '#if !!'.
+ abis do: [:abi| s nextPutAll: abi] separatedBy: [s nextPutAll: ' && !!'].
+ s cr; nextPutAll: '# define '; nextPutAll: abis first; nextPutAll: ' 1'; cr.
+ s nextPutAll: '#endif'; cr; cr].
+ ^string copyReplaceFrom: insertPosition to: insertPosition - 1 with: defaultDef!
- s cr; nextPutAll: '#endif'; cr]!