================
@@ -766,26 +765,41 @@ DIE
*DwarfCompileUnit::constructInlinedScopeDIE(LexicalScope *Scope,
return ScopeDIE;
}
-// Construct new DW_TAG_lexical_block for this scope and attach
-// DW_AT_low_pc/DW_AT_high_pc labels.
-DIE *DwarfCompileUnit::constructLexicalScopeDIE(LexicalScope *Scope) {
+DIE *DwarfCompileUnit::getOrCreateLexicalBlockDIE(LexicalScope *Scope,
+ DIE &ParentScopeDIE) {
if (DD->isLexicalScopeDIENull(Scope))
return nullptr;
const auto *DS = Scope->getScopeNode();
-
- auto ScopeDIE = DIE::get(DIEValueAllocator, dwarf::DW_TAG_lexical_block);
- if (Scope->isAbstractScope()) {
- assert(!getAbstractScopeDIEs().count(DS) &&
- "Abstract DIE for this scope exists!");
- getAbstractScopeDIEs()[DS] = ScopeDIE;
- return ScopeDIE;
+ DIE *ScopeDIE = nullptr;
+
+ // FIXME: We may have a concrete DIE for this scope already created.
+ // This may happen when we emit local variables for an abstract tree of
+ // an inlined function: if a local variable has a templated type with
+ // a function-local type as a template parameter. See PR55680 for details
+ // (see also
llvm/test/DebugInfo/Generic/local-type-as-template-parameter.ll).
----------------
jmorse wrote:
It's unclear what's to be fixed here: the concrete DIE isn't supposed to exist
already but we accept it temporarily, or we should intend on creating a
duplicate, or placing it somewhere else?
https://github.com/llvm/llvm-project/pull/165032
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits