diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-04-28 20:36:45 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-04-28 20:36:45 +0000 |
commit | f244922f438ffaacdb092ed37db56068bdda475e (patch) | |
tree | e31bd0e4b3392819bfed48ee87d7f6bf1a4c6832 /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h | |
parent | d8f0ac7b4aa79e1d643f5469874603d53d9e6a33 (diff) | |
download | bcm5719-llvm-f244922f438ffaacdb092ed37db56068bdda475e.tar.gz bcm5719-llvm-f244922f438ffaacdb092ed37db56068bdda475e.zip |
Improve explicit memory ownership of DIEs
Now that the subtle constructScopeDIE has been refactored into two
functions - one returning memory to take ownership of, one returning a
pointer to already owning memory - push unique_ptr through more APIs.
I think this completes most of the unique_ptr ownership of DIEs.
llvm-svn: 207442
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h index e9c656e5da8..862b1ba3f2e 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h @@ -359,14 +359,17 @@ class DwarfDebug : public AsmPrinterHandler { /// \brief Construct new DW_TAG_lexical_block for this scope and /// attach DW_AT_low_pc/DW_AT_high_pc labels. - DIE *constructLexicalScopeDIE(DwarfCompileUnit &TheCU, LexicalScope *Scope); + std::unique_ptr<DIE> constructLexicalScopeDIE(DwarfCompileUnit &TheCU, + LexicalScope *Scope); /// \brief This scope represents inlined body of a function. Construct /// DIE to represent this concrete inlined copy of the function. - DIE *constructInlinedScopeDIE(DwarfCompileUnit &TheCU, LexicalScope *Scope); + std::unique_ptr<DIE> constructInlinedScopeDIE(DwarfCompileUnit &TheCU, + LexicalScope *Scope); /// \brief Construct a DIE for this scope. - DIE *constructScopeDIE(DwarfCompileUnit &TheCU, LexicalScope *Scope); + std::unique_ptr<DIE> constructScopeDIE(DwarfCompileUnit &TheCU, + LexicalScope *Scope); /// \brief Construct a DIE for this scope. DIE *constructSubprogramScopeDIE(DwarfCompileUnit &TheCU, LexicalScope *Scope); /// A helper function to create children of a Scope DIE. @@ -496,11 +499,11 @@ class DwarfDebug : public AsmPrinterHandler { /// \brief Construct import_module DIE. void constructImportedEntityDIE(DwarfCompileUnit &TheCU, const MDNode *N, - DIE *Context); + DIE &Context); /// \brief Construct import_module DIE. void constructImportedEntityDIE(DwarfCompileUnit &TheCU, - const DIImportedEntity &Module, DIE *Context); + const DIImportedEntity &Module, DIE &Context); /// \brief Register a source line with debug info. Returns the unique /// label that was emitted and which provides correspondence to the |