Skip to content

Commit b0e493a

Browse files
committed
wip: fix debug filter
1 parent c348132 commit b0e493a

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

compiler/plc_driver/src/pipelines/participant.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,14 +312,14 @@ impl VTableIndexer {
312312
members,
313313
source: plc::typesystem::StructSource::Internal(plc::typesystem::InternalType::VTable),
314314
};
315-
let datatype = DataType {
315+
316+
DataType {
316317
information,
317318
name: Self::get_vtable_name(name),
318319
nature: ast::ast::TypeNature::Derived,
319320
initial_value: None,
320321
location: SourceLocation::internal(),
321-
};
322-
datatype
322+
}
323323
}
324324
}
325325

src/codegen/generators/data_type_generator.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ pub fn generate_data_types<'ink>(
7575
}
7676
}
7777

78-
if let Some(datatype) = dbg!(dep.get_vtable(index)) {
78+
if let Some(datatype) = dep.get_vtable(index) {
7979
if !datatype.get_type_information().is_generic(index) {
8080
types.push((datatype.get_name(), datatype))
8181
}
@@ -201,6 +201,7 @@ impl<'ink> DataTypeGenerator<'ink, '_> {
201201
.map(BasicTypeEnum::into_struct_type)?;
202202

203203
struct_type.set_body(members.as_slice(), false);
204+
dbg!(&struct_type);
204205
}
205206
Ok(())
206207
}
@@ -317,6 +318,7 @@ impl<'ink> DataTypeGenerator<'ink, '_> {
317318
}?
318319
.into_struct_type();
319320

321+
eprintln!("Init for : {}", data_type.get_name());
320322
Ok(Some(struct_type.const_named_struct(&member_values).as_basic_value_enum()))
321323
}
322324
DataTypeInformation::Array { .. } => self.generate_array_initializer(

src/typesystem.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -273,12 +273,10 @@ impl DataType {
273273
}
274274

275275
pub(crate) fn is_backed_by_struct(&self) -> bool {
276-
if let DataTypeInformation::Struct { source: StructSource::Pou(pou_type), .. } =
277-
self.get_type_information()
278-
{
279-
pou_type.is_stateful()
280-
} else {
281-
true
276+
match self.get_type_information() {
277+
DataTypeInformation::Struct { source: StructSource::Internal(InternalType::VTable), .. } => false,
278+
DataTypeInformation::Struct { source: StructSource::Pou(pou_type), .. } => pou_type.is_stateful(),
279+
_ => true,
282280
}
283281
}
284282
}

0 commit comments

Comments
 (0)