diff options
author | Chris Lattner <sabre@nondot.org> | 2010-04-05 05:24:55 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-04-05 05:24:55 +0000 |
commit | 74e41f982100b225936d75047dccbe5f1988b1d0 (patch) | |
tree | 1bf65e60a3e548ac1b9a09d372430c66870ce8d6 /lib/CodeGen/AsmPrinter/DwarfDebug.cpp | |
parent | 493c9765e066896b381e8404e0c09125377bcc97 (diff) |
prune #includes, realize the MMI can never be null.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100407 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 5cee67cf76..684b0cd92c 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -13,6 +13,7 @@ #define DEBUG_TYPE "dwarfdebug" #include "DwarfDebug.h" +#include "DIE.h" #include "llvm/Module.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineModuleInfo.h" @@ -26,6 +27,7 @@ #include "llvm/Target/TargetLoweringObjectFile.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetRegisterInfo.h" +#include "llvm/Analysis/DebugInfo.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/StringExtras.h" #include "llvm/Support/Debug.h" @@ -401,6 +403,14 @@ void DwarfDebug::addDelta(DIE *Die, unsigned Attribute, unsigned Form, Die->addValue(Attribute, Form, Value); } +/// addDIEEntry - Add a DIE attribute data and value. +/// +void DwarfDebug::addDIEEntry(DIE *Die, unsigned Attribute, unsigned Form, + DIE *Entry) { + Die->addValue(Attribute, Form, createDIEEntry(Entry)); +} + + /// addBlock - Add block data. /// void DwarfDebug::addBlock(DIE *Die, unsigned Attribute, unsigned Form, @@ -1793,8 +1803,6 @@ void DwarfDebug::constructSubprogramDIE(MDNode *N) { /// content. Create global DIEs and emit initial debug info sections. /// This is inovked by the target AsmPrinter. void DwarfDebug::beginModule(Module *M) { - MMI = Asm->MMI; - TimeRegion Timer(DebugTimer); DebugInfoFinder DbgFinder; @@ -1994,8 +2002,6 @@ DbgVariable *DwarfDebug::findAbstractVariable(DIVariable &Var, /// collectVariableInfo - Populate DbgScope entries with variables' info. void DwarfDebug::collectVariableInfo() { - if (!MMI) return; - const LLVMContext &Ctx = Asm->MF->getFunction()->getContext(); MachineModuleInfo::VariableDbgInfoMapTy &VMap = MMI->getVariableDbgInfo(); @@ -2297,8 +2303,8 @@ void DwarfDebug::beginFunction(const MachineFunction *MF) { /// endFunction - Gather and emit post-function debug information. /// void DwarfDebug::endFunction(const MachineFunction *MF) { - if (!MMI->hasDebugInfo()) return; - if (DbgScopeMap.empty()) return; + if (!MMI->hasDebugInfo() || + DbgScopeMap.empty()) return; TimeRegion Timer(DebugTimer); @@ -2346,9 +2352,6 @@ void DwarfDebug::endFunction(const MachineFunction *MF) { /// unique label that was emitted and which provides correspondence to /// the source line list. MCSymbol *DwarfDebug::recordSourceLine(unsigned Line, unsigned Col, MDNode *S) { - if (!MMI) - return 0; - TimeRegion Timer(DebugTimer); StringRef Dir; |