Do some mechanical changes. Combine the 'construct abastract dbg thingy' in with

the 'constract function dbg thingy'. Rename some methods to make them consistent
with the rest of the methods. Move the 'Emit' methods to the end of the file.

llvm-svn: 72192
This commit is contained in:
Bill Wendling 2009-05-20 23:04:56 +00:00
parent 2b59a5fc6c
commit 8d7533d3e5
2 changed files with 854 additions and 882 deletions

File diff suppressed because it is too large Load Diff

View File

@ -230,16 +230,9 @@ class VISIBILITY_HIDDEN DwarfDebug : public Dwarf {
/// ///
void AssignAbbrevNumber(DIEAbbrev &Abbrev); void AssignAbbrevNumber(DIEAbbrev &Abbrev);
/// NewString - Add a string to the constant pool and returns a label. /// CreateDIEEntry - Creates a new DIEEntry to be a proxy for a debug
/// /// information entry.
DWLabel NewString(const std::string &String) { DIEEntry *CreateDIEEntry(DIE *Entry = NULL);
unsigned StringID = StringPool.insert(String);
return DWLabel("string", StringID);
}
/// NewDIEEntry - Creates a new DIEEntry to be a proxy for a debug information
/// entry.
DIEEntry *NewDIEEntry(DIE *Entry = NULL);
/// SetDIEEntry - Set a DIEEntry once the debug information entry is defined. /// SetDIEEntry - Set a DIEEntry once the debug information entry is defined.
/// ///
@ -282,7 +275,7 @@ class VISIBILITY_HIDDEN DwarfDebug : public Dwarf {
/// AddDIEEntry - Add a DIE attribute data and value. /// AddDIEEntry - Add a DIE attribute data and value.
/// ///
void AddDIEEntry(DIE *Die, unsigned Attribute, unsigned Form, DIE *Entry) { void AddDIEEntry(DIE *Die, unsigned Attribute, unsigned Form, DIE *Entry) {
Die->AddValue(Attribute, Form, NewDIEEntry(Entry)); Die->AddValue(Attribute, Form, CreateDIEEntry(Entry));
} }
/// AddBlock - Add block data. /// AddBlock - Add block data.
@ -346,9 +339,9 @@ class VISIBILITY_HIDDEN DwarfDebug : public Dwarf {
/// ///
CompileUnit &FindCompileUnit(DICompileUnit Unit) const; CompileUnit &FindCompileUnit(DICompileUnit Unit) const;
/// NewDbgScopeVariable - Create a new scope variable. /// CreateDbgScopeVariable - Create a new debug scope variable.
/// ///
DIE *NewDbgScopeVariable(DbgVariable *DV, CompileUnit *Unit); DIE *CreateDbgScopeVariable(DbgVariable *DV, CompileUnit *Unit);
/// getOrCreateScope - Returns the scope associated with the given descriptor. /// getOrCreateScope - Returns the scope associated with the given descriptor.
/// ///
@ -362,17 +355,38 @@ class VISIBILITY_HIDDEN DwarfDebug : public Dwarf {
/// ConstructFunctionDbgScope - Construct the scope for the subprogram. /// ConstructFunctionDbgScope - Construct the scope for the subprogram.
/// ///
void ConstructFunctionDbgScope(DbgScope *RootScope); void ConstructFunctionDbgScope(DbgScope *RootScope,
bool AbstractScope = false);
/// ConstructFunctionDbgScope - Construct the scope for the abstract debug
/// scope.
///
void ConstructAbstractDbgScope(DbgScope *AbsScope);
/// ConstructDefaultDbgScope - Construct a default scope for the subprogram. /// ConstructDefaultDbgScope - Construct a default scope for the subprogram.
/// ///
void ConstructDefaultDbgScope(MachineFunction *MF); void ConstructDefaultDbgScope(MachineFunction *MF);
/// GetOrCreateSourceID - Look up the source id with the given directory and
/// source file names. If none currently exists, create a new id and insert it
/// in the SourceIds map. This can update DirectoryNames and SourceFileNames maps
/// as well.
unsigned GetOrCreateSourceID(const std::string &DirName,
const std::string &FileName);
void ConstructCompileUnit(GlobalVariable *GV);
/// ConstructCompileUnits - Create a compile unit DIEs.
void ConstructCompileUnits();
bool ConstructGlobalVariableDIE(GlobalVariable *GV);
/// ConstructGlobalVariableDIEs - Create DIEs for each of the externally
/// visible global variables. Return true if at least one global DIE is
/// created.
bool ConstructGlobalVariableDIEs();
bool ConstructSubprogram(GlobalVariable *GV);
/// ConstructSubprograms - Create DIEs for each of the externally visible
/// subprograms. Return true if at least one subprogram DIE is created.
bool ConstructSubprograms();
/// EmitInitial - Emit initial Dwarf declarations. This is necessary for cc /// EmitInitial - Emit initial Dwarf declarations. This is necessary for cc
/// tools to recognize the object file contains Dwarf information. /// tools to recognize the object file contains Dwarf information.
void EmitInitial(); void EmitInitial();
@ -461,31 +475,6 @@ class VISIBILITY_HIDDEN DwarfDebug : public Dwarf {
/// the __debug_info section, and the low_pc is the starting address for the /// the __debug_info section, and the low_pc is the starting address for the
/// inlining instance. /// inlining instance.
void EmitDebugInlineInfo(); void EmitDebugInlineInfo();
/// GetOrCreateSourceID - Look up the source id with the given directory and
/// source file names. If none currently exists, create a new id and insert it
/// in the SourceIds map. This can update DirectoryNames and SourceFileNames maps
/// as well.
unsigned GetOrCreateSourceID(const std::string &DirName,
const std::string &FileName);
void ConstructCompileUnit(GlobalVariable *GV);
/// ConstructCompileUnits - Create a compile unit DIEs.
void ConstructCompileUnits();
bool ConstructGlobalVariableDIE(GlobalVariable *GV);
/// ConstructGlobalVariableDIEs - Create DIEs for each of the externally
/// visible global variables. Return true if at least one global DIE is
/// created.
bool ConstructGlobalVariableDIEs();
bool ConstructSubprogram(GlobalVariable *GV);
/// ConstructSubprograms - Create DIEs for each of the externally visible
/// subprograms. Return true if at least one subprogram DIE is created.
bool ConstructSubprograms();
public: public:
//===--------------------------------------------------------------------===// //===--------------------------------------------------------------------===//
// Main entry points. // Main entry points.