diff options
| author | Devang Patel <dpatel@apple.com> | 2009-01-06 21:07:30 +0000 |
|---|---|---|
| committer | Devang Patel <dpatel@apple.com> | 2009-01-06 21:07:30 +0000 |
| commit | 928d465b6b78d7382de46d91ce2f25eac5858710 (patch) | |
| tree | 265bb452b0a47b9bec1e5268dd9636696988001c /llvm/lib/CodeGen | |
| parent | f192fabbdc3b2998a263d638a5ea7eaf613778b7 (diff) | |
| download | bcm5719-llvm-928d465b6b78d7382de46d91ce2f25eac5858710.tar.gz bcm5719-llvm-928d465b6b78d7382de46d91ce2f25eac5858710.zip | |
Set up DwarfDebug using DebugInfo API.
llvm-svn: 61822
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp index fb0c86b5493..6e2011ea280 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp @@ -3291,6 +3291,39 @@ public: delete Values[j]; } + /// SetDebugInfo - Create global DIEs and emit initial debug info sections. + /// This is inovked by the target AsmPrinter. + void SetDebugInfo() { + // FIXME - Check if the module has debug info or not. + // Create all the compile unit DIEs. + ConstructCompileUnits(); + + // Create DIEs for each of the externally visible global variables. + ConstructGlobalVariableDIEs(); + + // Create DIEs for each of the externally visible subprograms. + ConstructSubprograms(); + + // Prime section data. + SectionMap.insert(TAI->getTextSection()); + + // Print out .file directives to specify files for .loc directives. These + // are printed out early so that they precede any .loc directives. + if (TAI->hasDotLocAndDotFile()) { + for (unsigned i = 1, e = SrcFiles.size(); i <= e; ++i) { + sys::Path FullPath(Directories[SrcFiles[i].getDirectoryID()]); + bool AppendOk = FullPath.appendComponent(SrcFiles[i].getName()); + assert(AppendOk && "Could not append filename to directory!"); + AppendOk = false; + Asm->EmitFile(i, FullPath.toString()); + Asm->EOL(); + } + } + + // Emit initial sections + EmitInitial(); + } + /// SetModuleInfo - Set machine module information when it's known that pass /// manager has created it. Set by the target AsmPrinter. void SetModuleInfo(MachineModuleInfo *mmi) { |

