diff options
author | Jim Laskey <jlaskey@mac.com> | 2006-01-17 17:31:53 +0000 |
---|---|---|
committer | Jim Laskey <jlaskey@mac.com> | 2006-01-17 17:31:53 +0000 |
commit | b9966029fe558b5530bcf3b2518548bc1d4ca60d (patch) | |
tree | 4c946959cc7a8f5b826a40b50a34cfdebd5cdc10 /llvm/lib/CodeGen/MachineDebugInfo.cpp | |
parent | f9978d8a0ba428210e89cd83725889d10126a229 (diff) | |
download | bcm5719-llvm-b9966029fe558b5530bcf3b2518548bc1d4ca60d.tar.gz bcm5719-llvm-b9966029fe558b5530bcf3b2518548bc1d4ca60d.zip |
Adding basic support for Dwarf line number debug information.
I promise to keep future commits smaller.
llvm-svn: 25396
Diffstat (limited to 'llvm/lib/CodeGen/MachineDebugInfo.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineDebugInfo.cpp | 42 |
1 files changed, 2 insertions, 40 deletions
diff --git a/llvm/lib/CodeGen/MachineDebugInfo.cpp b/llvm/lib/CodeGen/MachineDebugInfo.cpp index d2a5fd5eb35..546468647b1 100644 --- a/llvm/lib/CodeGen/MachineDebugInfo.cpp +++ b/llvm/lib/CodeGen/MachineDebugInfo.cpp @@ -6,11 +6,6 @@ // the University of Illinois Open Source License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -// -// Collect debug information for a module. This information should be in a -// neutral form that can be used by different debugging schemes. -// -//===----------------------------------------------------------------------===// #include "llvm/CodeGen/MachineDebugInfo.h" @@ -20,7 +15,9 @@ using namespace llvm; namespace { RegisterPass<MachineDebugInfo> X("machinedebuginfo", "Debug Information"); } + +//===----------------------------------------------------------------------===// /// doInitialization - Initialize the debug state for a new module. /// bool MachineDebugInfo::doInitialization() { @@ -32,38 +29,3 @@ bool MachineDebugInfo::doInitialization() { bool MachineDebugInfo::doFinalization() { return false; } - -/// getUniqueSourceID - Register a source file with debug info. Returns an id. -/// -unsigned MachineDebugInfo::getUniqueSourceID(const std::string &fname, - const std::string &dirname) { - // Compose a key - const std::string path = dirname + "/" + fname; - // Check if the source file is already recorded - std::map<std::string, unsigned>::iterator - SMI = SourceMap.lower_bound(path); - // If already there return existing id - if (SMI != SourceMap.end() && SMI->first == path) return SMI->second; - // Bump up the count - ++SourceCount; - // Record the count - SourceMap.insert(SMI, std::make_pair(path, SourceCount)); - // Return id - return SourceCount; -} - -/// getSourceFiles - Return a vector of files. Vector index + 1 equals id. -/// -std::vector<std::string> MachineDebugInfo::getSourceFiles() const { - std::vector<std::string> Sources(SourceCount); - - for (std::map<std::string, unsigned>::const_iterator SMI = SourceMap.begin(), - E = SourceMap.end(); - SMI != E; SMI++) { - unsigned Index = SMI->second - 1; - const std::string &Path = SMI->first; - Sources[Index] = Path; - } - return Sources; -} - |