[llvm] [llvm-cxxfilt] Added the option --no-params (PR #75348)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 18 01:55:52 PST 2023


================
@@ -0,0 +1,17 @@
+RUN: llvm-cxxfilt             _Z3fooIiJEEvf _ZN1f2baC2ERKNS_2baIT_EE _ZN2baC2EOT0_ | FileCheck %s --check-prefix=CHECK-PARAMS
+RUN: llvm-cxxfilt          -p _Z3fooIiJEEvf _ZN1f2baC2ERKNS_2baIT_EE _ZN2baC2EOT0_ | FileCheck %s --check-prefix=CHECK-NO-PARAMS
+RUN: llvm-cxxfilt --no-params _Z3fooIiJEEvf _ZN1f2baC2ERKNS_2baIT_EE _ZN2baC2EOT0_ | FileCheck %s --check-prefix=CHECK-NO-PARAMS
+
+CHECK-PARAMS: void foo<int>(float)
+CHECK-NO-PARAMS: foo<int>
+
+# Use invalid mangled name broken in function parameters
+# to check how -p or --no-params flag works.
+# If given we should demangle function name just fine,
+# if not given demangle should fail because of the invalid params.
+
+CHECK-PARAMS: _ZN1f2baC2ERKNS_2baIT_EE
+CHECK-NO-PARAMS: f::ba::ba
+
+CHECK-PARAMS: _ZN2baC2EOT0_
+CHECK-NO-PARAMS: ba::ba
----------------
jh7370 wrote:

It's not clear to me what benefit this additional case gives?

What we could probably use is an example showing that only the top-level function is impacted by the switch, and that nested function types in the encoding (e.g. where a function type is being used as a template parameter) still include their parameters.

https://github.com/llvm/llvm-project/pull/75348


More information about the llvm-commits mailing list