David T. Lewis uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker-oscog-dtl.125.mcz==================== Summary ====================
Name: VMMaker-oscog-dtl.125
Author: dtl
Time: 6 October 2011, 11:25:15.484 pm
UUID: a1805ec0-e992-407a-a3db-ed1899c91c5a
Ancestors: VMMaker-oscog-dtl.124
Support for FreeTypePlugin.
Arrange for emitCConstantsOn: to retain BytesPerWord as a constant even in not present in the globals, as will be the case if BytesPerWord is magically generated by the code generator rather than being defined as a global. Intended for oscog branch, not required for VMM trunk, which no longer uses BytesPerWord.
=============== Diff against VMMaker-oscog-dtl.124 ===============
Item was changed:
----- Method: CCodeGenerator>>emitCConstantsOn: (in category 'C code generator') -----
emitCConstantsOn: aStream
"Store the global variable declarations on the given stream."
| unused constList |
unused := constants keys asSet.
methods do:
[:meth|
meth parseTree nodesDo:
[:n| n isConstant ifTrue: [unused remove: n name ifAbsent: []]]].
unused copy do:
[:const|
(variableDeclarations anySatisfy: [:value| value includesSubString: const]) ifTrue:
[unused remove: const ifAbsent: []]].
"Don't generate any defines for the externally defined constants, STACKVM, COGVM, COGMTVM et al."
(VMClass class>>#initializeMiscConstantsWith:) literalsDo:
[:lit|
lit isVariableBinding ifTrue:
[unused add: lit key]].
+ unused remove: #BytesPerWord ifAbsent: []. "force inclusion of BytesPerWord declaration"
constList := constants keys reject:[:any| unused includes: any].
aStream cr; nextPutAll: '/*** Constants ***/'; cr.
(self sortStrings: constList) do:
[:varName| | node default value |
node := constants at: varName.
node name isEmpty ifFalse:
["Allow the class to provide an alternative definition, either of just the value or the whole shebang"
default := self cLiteralFor: node value name: varName.
value := vmClass
ifNotNil:
[(vmClass specialValueForConstant: node name default: default)
ifNotNil: [:specialDef| specialDef]
ifNil: [default]]
ifNil: [default].
value first ~= $# ifTrue:
[aStream nextPutAll: '#define '; nextPutAll: node name; space].
aStream nextPutAll: value; cr]].
aStream cr!