diff options
author | Djordje Todorovic <djordje.todorovic@rt-rk.com> | 2019-06-27 06:07:41 +0000 |
---|---|---|
committer | Djordje Todorovic <djordje.todorovic@rt-rk.com> | 2019-06-27 06:07:41 +0000 |
commit | 59b39faa1839dda3f445c077ba05be2de447ee60 (patch) | |
tree | 0141bc3d4d51b8a120205a1bf4c87581d12ddf87 /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | |
parent | 9153501f074b3599492793285088adae157235bf (diff) | |
download | llvm-59b39faa1839dda3f445c077ba05be2de447ee60.zip llvm-59b39faa1839dda3f445c077ba05be2de447ee60.tar.gz llvm-59b39faa1839dda3f445c077ba05be2de447ee60.tar.bz2 |
[IR] Add DISuprogram and DIE for a func decl
A unique DISubprogram may be attached to a function declaration used for
call site debug info.
([6/13] Introduce the debug entry values.)
Co-authored-by: Ananth Sowda <asowda@cisco.com>
Co-authored-by: Nikola Prica <nikola.prica@rt-rk.com>
Co-authored-by: Ivan Baev <ibaev@cisco.com>
Differential Revision: https://reviews.llvm.org/D60713
llvm-svn: 364500
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 24802dc..8e842f0 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -706,6 +706,11 @@ DwarfDebug::getOrCreateDwarfCompileUnit(const DICompileUnit *DIUnit) { NewCU.setSection(Asm->getObjFileLowering().getDwarfInfoSection()); } + // Create DIEs for function declarations used for call site debug info. + for (auto Scope : DIUnit->getRetainedTypes()) + if (auto *SP = dyn_cast_or_null<DISubprogram>(Scope)) + NewCU.getOrCreateSubprogramDIE(SP); + CUMap.insert({DIUnit, &NewCU}); CUDieMap.insert({&NewCU.getUnitDie(), &NewCU}); return NewCU; |