[PATCH] D124982: [clang][OpenMP][DebugInfo] Debug support for variables in containing scope of OMP constructs

Kristina Bessonova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 17 03:11:20 PDT 2022


krisb added inline comments.


================
Comment at: llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:689
   auto ScopeDIE = DIE::get(DIEValueAllocator, dwarf::DW_TAG_lexical_block);
+  insertDIE(Scope->getScopeNode(), ScopeDIE);
   if (Scope->isAbstractScope())
----------------
In case of compiling optimized code with inlining enabled, the `Scope` may be either a scope of an inlined instance (which may appear multiple times), an abstract scope or a concrete out-of-line scope. All of them will match a single ScopeNode, so this will override the map's value multiple times and `getDIE()` will likely return something that one may not expect.
I've been working on patches that make possible for local types, imports and static variables to be scoped in a lexical block, see D125693 for backend-related changes. May be you could find something useful there (see `DwarfCompileUnit::getOrCreateLexicalBlockDIE()` and `DwarfCompileUnit::getOrCreateContextDIE()`) or could help to review the patches.


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

https://reviews.llvm.org/D124982



More information about the cfe-commits mailing list