Skip to content

Commit a221f1e

Browse files
committed
Provide a default empty implementation for the LLVMCallbacks trait.
1 parent 27fe50c commit a221f1e

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

lib/llvm-backend-tests/tests/compile.rs

-4
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ impl LLVMCallbacks for RecordPreOptIR {
3333
fn preopt_ir_callback(&mut self, module: &InkwellModule) {
3434
self.preopt_ir = module.print_to_string().to_string();
3535
}
36-
37-
fn postopt_ir_callback(&mut self, _: &InkwellModule) {}
38-
39-
fn obj_memory_buffer_callback(&mut self, _: &InkwellMemoryBuffer) {}
4036
}
4137

4238
#[test]

lib/llvm-backend/src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ pub type InkwellModule<'ctx> = inkwell::module::Module<'ctx>;
3737
pub type InkwellMemoryBuffer = inkwell::memory_buffer::MemoryBuffer;
3838

3939
pub trait LLVMCallbacks: std::any::Any + 'static {
40-
fn preopt_ir_callback(&mut self, module: &InkwellModule);
41-
fn postopt_ir_callback(&mut self, module: &InkwellModule);
42-
fn obj_memory_buffer_callback(&mut self, memory_buffer: &InkwellMemoryBuffer);
40+
fn preopt_ir_callback(&mut self, _module: &InkwellModule) {}
41+
fn postopt_ir_callback(&mut self, _module: &InkwellModule) {}
42+
fn obj_memory_buffer_callback(&mut self, _memory_buffer: &InkwellMemoryBuffer) {}
4343
}
4444

4545
pub struct LLVMBackendConfig {

0 commit comments

Comments
 (0)