Skip to content

Commit

Permalink
Showing 3 changed files with 20 additions and 1 deletion.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## 0.17.3 (2016-05-20)

* Fixed: multiple macro runs executions didn't work well (#2624)
* Fixed incorrect formatting of underscore in unpacked block arguments
* Fixed wrong codegen for global variable assignment in type declaration (#2619)
* Fixed initialize default arguments where evaluated at the class scope (#731)
* The type guesser can now infer a block type from `def initialize(&@block)`
* Allow type restriction in double splat argument (similar to restriction in single splat)
* Allow splat restriction in splat argument (useful for `Tuple.new`)
* Allow double splat restriction in double splat argument (useful for `NamedTuple.new`)

## 0.17.2 (2016-05-18)

* Fixed crash when using pointerof of constant
4 changes: 3 additions & 1 deletion src/compiler/crystal/compiler.cr
Original file line number Diff line number Diff line change
@@ -38,6 +38,7 @@ module Crystal
property? wants_doc : Bool
property emit : Array(String)?
property original_output_filename : String?
property? cleanup : Bool?

@target_machine : LLVM::TargetMachine?
@pass_manager_builder : LLVM::PassManagerBuilder?
@@ -56,6 +57,7 @@ module Crystal
@verbose = false
@wants_doc = false
@flags = [] of String
@cleanup = true
end

def compile(source : Source, output_filename)
@@ -180,7 +182,7 @@ module Crystal
codegen program, units, lib_flags, output_filename, output_dir
end

cache_dir.cleanup
cache_dir.cleanup if @cleanup
end

private def cross_compile(program, units, lib_flags, output_filename)
6 changes: 6 additions & 0 deletions src/compiler/crystal/macros/macros.cr
Original file line number Diff line number Diff line change
@@ -85,6 +85,12 @@ module Crystal
# the subsequent times will make program execution faster.
compiler.release = true

# Don't cleanup old directories after compiling: it might happen
# that in doing so we remove the directory associated with the current
# compilation (for example if we have more than 10 macro runs, the current
# directory will be the oldest).
compiler.cleanup = false

safe_filename = filename.gsub(/[^a-zA-Z\_\-\.]/, "_")

tempfile_path = @mod.new_tempfile("macro-run-#{safe_filename}")

0 comments on commit 995032f

Please sign in to comment.