You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: compiler/section_mangler/src/lib.rs
+10-2Lines changed: 10 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -49,17 +49,20 @@ mod parser;
49
49
/// The main builder type of this crate. Use it to create mangling contexts, in
50
50
/// order to encode and decode binary type information.
51
51
// TODO: Add example code for using this builder
52
+
#[derive(Debug,PartialEq)]
52
53
pubenumSectionMangler{
53
54
Function(FunctionMangler),
54
55
Variable(VariableMangler),
55
56
}
56
57
58
+
#[derive(Debug,PartialEq)]
57
59
pubstructFunctionMangler{
58
60
name:String,
59
61
parameters:Vec<FunctionArgument>,
60
62
return_type:Option<Type>,
61
63
}
62
64
65
+
#[derive(Debug,PartialEq)]
63
66
pubstructVariableMangler{
64
67
name:String,
65
68
ty:Type,
@@ -113,6 +116,7 @@ impl SectionMangler {
113
116
// NOTE: This is called `variable_linkage` in the `MemberInfo` struct.
114
117
115
118
/// We have to encode this because if it changes, the function needs to be reloaded - this is an ABI breakage
119
+
#[derive(Debug,PartialEq)]
116
120
pubenumFunctionArgument{
117
121
ByValue(Type),
118
122
ByRef(Type),
@@ -129,6 +133,7 @@ impl fmt::Display for FunctionArgument {
129
133
}
130
134
131
135
// TODO: Do we have to encode this? Does that affect ABI? Probably
136
+
#[derive(Debug,PartialEq)]
132
137
pubenumStringEncoding{
133
138
// TODO: Should we encode this differently? this could cause problems compared to encoding unsigned types
134
139
/// Encoded as `8u`
@@ -148,6 +153,7 @@ impl fmt::Display for StringEncoding {
148
153
149
154
// This maps directly to the [`DataTypeInformation`] enum in RuSTy - we simply remove some fields and add the ability to encode/decode serialize/deserialize
150
155
// TODO: Do we have to handle Generic?
156
+
#[derive(Debug,PartialEq)]
151
157
pubenumType{
152
158
/// Encoded as `v`
153
159
Void,
@@ -237,16 +243,18 @@ impl fmt::Display for Type {
0 commit comments