Skip to content

Commit

Permalink
Temporary fix. Cut out incremental build
Browse files Browse the repository at this point in the history
  • Loading branch information
VonTum committed May 7, 2024
1 parent 6fa826a commit ed028e5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/arena_alloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ impl<T, IndexMarker : UUIDMarker> ArenaAllocator<T, IndexMarker> {
self.free_slots.push(uuid);
std::mem::replace(&mut self.data[uuid], None).unwrap()
}
pub fn clear(&mut self) {
self.data.clear();
self.free_slots.clear();
}
pub fn iter<'a>(&'a self) -> ArenaIterator<'a, T, IndexMarker> {
self.into_iter()
}
Expand Down Expand Up @@ -411,6 +415,9 @@ impl<T, IndexMarker : UUIDMarker> FlatAlloc<T, IndexMarker> {
pub fn is_empty(&self) -> bool {
self.data.is_empty()
}
pub fn clear(&mut self) {
self.data.clear();
}
pub fn iter<'a>(&'a self) -> FlatAllocIter<'a, T, IndexMarker> {
self.into_iter()
}
Expand Down
17 changes: 15 additions & 2 deletions src/compiler_top.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,21 @@ pub fn update_file(text : String, file_id : FileUUID, linker : &mut Linker) {
file_data.file_text = FileText::new(text);
file_data.tree = tree;

let mut builder = linker.get_file_builder(file_id);
gather_initial_file_data(&mut builder);
// TEMPORARY Fix crash for incremental builds
//let mut builder = linker.get_file_builder(file_id);
//gather_initial_file_data(&mut builder);

linker.modules.clear();
let mut ids = Vec::new();
for (id, f) in &mut linker.files {
f.associated_values.clear();
ids.push(id);
}

for id in ids {
let mut builder = linker.get_file_builder(id);
gather_initial_file_data(&mut builder);
}
}

pub fn recompile_all(linker : &mut Linker) {
Expand Down

0 comments on commit ed028e5

Please sign in to comment.