Skip to content

Commit 3f64f97

Browse files
authored
Add support for symbols with {lambda...#1} to merge_libraries.py (#1279)
* Add support for symbols like this one, which is referenced by the Firestore iOS SDK on Linux: grpc_slice_malloc_large::{lambda(grpc_slice_refcount*)#1}::_FUN(grpc_slice_refcount*) * Handle #. * Add the latest {lambda...#1} case to the test.
1 parent 76f24cf commit 3f64f97

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

scripts/merge_libraries.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ def get_top_level_namespaces(demangled_symbols):
418418
# It will specifically not match second-level or deeper namespaces:
419419
# matched_namespace::unmatched_namespace::Class::Method()
420420
regex_top_level_namespaces = re.compile(
421-
r"(?<![a-zA-Z0-9_])(?<!::)([a-zA-Z_~\$][a-zA-Z0-9_]*)::(?=[a-zA-Z_~` \$])")
421+
r"(?<![a-zA-Z0-9_])(?<!::)([a-zA-Z_~\{\$][a-zA-Z0-9_\{\}\#]*)::(?=[a-zA-Z_~` \{\$])")
422422
found_namespaces = set()
423423
for cppsymbol in demangled_symbols:
424424
m = regex_top_level_namespaces.findall(cppsymbol)

scripts/merge_libraries_test.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,13 @@ def test_get_top_level_namespaces(self):
5151
"topleveldestructor::~topleveldestructor()": {"topleveldestructor"},
5252
"rtti::RttiClass::`RTTI Class Hierarchy Descriptor'": {"rtti"},
5353
"toplevelrtti::`RTTI Class Hierarchy Descriptor'": {"toplevelrtti"},
54+
# Test some complicated grpc cases that required special handling.
5455
"public: virtual enum grpc_security_level __cdecl grpc_call_credentials::min_security_level(void) const": {
5556
"grpc_call_credentials"
5657
},
58+
"grpc_slice_malloc_large::{lambda(grpc_slice_refcount*)#1}::_FUN(grpc_slice_refcount*)": {
59+
"grpc_slice_malloc_large"
60+
},
5761
# std namespaces are used by get_top_level_namespaces but not by add_automatic_namespaces
5862
"std::dont_use_this<std::other_thing>()": {"std"},
5963
"std::vector<inside_std_template_param::class>()": { "std", "inside_std_template_param" }

0 commit comments

Comments
 (0)