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

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

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

Name: VMMaker.oscog-eem.2898
Author: eem
Time: 25 November 2020, 11:35:52.726014 am
UUID: 3d8515f6-7807-4eca-9e5d-9b8f30bca350
Ancestors: VMMaker.oscog-eem.2897

Slang:
Don't use forceNewFileNamed:.  It is destructive in complex source configurations such as the one used in Terf where we overlay a repository over the opensmalltalk-vm one.

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

Item was changed:
  ----- Method: CCodeGenerator>>storeCodeOnFile:doInlining:doAssertions: (in category 'public') -----
  storeCodeOnFile: fileName doInlining: inlineFlag doAssertions: assertionFlag
+ "Store C code for this code base on the given file.
+ Try and reuse the file if it already exists."
- "Store C code for this code base on the given file."
 
  | stream |
+ stream := VMMaker fileNamed: fileName.
- stream := VMMaker forceNewFileNamed: fileName.
  stream ifNil: [Error signal: 'Could not open C code file: ', fileName].
+ stream truncate.
  self emitCCodeOn: stream doInlining: inlineFlag doAssertions: assertionFlag.
  stream close!

Item was added:
+ ----- Method: VMMaker class>>fileNamed: (in category 'file utilities') -----
+ fileNamed: aFilename
+ "Always output files in unix lf format.
+ A single format is friendlier to e.g. external version control systems.
+ The Microsoft and old MacOS classic C compilers all accept lf format files."
+
+ ^(MultiByteFileStream fileNamed: aFilename)
+ lineEndConvention: #lf;
+ yourself!