Skip to content

Commit 500593b

Browse files
committed
Add trace! logging for the HasVtableAnalysis
1 parent d3e39dc commit 500593b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/ir/analysis/has_vtable.rs

+5
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ impl<'ctx> MonotoneFramework for HasVtableAnalysis<'ctx> {
163163
}
164164

165165
fn constrain(&mut self, id: ItemId) -> ConstrainResult {
166+
trace!("constrain {:?}", id);
166167

167168
let item = self.ctx.resolve_item(id);
168169
let ty = match item.as_type() {
@@ -176,17 +177,21 @@ impl<'ctx> MonotoneFramework for HasVtableAnalysis<'ctx> {
176177
TypeKind::Alias(t) |
177178
TypeKind::ResolvedTypeRef(t) |
178179
TypeKind::Reference(t) => {
180+
trace!(" aliases and references forward to their inner type");
179181
self.forward(t, id)
180182
}
181183

182184
TypeKind::Comp(ref info) => {
185+
trace!(" comp considers its own methods and bases");
183186
let mut result = HasVtableResult::No;
184187

185188
if info.has_own_virtual_method() {
189+
trace!(" comp has its own virtual method");
186190
result |= HasVtableResult::SelfHasVtable;
187191
}
188192

189193
let bases_has_vtable = info.base_members().iter().any(|base| {
194+
trace!(" comp has a base with a vtable: {:?}", base);
190195
self.have_vtable.contains_key(&base.ty.into())
191196
});
192197
if bases_has_vtable {

0 commit comments

Comments
 (0)