Skip to content

Commit 32e4781

Browse files
committed
Revert "fix: name mangling check for C++"
This reverts commit 25b321a.
1 parent de9de85 commit 32e4781

File tree

4 files changed

+0
-38
lines changed

4 files changed

+0
-38
lines changed

Cargo.lock

-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ cexpr = "0.6"
3030
clang-sys = "1"
3131
clap = "4"
3232
clap_complete = "4"
33-
cpp_demangle = "0.4.4"
3433
env_logger = "0.10.0"
3534
itertools = { version = ">=0.10,<0.14", default-features = false }
3635
libloading = "0.8"

bindgen/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ cexpr.workspace = true
3232
clang-sys = { workspace = true, features = ["clang_11_0"] }
3333
clap = { workspace = true, features = ["derive"], optional = true }
3434
clap_complete = { workspace = true, optional = true }
35-
cpp_demangle.workspace = true
3635
itertools = { workspace = true }
3736
log = { workspace = true, optional = true }
3837
prettyplease = { workspace = true, optional = true, features = ["verbatim"] }

bindgen/codegen/mod.rs

-26
Original file line numberDiff line numberDiff line change
@@ -5858,32 +5858,6 @@ pub(crate) mod utils {
58585858
return true;
58595859
}
58605860

5861-
// Check if the mangled name is a valid C++ symbol
5862-
if let Ok(demangled) = cpp_demangle::Symbol::new(mangled_name) {
5863-
let demangled_name = demangled.to_string().replace("::", "_");
5864-
5865-
// Check that the demangled name is longer than the canonical name
5866-
if demangled_name.len() <= canonical_name.len() {
5867-
return false;
5868-
}
5869-
5870-
// Check that the demangled name starts with the canonical name
5871-
if !demangled_name.starts_with(canonical_name) {
5872-
return false;
5873-
}
5874-
5875-
// Check that the suffix is a signature
5876-
if let Some(suffix) = demangled_name.get(canonical_name.len()..) {
5877-
if !suffix.starts_with('(') || !suffix.ends_with(')') {
5878-
return false;
5879-
}
5880-
} else {
5881-
return false;
5882-
}
5883-
5884-
return true;
5885-
}
5886-
58875861
// Working with &[u8] makes indexing simpler than with &str
58885862
let canonical_name = canonical_name.as_bytes();
58895863
let mangled_name = mangled_name.as_bytes();

0 commit comments

Comments
 (0)