stage2: tokenizer: require null terminated source
By requiring the source file to be null-terminated, we avoid extra branching while simplifying the logic at the same time. Running ast-check on a large zig source file (udivmodti4_test.zig), master branch compared to this commit: * 4% faster wall clock * 7% fewer cache misses * 1% fewer branches
This commit is contained in:
@@ -1541,7 +1541,7 @@ pub fn create(gpa: *Allocator, options: InitOptions) !*Compilation {
|
||||
}
|
||||
}
|
||||
|
||||
if (comp.bin_file.options.use_stage1) {
|
||||
if (comp.bin_file.options.use_stage1 and comp.bin_file.options.module != null) {
|
||||
try comp.work_queue.writeItem(.{ .stage1_module = {} });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user