diff options
author | Jim Laskey <jlaskey@mac.com> | 2006-02-22 19:02:11 +0000 |
---|---|---|
committer | Jim Laskey <jlaskey@mac.com> | 2006-02-22 19:02:11 +0000 |
commit | 0420f2aaf9551a10e2060d076de2fcdd7b316370 (patch) | |
tree | 33ca16d10f2cb6613f7ba6b314d8cf15a41a2516 /lib/CodeGen/MachineDebugInfo.cpp | |
parent | 410354fe0c052141dadeca939395743f8dd58e38 (diff) |
Coordinate activities with llvm-gcc4 and dwarf.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26314 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineDebugInfo.cpp')
-rw-r--r-- | lib/CodeGen/MachineDebugInfo.cpp | 44 |
1 files changed, 12 insertions, 32 deletions
diff --git a/lib/CodeGen/MachineDebugInfo.cpp b/lib/CodeGen/MachineDebugInfo.cpp index 2339e45f07..b801cad379 100644 --- a/lib/CodeGen/MachineDebugInfo.cpp +++ b/lib/CodeGen/MachineDebugInfo.cpp @@ -579,6 +579,7 @@ void GlobalVariableDesc::ApplyToFields(DIVisitor *Visitor) { GlobalDesc::ApplyToFields(Visitor); Visitor->Apply(Global); + Visitor->Apply(Line); } /// getDescString - Return a string used to compose global names and labels. @@ -607,7 +608,8 @@ void GlobalVariableDesc::dump() { << "Name(\"" << getName() << "\"), " << "IsStatic(" << (isStatic() ? "true" : "false") << "), " << "IsDefinition(" << (isDefinition() ? "true" : "false") << "), " - << "Global(" << Global << ")\n"; + << "Global(" << Global << "), " + << "Line(" << Line << ")\n"; } #endif @@ -910,16 +912,10 @@ void MachineDebugInfo::AnalyzeModule(Module &M) { /// SetupCompileUnits - Set up the unique vector of compile units. /// void MachineDebugInfo::SetupCompileUnits(Module &M) { - // Get vector of all debug compile units. - CompileUnitDesc CompileUnit; - std::vector<GlobalVariable*> Globals = - getGlobalVariablesUsing(M, CompileUnit.getAnchorString()); + std::vector<CompileUnitDesc *>CU = getAnchoredDescriptors<CompileUnitDesc>(M); - // Scan all compile unit globals. - for (unsigned i = 0, N = Globals.size(); i < N; ++i) { - // Add compile unit to result. - CompileUnits.insert( - static_cast<CompileUnitDesc *>(DR.Deserialize(Globals[i]))); + for (unsigned i = 0, N = CU.size(); i < N; i++) { + CompileUnits.insert(CU[i]); } } @@ -929,26 +925,10 @@ const UniqueVector<CompileUnitDesc *> MachineDebugInfo::getCompileUnits()const{ return CompileUnits; } -/// getGlobalVariables - Return a vector of debug GlobalVariables. -/// -std::vector<GlobalVariableDesc *> -MachineDebugInfo::getGlobalVariables(Module &M) { - // Get vector of all debug global objects. - GlobalVariableDesc Global; - std::vector<GlobalVariable*> Globals = - getGlobalVariablesUsing(M, Global.getAnchorString()); - - // Accumulation of GlobalVariables. - std::vector<GlobalVariableDesc *> GlobalVariables; - - // Scan all globals. - for (unsigned i = 0, N = Globals.size(); i < N; ++i) { - GlobalVariable *GV = Globals[i]; - GlobalVariableDesc *GVD = - static_cast<GlobalVariableDesc *>(DR.Deserialize(GV)); - GlobalVariables.push_back(GVD); - } - - return GlobalVariables; +/// getGlobalVariablesUsing - Return all of the GlobalVariables that use the +/// named GlobalVariable. +std::vector<GlobalVariable*> +MachineDebugInfo::getGlobalVariablesUsing(Module &M, + const std::string &RootName) { + return ::getGlobalVariablesUsing(M, RootName); } - |