Skip to content

Commit eba4f31

Browse files
committed
Trace methods in CompInfo's TypeCollector impl
Fixes rust-lang#410
1 parent f83fe38 commit eba4f31

File tree

3 files changed

+58
-1
lines changed

3 files changed

+58
-1
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/* automatically generated by rust-bindgen */
2+
3+
4+
#![allow(non_snake_case)]
5+
6+
7+
pub mod root {
8+
#[allow(unused_imports)]
9+
use self::super::root;
10+
pub mod JS {
11+
#[allow(unused_imports)]
12+
use self::super::super::root;
13+
pub use root::_bindgen_ty_1 as JSWhyMagic;
14+
#[repr(C)]
15+
#[derive(Debug, Copy)]
16+
pub struct Value {
17+
pub _address: u8,
18+
}
19+
#[test]
20+
fn bindgen_test_layout_Value() {
21+
assert_eq!(::std::mem::size_of::<Value>() , 1usize);
22+
assert_eq!(::std::mem::align_of::<Value>() , 1usize);
23+
}
24+
extern "C" {
25+
#[link_name = "_ZN2JS5Value1aE10JSWhyMagic"]
26+
pub fn Value_a(this: *mut root::JS::Value,
27+
arg1: root::JS::JSWhyMagic);
28+
}
29+
impl Clone for Value {
30+
fn clone(&self) -> Self { *self }
31+
}
32+
impl Value {
33+
#[inline]
34+
pub unsafe fn a(&mut self, arg1: root::JS::JSWhyMagic) {
35+
Value_a(&mut *self, arg1)
36+
}
37+
}
38+
}
39+
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
40+
pub enum _bindgen_ty_1 { }
41+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// bindgen-flags: --enable-cxx-namespaces --whitelist-type JS::Value
2+
3+
namespace JS {
4+
class Value;
5+
}
6+
typedef enum {} JSWhyMagic;
7+
namespace JS {
8+
class Value {
9+
public:
10+
void a(JSWhyMagic);
11+
};
12+
}

src/ir/comp.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -957,6 +957,10 @@ impl TypeCollector for CompInfo {
957957
types.insert(var);
958958
}
959959

960-
// FIXME(emilio): Methods, VTable?
960+
for method in self.methods() {
961+
types.insert(method.signature);
962+
}
963+
964+
// FIXME(emilio): VTable?
961965
}
962966
}

0 commit comments

Comments
 (0)