diff options
author | Bill Wendling <isanbard@gmail.com> | 2009-02-20 20:40:28 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2009-02-20 20:40:28 +0000 |
commit | 9a65cfe7dd7662558b45bcba46b11ee52c4bbf6c (patch) | |
tree | 9924a9ebb44f8022830e1aaf3bb0a85c24265732 /lib/CodeGen/AsmPrinter/DwarfWriter.cpp | |
parent | 33e3a36f0a116b758708ef8fd0695d3a4cb21531 (diff) |
- Early exit a nested block.
- Correct comment.
- Whitespace changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65149 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DwarfWriter.cpp')
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfWriter.cpp | 50 |
1 files changed, 27 insertions, 23 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfWriter.cpp b/lib/CodeGen/AsmPrinter/DwarfWriter.cpp index 356f5a89c0..2a5916b7cd 100644 --- a/lib/CodeGen/AsmPrinter/DwarfWriter.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfWriter.cpp @@ -1267,6 +1267,7 @@ class DwarfDebug : public Dwarf { /// MainCU - Some platform prefers one compile unit per .o file. In such /// cases, all dies are inserted in MainCU. CompileUnit *MainCU; + /// AbbreviationsSet - Used to uniquely define abbreviations. /// FoldingSet<DIEAbbrev> AbbreviationsSet; @@ -1278,7 +1279,7 @@ class DwarfDebug : public Dwarf { /// Directories - Uniquing vector for directories. UniqueVector<std::string> Directories; - /// SourceFiles - Uniquing vector for source files. + /// SrcFiles - Uniquing vector for source files. UniqueVector<SrcFileInfo> SrcFiles; /// Lines - List of of source line correspondence. @@ -1993,28 +1994,32 @@ private: /// DbgScope *getOrCreateScope(GlobalVariable *V) { DbgScope *&Slot = DbgScopeMap[V]; - if (!Slot) { - // FIXME - breaks down when the context is an inlined function. - DIDescriptor ParentDesc; - DIDescriptor Desc(V); - if (Desc.getTag() == dwarf::DW_TAG_lexical_block) { - DIBlock Block(V); - ParentDesc = Block.getContext(); - } - DbgScope *Parent = ParentDesc.isNull() ? - NULL : getOrCreateScope(ParentDesc.getGV()); - Slot = new DbgScope(Parent, Desc); - if (Parent) { - Parent->AddScope(Slot); - } else if (RootDbgScope) { - // FIXME - Add inlined function scopes to the root so we can delete - // them later. Long term, handle inlined functions properly. - RootDbgScope->AddScope(Slot); - } else { - // First function is top level function. - RootDbgScope = Slot; - } + if (Slot) return Slot; + + // FIXME - breaks down when the context is an inlined function. + DIDescriptor ParentDesc; + DIDescriptor Desc(V); + + if (Desc.getTag() == dwarf::DW_TAG_lexical_block) { + DIBlock Block(V); + ParentDesc = Block.getContext(); } + + DbgScope *Parent = ParentDesc.isNull() ? + NULL : getOrCreateScope(ParentDesc.getGV()); + Slot = new DbgScope(Parent, Desc); + + if (Parent) { + Parent->AddScope(Slot); + } else if (RootDbgScope) { + // FIXME - Add inlined function scopes to the root so we can delete them + // later. Long term, handle inlined functions properly. + RootDbgScope->AddScope(Slot); + } else { + // First function is top level function. + RootDbgScope = Slot; + } + return Slot; } @@ -3087,7 +3092,6 @@ public: /// ValidDebugInfo - Return true if V represents valid debug info value. bool ValidDebugInfo(Value *V) { - if (!V) return false; |