Skip to content

Commit 4cc35d2

Browse files
committed
cleanup
1 parent 56d835b commit 4cc35d2

File tree

4 files changed

+2
-21
lines changed

4 files changed

+2
-21
lines changed

compiler/plc_driver/src/pipelines.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ impl<T: SourceContainer + Sync> AnnotatedProject<T> {
300300
unit,
301301
dependencies,
302302
literals,
303-
todo!("give GOT layout for singlemodules?"),
303+
todo!("give GOT layout for single modules?"),
304304
)
305305
})
306306
.reduce(|a, b| {
@@ -390,7 +390,7 @@ impl<T: SourceContainer + Sync> AnnotatedProject<T> {
390390
let got_layout = compile_options
391391
.got_layout_file
392392
.as_ref()
393-
.map(|path| read_got_layout(&path, ConfigFormat::JSON))
393+
.map(|path| read_got_layout(path, ConfigFormat::JSON))
394394
.transpose()?;
395395

396396
let got_layout = Mutex::new(got_layout);
@@ -437,8 +437,6 @@ impl<T: SourceContainer + Sync> AnnotatedProject<T> {
437437
&got_layout,
438438
)?;
439439

440-
dbg!(module.persist_to_string());
441-
442440
module
443441
.persist(
444442
Some(&compile_directory),

src/codegen.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
use std::{
33
cell::RefCell,
44
collections::HashMap,
5-
fs,
65
ops::Deref,
76
path::{Path, PathBuf},
87
sync::Mutex,
@@ -144,8 +143,6 @@ impl<'ink> CodeGen<'ink> {
144143
acc.push(format!("{}_instance", p.get_name()));
145144
acc
146145
});
147-
let test: Vec<_> =
148-
program_globals.clone().into_iter().map(|s| crate::index::get_initializer_name(&s)).collect();
149146

150147
let functions = global_index.get_pous().values().filter_map(|p| match p {
151148
PouIndexEntry::Function { name, linkage: LinkageType::Internal, is_generated: false, .. }
@@ -169,10 +166,7 @@ impl<'ink> CodeGen<'ink> {
169166
acc
170167
});
171168

172-
// let all_names: Vec<_> = all_names.collect();
173-
174169
if let Some(got_entries) = &mut *got_layout.lock().unwrap() {
175-
// let got_entries = read_got_layout(location.as_str(), *format)?;
176170
let mut new_symbols = Vec::new();
177171
let mut new_got_entries = HashMap::new();
178172
let mut new_got = HashMap::new();
@@ -198,18 +192,13 @@ impl<'ink> CodeGen<'ink> {
198192
new_got.insert(idx, name.to_string());
199193
}
200194

201-
// FIXME: Remove - moved out of there
202-
// Now we can write new_got_entries back out to a file.
203-
// write_got_layout(new_got_entries, location.as_str(), *format)?;
204-
205195
// Construct our GOT as a new global array. We initialise this array in the loader code.
206196
let got_size: u32 = new_got
207197
.keys()
208198
.max()
209199
.map_or(0, |m| *m + 1)
210200
.try_into()
211201
.expect("the computed custom GOT size is too large");
212-
eprintln!("creating __custom_got array");
213202

214203
let ptr_ty = llvm.context.i8_type().ptr_type(AddressSpace::default());
215204
let empty_got = ptr_ty

src/codegen/generators/variable_generator.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use crate::{
66
index::{get_initializer_name, Index, PouIndexEntry, VariableIndexEntry},
77
resolver::{AnnotationMap, AstAnnotations, Dependency},
88
};
9-
use indexmap::IndexSet;
109
use inkwell::{module::Module, values::GlobalValue};
1110
use plc_ast::ast::LinkageType;
1211
use plc_diagnostics::diagnostics::Diagnostic;

src/codegen/llvm_index.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use plc_diagnostics::diagnostics::Diagnostic;
55
use plc_source::source_location::SourceLocation;
66
use plc_util::convention::qualified_name;
77
use rustc_hash::FxHashMap;
8-
use std::collections::HashMap;
98

109
/// Index view containing declared values for the current context
1110
/// Parent Index is the a fallback lookup index for values not declared locally
@@ -57,8 +56,6 @@ impl<'ink> LlvmTypedIndex<'ink> {
5756
}
5857
for (name, index) in other.got_indices.drain() {
5958
self.got_indices.insert(name, index);
60-
61-
dbg!(&self.got_indices);
6259
}
6360
for (name, assocication) in other.initial_value_associations.drain() {
6461
self.initial_value_associations.insert(name, assocication);
@@ -178,8 +175,6 @@ impl<'ink> LlvmTypedIndex<'ink> {
178175
}
179176

180177
pub fn insert_new_got_index(&mut self, variable_name: &str) -> Result<(), Diagnostic> {
181-
eprintln!("llvm_index: inserting {variable_name}");
182-
// FIXME: Does that start at 0 or 1?
183178
let idx = self.got_indices.values().max().copied().unwrap_or(0);
184179

185180
self.got_indices.insert(variable_name.to_lowercase(), idx);

0 commit comments

Comments
 (0)