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

commits at source.squeak.org commits at source.squeak.org
Thu Aug 7 15:13:25 UTC 2014

Eliot Miranda uploaded a new version of VMMaker to project VM Maker:

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

Name: VMMaker.oscog-eem.848
Author: eem
Time: 7 August 2014, 8:10:54.557 am
UUID: 2aa6755a-a96a-4834-bc08-5c0a831c4648
Ancestors: VMMaker.oscog-eem.847

if at first you don't succeed...
try to get the criterion for header regeneration right again...

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

Item was changed:
  ----- Method: CCodeGenerator>>needToGenerateHeader:file:contents: (in category 'C code generator') -----
  needToGenerateHeader: headerName file: interpHdrPath contents: newContentsArg
  	"Check if we need to regenerate a header file.  We always need to if the contents have changed.
  	 But if not we can avoid needless recompilations by not regenerating.  So only regenerate if the
+ 	 package stamp is dirty and the monticello stamp is clean."
+ 	| newContents oldContents dirtyStamp |
- 	 package is clean (version doesn't include a '*').  If we can't find a package version ask the user."
- 	| newContents oldContents makerStamp vmMakerIndex |
  	(FileDirectory default fileExists: interpHdrPath) ifFalse:
  	newContents := newContentsArg.
  	oldContents := (FileDirectory default oldFileNamed: interpHdrPath) contentsOfEntireFile.
  	oldContents := oldContents copyReplaceAll: {Character cr. Character lf} with: {Character cr}.
  	oldContents replaceAll: Character lf with: Character cr.
+ 	dirtyStamp := (oldContents indexOfSubCollection: '* VMMaker') ~= 0.
- 	makerStamp := (vmMakerIndex := oldContents indexOfSubCollection: 'VMMaker') ~= 0
- 						ifTrue:
- 							[oldContents
- 								copyFrom: vmMakerIndex
- 								to: (oldContents indexOf: Character cr startingAt: vmMakerIndex) - 1]
- 						ifFalse: ['XXX'].
  	(newContents beginsWith: '/*') = (oldContents beginsWith: '/*') ifFalse:
  		[(newContents beginsWith: '/*') ifTrue:
  			[newContents := newContents readStream upToAll: '*/'; skipSeparators; upToEnd].
  		 (oldContents beginsWith: '/*') ifTrue:
  			[oldContents := oldContents readStream upToAll: '*/'; skipSeparators; upToEnd]].
  	^oldContents ~= newContents
+ 	 or: [(dirtyStamp and: [[((self class monticelloDescriptionFor: vmClass) includes: $*) not]
+ 							on: Error do: [:ex| false]]) "If no stamp don't worry"
- 	 or: [([((self class monticelloDescriptionFor: vmClass) includes: $*) not
- 		 and: [((self class monticelloDescriptionFor: vmClass) includesSubString: makerStamp) not]]
- 			on: Error
- 			do: [:ex| true])
  	 or: [self confirm: headerName, ' contents are unchanged.\Writing the file may cause recompilation of support files.\Do you want to write the header file?' withCRs]]!

More information about the Vm-dev mailing list