diff options
author | Hans Wennborg <hans@chromium.org> | 2023-09-29 14:09:04 +0200 |
---|---|---|
committer | Hans Wennborg <hans@chromium.org> | 2023-09-29 14:23:31 +0200 |
commit | eee1f7cef856241ad7d66b715c584d29b1c89ca9 (patch) | |
tree | 8201bea81903f1dc28b2921b79611efc1f5e39b0 /llvm/lib/Transforms/Utils/CloneFunction.cpp | |
parent | 00f2d9b0ebcd3a4d56945c5260b8e891087a7861 (diff) | |
download | llvm-eee1f7cef856241ad7d66b715c584d29b1c89ca9.zip llvm-eee1f7cef856241ad7d66b715c584d29b1c89ca9.tar.gz llvm-eee1f7cef856241ad7d66b715c584d29b1c89ca9.tar.bz2 |
Revert "[DebugMetadata][DwarfDebug] Support function-local types in lexical block scopes (4/7)"
This caused asserts:
llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp:2331:
virtual void llvm::DwarfDebug::endFunctionImpl(const llvm::MachineFunction *):
Assertion `LScopes.getAbstractScopesList().size() == NumAbstractSubprograms &&
"getOrCreateAbstractScope() inserted an abstract subprogram scope"' failed.
See comment on the code review for reproducer.
> RFC https://discourse.llvm.org/t/rfc-dwarfdebug-fix-and-improve-handling-imported-entities-types-and-static-local-in-subprogram-and-lexical-block-scopes/68544
>
> Similar to imported declarations, the patch tracks function-local types in
> DISubprogram's 'retainedNodes' field. DwarfDebug is adjusted in accordance with
> the aforementioned metadata change and provided a support of function-local
> types scoped within a lexical block.
>
> The patch assumes that DICompileUnit's 'enums field' no longer tracks local
> types and DwarfDebug would assert if any locally-scoped types get placed there.
>
> Reviewed By: jmmartinez
>
> Differential Revision: https://reviews.llvm.org/D144006
This reverts commit f8aab289b5549086062588fba627b0e4d3a5ab15.
Diffstat (limited to 'llvm/lib/Transforms/Utils/CloneFunction.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/CloneFunction.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/Utils/CloneFunction.cpp b/llvm/lib/Transforms/Utils/CloneFunction.cpp index 39ac48c..d552086 100644 --- a/llvm/lib/Transforms/Utils/CloneFunction.cpp +++ b/llvm/lib/Transforms/Utils/CloneFunction.cpp @@ -244,12 +244,7 @@ void llvm::CloneFunctionInto(Function *NewFunc, const Function *OldFunc, mapToSelfIfNew(CU); for (DIType *Type : DIFinder->types()) - // Don't skip subprogram's local types. - if (!isa_and_present<DILocalScope>(Type->getScope()) || - SPClonedWithinModule == nullptr || - dyn_cast<DILocalScope>(Type->getScope())->getSubprogram() != - SPClonedWithinModule) - mapToSelfIfNew(Type); + mapToSelfIfNew(Type); } else { assert(!SPClonedWithinModule && "Subprogram should be in DIFinder->subprogram_count()..."); |