[PATCH] D138595: [llvm-cxxfilt] Support Microsoft demangling format

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 23 19:28:33 PST 2022


dblaikie added a comment.

> New code should probably use the demangle() function that specifies what format should be used.

Not sure I agree with this direction - I'd think that callers that know which format they want to use can/should use APIs that already implement only that format, rather than passing an enum and then switching over the enum to get back to the statically known kind?

So I'd have figured llvm-cxxfilt could have the switch-over-mangling-kind, but the lower level APIs in libDemangle wouldn't have an enum-based API, instead having dedicated functions for different demanglings. (though, arguably, the presence of `demangleNonWindows` goes against that design/direction)

Depends if most callers are likely to know their mangling or not? Got a sense of that, or what your plans are for this new API, beyond llvm-cxxfilt?



================
Comment at: llvm/include/llvm/Demangle/Demangle.h:38
+  demangle_format_rust,
+  demangle_format_non_microsoft, // this is all of the above formats
+  demangle_format_microsoft,
----------------
This seems weird to have an entry in this list that is a grouping of other entries in the list?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138595/new/

https://reviews.llvm.org/D138595



More information about the llvm-commits mailing list