[clang] [llvm] [debuginfo][coro] Fix linkage name for clones of coro functions (PR #141889)
Michael Buch via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 3 05:10:07 PDT 2025
================
@@ -912,29 +912,14 @@ void coro::BaseCloner::create() {
assert(SP != OrigF.getSubprogram() && SP->isDistinct());
updateScopeLine(ActiveSuspend, *SP);
- // Update the linkage name to reflect the modified symbol name. It
- // is necessary to update the linkage name in Swift, since the
- // mangling changes for resume functions. It might also be the
- // right thing to do in C++, but due to a limitation in LLVM's
- // AsmPrinter we can only do this if the function doesn't have an
- // abstract specification, since the DWARF backend expects the
- // abstract specification to contain the linkage name and asserts
- // that they are identical.
- if (SP->getUnit() &&
- SP->getUnit()->getSourceLanguage() == dwarf::DW_LANG_Swift) {
- SP->replaceLinkageName(MDString::get(Context, NewF->getName()));
- if (auto *Decl = SP->getDeclaration()) {
- auto *NewDecl = DISubprogram::get(
- Decl->getContext(), Decl->getScope(), Decl->getName(),
- NewF->getName(), Decl->getFile(), Decl->getLine(), Decl->getType(),
- Decl->getScopeLine(), Decl->getContainingType(),
- Decl->getVirtualIndex(), Decl->getThisAdjustment(),
- Decl->getFlags(), Decl->getSPFlags(), Decl->getUnit(),
- Decl->getTemplateParams(), nullptr, Decl->getRetainedNodes(),
- Decl->getThrownTypes(), Decl->getAnnotations(),
- Decl->getTargetFuncName());
- SP->replaceDeclaration(NewDecl);
- }
+ // Update the linkage name and the functaion name to reflect the modified
----------------
Michael137 wrote:
```suggestion
// Update the linkage name and the function name to reflect the modified
```
https://github.com/llvm/llvm-project/pull/141889
More information about the cfe-commits
mailing list