[Vm-dev] VM Maker: VMMaker.oscog-eem.181.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Jun 29 20:07:50 UTC 2012


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

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

Name: VMMaker.oscog-eem.181
Author: eem
Time: 29 June 2012, 1:05:25.822 pm
UUID: 37760187-3a5c-4411-9352-754a4782fa29
Ancestors: VMMaker.oscog-eem.180

Check for variable name clashes with C reserved words.
Comment touch:

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

Item was changed:
  ----- Method: CCodeGenerator>>checkForGlobalUsage:in: (in category 'utilities') -----
  checkForGlobalUsage: vars in: aTMethod 
  	vars do:
  		[:var |
  		(variables includes: var) ifTrue: "find the set of method names using this global var"
  			[(globalVariableUsage at: var ifAbsentPut: [Set new])
  				add: aTMethod selector]].
+ 	aTMethod referencesGlobalStructMakeZero.
+ 	(aTMethod locals select: [:l| self reservedWords includes: l]) do:
+ 		[:l| | em |
+ 		em := aTMethod definingClass name, '>>', aTMethod selector, ' has variable that is a C reserved word: ', l.
+ 		self error: em.
+ 		self logger cr; nextPutAll: em; cr; flush]!
- 	aTMethod referencesGlobalStructMakeZero!

Item was added:
+ ----- Method: CCodeGenerator>>reservedWords (in category 'C translation') -----
+ reservedWords
+ 	^#(	'auto'
+ 		'break'
+ 		'case' 'char' 'const' 'continue'
+ 		'default' 'do' 'double'
+ 		'else' 'entry' 'enum' 'extern'
+ 		'float' 'for'
+ 		'goto'
+ 		'if' 'int'
+ 		'long'
+ 		'register' 'return'
+ 		'short' 'signed' 'sizeof' 'static' 'struct' 'switch'
+ 		'typedef'
+ 		'union' 'unsigned'
+ 		'void' 'volatile'
+ 		'while')!

Item was changed:
  ----- Method: Object>>touch: (in category '*VMMaker-translation support') -----
  touch: something
+ 	"For translation only; eliminated by CCodeGenerator.  Used to squash unused varable warnings."!
- 	"For translation only; eliminated by CCodeGenerator"!



More information about the Vm-dev mailing list