Skip to content

Commit 25e45db

Browse files
author
bors-servo
authored
Auto merge of #117 - fitzgen:remove-unused-override-enum-ty-option, r=emilio
Remove unused override enum ty option r? @emilio
2 parents cbb940a + 364a2d4 commit 25e45db

File tree

6 files changed

+1
-45
lines changed

6 files changed

+1
-45
lines changed

bindgen_plugin/src/bgmacro.rs

-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ impl MacroArgsVisitor for BindgenArgsVisitor {
101101
Some("link_framework") => self.options.links.push((val.to_string(), LinkType::Framework)),
102102
Some("match") => self.options.match_pat.push(val.to_string()),
103103
Some("clang_args") => self.options.clang_args.push(val.to_string()),
104-
Some("enum_type") => self.options.override_enum_ty = val.to_string(),
105104
_ => return false
106105
}
107106
true

src/bin/bindgen.rs

-10
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ Options:
5858
5959
--enable-cxx-namespaces Enable support for C++ namespaces.
6060
61-
--no-type-renaming Don't rename types.
62-
6361
--emit-clang-ast Output the ast (for debugging purposes)
6462
6563
--use-msvc-mangling Handle MSVC C++ ABI mangling; requires that
@@ -69,8 +67,6 @@ Options:
6967
7068
--no-unstable-rust Avoid generating unstable rust.
7169
72-
--no-bitfield-methods Avoid generating methods for bitfield access.
73-
7470
--opaque-type=<type> Mark a type as opaque.
7571
7672
--blacklist-type=<type> Mark a type as hidden.
@@ -162,18 +158,12 @@ fn parse_args_or_exit(args: Vec<String>) -> (BindgenOptions, Box<io::Write>) {
162158
"--ignore-functions" => {
163159
options.ignore_functions = true;
164160
}
165-
"--no-bitfield-methods" => {
166-
options.gen_bitfield_methods = false;
167-
}
168161
"--ignore-methods" => {
169162
options.ignore_methods = true;
170163
}
171164
"--enable-cxx-namespaces" => {
172165
options.enable_cxx_namespaces = true;
173166
}
174-
"--no-type-renaming" => {
175-
options.rename_types = false;
176-
}
177167
"--no-unstable-rust" => {
178168
options.unstable_rust = false;
179169
}

src/lib.rs

-30
Original file line numberDiff line numberDiff line change
@@ -114,29 +114,10 @@ impl Builder {
114114
self
115115
}
116116

117-
pub fn no_bitfield_methods(mut self) -> Builder {
118-
self.options.gen_bitfield_methods = false;
119-
self
120-
}
121-
122117
pub fn no_unstable_rust(mut self) -> Builder {
123118
self.options.unstable_rust = false;
124119
self
125120
}
126-
pub fn rust_enums(mut self, value: bool) -> Builder {
127-
self.options.rust_enums = value;
128-
self
129-
}
130-
131-
pub fn rename_types(mut self, value: bool) -> Builder {
132-
self.options.rename_types = value;
133-
self
134-
}
135-
136-
pub fn disable_class_constants(mut self) -> Builder {
137-
self.options.class_constants = false;
138-
self
139-
}
140121

141122
pub fn generate(self) -> Result<Bindings, ()> {
142123
Bindings::generate(self.options, None)
@@ -152,24 +133,18 @@ pub struct BindgenOptions {
152133
pub whitelisted_functions: RegexSet,
153134
pub whitelisted_vars: RegexSet,
154135
pub builtins: bool,
155-
pub rust_enums: bool,
156136
pub links: Vec<(String, LinkType)>,
157137
pub emit_ast: bool,
158138
pub ignore_functions: bool,
159139
pub ignore_methods: bool,
160-
pub gen_bitfield_methods: bool,
161140
pub enable_cxx_namespaces: bool,
162-
pub rename_types: bool,
163141
pub derive_debug: bool,
164142
/// Generate or not only stable rust.
165143
pub unstable_rust: bool,
166-
/// Whether to generate C++ class constants.
167-
pub class_constants: bool,
168144
/// Wether to generate names that are **directly** under namespaces.
169145
pub namespaced_constants: bool,
170146
/// Whether to use msvc mangling rules
171147
pub msvc_mangling: bool,
172-
pub override_enum_ty: String,
173148
pub raw_lines: Vec<String>,
174149
pub clang_args: Vec<String>,
175150
}
@@ -183,18 +158,13 @@ impl Default for BindgenOptions {
183158
whitelisted_functions: Default::default(),
184159
whitelisted_vars: Default::default(),
185160
builtins: false,
186-
rust_enums: true,
187161
links: vec![],
188162
emit_ast: false,
189163
ignore_functions: false,
190164
ignore_methods: false,
191-
gen_bitfield_methods: true,
192-
rename_types: true,
193165
derive_debug: true,
194166
enable_cxx_namespaces: false,
195-
override_enum_ty: "".to_string(),
196167
unstable_rust: true,
197-
class_constants: true,
198168
namespaced_constants: true,
199169
msvc_mangling: false,
200170
raw_lines: vec![],

tests/headers/class_with_typedef.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// bindgen-flags: --no-type-renaming
21
// bindgen-features: llvm_stable
32

43
typedef int AnotherInt;

tests/headers/crtp.hpp

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// bindgen-flags: --no-type-renaming
2-
31
template<class T>
42
class Base {};
53

tests/headers/vtable_recursive_sig.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// bindgen-flags: --no-type-renaming -- -std=c++11
1+
// bindgen-flags: -- -std=c++11
22

33
class Derived;
44
class Base {

0 commit comments

Comments
 (0)