From 0420f2aaf9551a10e2060d076de2fcdd7b316370 Mon Sep 17 00:00:00 2001 From: Jim Laskey Date: Wed, 22 Feb 2006 19:02:11 +0000 Subject: Coordinate activities with llvm-gcc4 and dwarf. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26314 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/MachineDebugInfo.cpp | 44 +++++++++++----------------------------- 1 file changed, 12 insertions(+), 32 deletions(-) (limited to 'lib/CodeGen/MachineDebugInfo.cpp') 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 Globals = - getGlobalVariablesUsing(M, CompileUnit.getAnchorString()); + std::vectorCU = getAnchoredDescriptors(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(DR.Deserialize(Globals[i]))); + for (unsigned i = 0, N = CU.size(); i < N; i++) { + CompileUnits.insert(CU[i]); } } @@ -929,26 +925,10 @@ const UniqueVector MachineDebugInfo::getCompileUnits()const{ return CompileUnits; } -/// getGlobalVariables - Return a vector of debug GlobalVariables. -/// -std::vector -MachineDebugInfo::getGlobalVariables(Module &M) { - // Get vector of all debug global objects. - GlobalVariableDesc Global; - std::vector Globals = - getGlobalVariablesUsing(M, Global.getAnchorString()); - - // Accumulation of GlobalVariables. - std::vector GlobalVariables; - - // Scan all globals. - for (unsigned i = 0, N = Globals.size(); i < N; ++i) { - GlobalVariable *GV = Globals[i]; - GlobalVariableDesc *GVD = - static_cast(DR.Deserialize(GV)); - GlobalVariables.push_back(GVD); - } - - return GlobalVariables; +/// getGlobalVariablesUsing - Return all of the GlobalVariables that use the +/// named GlobalVariable. +std::vector +MachineDebugInfo::getGlobalVariablesUsing(Module &M, + const std::string &RootName) { + return ::getGlobalVariablesUsing(M, RootName); } - -- cgit v1.2.3-70-g09d2