Skip to content

Commit fa9c363

Browse files
committed
Fix formatting on new methods
1 parent 15073b2 commit fa9c363

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

src/debug_info.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
//!
8888
//! let gv_debug = di.create_global_variable_expression(cu.get_file().as_debug_info_scope(), "gv", "", cu.get_file(), 1, ditype.as_type(), true, Some(const_v), None, 8);
8989
//!
90-
//! let meta_value : inkwell::values::BasicMetadataValueEnum = gv_debug.as_metadata_value(&context).into();
90+
//! let meta_value: inkwell::values::BasicMetadataValueEnum = gv_debug.as_metadata_value(&context).into();
9191
//! let metadata = context.metadata_node(&[meta_value]);
9292
//! gv.set_metadata(metadata, 0);//dbg
9393
//!
@@ -639,7 +639,8 @@ impl<'ctx> DebugInfoBuilder<'ctx> {
639639
}
640640

641641
#[llvm_versions(8.0..=latest)]
642-
pub fn create_constant_expression(&self,
642+
pub fn create_constant_expression(
643+
&self,
643644
value : i64,
644645
) -> DIExpression<'ctx> {
645646
let metadata_ref = unsafe {
@@ -1108,7 +1109,7 @@ pub struct DIGlobalVariableExpression<'ctx> {
11081109
}
11091110

11101111
impl <'ctx> DIGlobalVariableExpression<'ctx> {
1111-
pub fn as_metadata_value(&self, context : &Context) -> MetadataValue<'ctx> {
1112+
pub fn as_metadata_value(&self, context: &Context) -> MetadataValue<'ctx> {
11121113
let value = unsafe {
11131114
LLVMMetadataAsValue(context.context, self.metadata_ref)
11141115
};

tests/all/test_debug_info.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,6 @@ fn test_anonymous_basic_type() {
306306
#[llvm_versions(8.0..=latest)]
307307
#[test]
308308
fn test_global_expressions() {
309-
310309
let context = Context::create();
311310
let module = context.create_module("bin");
312311

@@ -326,7 +325,7 @@ fn test_global_expressions() {
326325
false,
327326
);
328327

329-
let di_type = dibuilder.create_basic_type("type_name",0_u64, 0x00, DIFlags::ZERO);
328+
let di_type = dibuilder.create_basic_type("type_name", 0_u64, 0x00, DIFlags::ZERO);
330329
let gv = module.add_global(context.i64_type(), Some(inkwell::AddressSpace::Global), "gv");
331330

332331
let const_v = dibuilder.create_constant_expression(10);
@@ -337,15 +336,18 @@ fn test_global_expressions() {
337336
"",
338337
compile_unit.get_file(),
339338
1,
340-
di_type.unwrap().as_type() ,
339+
di_type.unwrap().as_type(),
341340
true,
342-
Some(const_v), None, 8);
341+
Some(const_v),
342+
None,
343+
8,
344+
);
343345

344346
let metadata = context.metadata_node(&[gv_debug.as_metadata_value(&context).into()]);
345347

346348
gv.set_metadata(metadata, 0);
347349

348-
//TODO : Metadata set on the global values cannot be retrieved using the C api,
350+
// TODO: Metadata set on the global values cannot be retrieved using the C api,
349351
// therefore, it's currently not possible to test that the data was set without generating the IR
350352
assert!(gv.print_to_string().to_string().contains("!dbg"), format!("expected !dbg but generated gv was {}",gv.print_to_string()));
351353
}

0 commit comments

Comments
 (0)