@@ -9045,6 +9045,21 @@ ConstString TypeSystemClang::DeclGetName(void *opaque_decl) {
9045
9045
return ConstString ();
9046
9046
}
9047
9047
9048
+ static ConstString
9049
+ ExtractMangledNameFromFunctionCallLabel (llvm::StringRef label) {
9050
+ auto components_or_err = splitFunctionCallLabel (label);
9051
+ if (!components_or_err) {
9052
+ llvm::consumeError (components_or_err.takeError ());
9053
+ return {};
9054
+ }
9055
+
9056
+ llvm::StringRef mangled = (*components_or_err)[0 ];
9057
+ if (Mangled::IsMangledName (mangled))
9058
+ return ConstString (mangled);
9059
+
9060
+ return {};
9061
+ }
9062
+
9048
9063
ConstString TypeSystemClang::DeclGetMangledName (void *opaque_decl) {
9049
9064
clang::NamedDecl *nd = llvm::dyn_cast_or_null<clang::NamedDecl>(
9050
9065
static_cast <clang::Decl *>(opaque_decl));
@@ -9056,14 +9071,12 @@ ConstString TypeSystemClang::DeclGetMangledName(void *opaque_decl) {
9056
9071
if (!mc || !mc->shouldMangleCXXName (nd))
9057
9072
return {};
9058
9073
9059
- // We have a LLDB FunctionCallLabel instead of an ordinary mangled name.
9074
+ // We have an LLDB FunctionCallLabel instead of an ordinary mangled name.
9060
9075
// Extract the mangled name out of this label.
9061
- if (const auto *label = nd->getAttr <AsmLabelAttr>()) {
9062
- if (auto components_or_err = splitFunctionCallLabel (label->getLabel ()))
9063
- return ConstString ((*components_or_err)[0 ]);
9064
- else
9065
- llvm::consumeError (components_or_err.takeError ());
9066
- }
9076
+ if (const auto *label = nd->getAttr <AsmLabelAttr>())
9077
+ if (ConstString mangled =
9078
+ ExtractMangledNameFromFunctionCallLabel (label->getLabel ()))
9079
+ return mangled;
9067
9080
9068
9081
llvm::SmallVector<char , 1024 > buf;
9069
9082
llvm::raw_svector_ostream llvm_ostrm (buf);
0 commit comments