[llvm] r192517 - Debug Info: remove form from function addDIEEntry.
Manman Ren
manman.ren at gmail.com
Fri Oct 11 16:58:05 PDT 2013
Author: mren
Date: Fri Oct 11 18:58:05 2013
New Revision: 192517
URL: http://llvm.org/viewvc/llvm-project?rev=192517&view=rev
Log:
Debug Info: remove form from function addDIEEntry.
The form must be a reference form in addDIEEntry. Which reference form to
use will be decided by the callee.
No functionality change.
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp?rev=192517&r1=192516&r2=192517&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp Fri Oct 11 18:58:05 2013
@@ -226,9 +226,9 @@ void CompileUnit::addDelta(DIE *Die, uin
/// addDIEEntry - Add a DIE attribute data and value.
///
-void CompileUnit::addDIEEntry(DIE *Die, uint16_t Attribute, uint16_t Form,
- DIE *Entry) {
- Die->addValue(Attribute, Form, createDIEEntry(Entry));
+void CompileUnit::addDIEEntry(DIE *Die, uint16_t Attribute, DIE *Entry) {
+ // We currently only use ref4.
+ Die->addValue(Attribute, dwarf::DW_FORM_ref4, createDIEEntry(Entry));
}
/// addBlock - Add block data.
@@ -982,7 +982,7 @@ void CompileUnit::constructTypeDIE(DIE &
addUInt(&Buffer, dwarf::DW_AT_byte_size, 0, Size);
if (Tag == dwarf::DW_TAG_ptr_to_member_type)
- addDIEEntry(&Buffer, dwarf::DW_AT_containing_type, dwarf::DW_FORM_ref4,
+ addDIEEntry(&Buffer, dwarf::DW_AT_containing_type,
getOrCreateTypeDIE(resolve(DTy.getClassType())));
// Add source line info if available and TyDesc is not a forward declaration.
if (!DTy.isForwardDecl())
@@ -1162,7 +1162,7 @@ void CompileUnit::constructTypeDIE(DIE &
DICompositeType ContainingType(resolve(CTy.getContainingType()));
if (DIDescriptor(ContainingType).isCompositeType())
- addDIEEntry(&Buffer, dwarf::DW_AT_containing_type, dwarf::DW_FORM_ref4,
+ addDIEEntry(&Buffer, dwarf::DW_AT_containing_type,
getOrCreateTypeDIE(DIType(ContainingType)));
if (CTy.isObjcClassComplete())
@@ -1329,8 +1329,7 @@ DIE *CompileUnit::getOrCreateSubprogramD
// then there is no need to add other attributes.
if (DeclDie) {
// Refer function declaration directly.
- addDIEEntry(SPDie, dwarf::DW_AT_specification, dwarf::DW_FORM_ref4,
- DeclDie);
+ addDIEEntry(SPDie, dwarf::DW_AT_specification, DeclDie);
return SPDie;
}
@@ -1523,8 +1522,7 @@ void CompileUnit::createGlobalVariableDI
!GVContext.isFile() && !DD->isSubprogramContext(GVContext)) {
// Create specification DIE.
VariableSpecDIE = new DIE(dwarf::DW_TAG_variable);
- addDIEEntry(VariableSpecDIE, dwarf::DW_AT_specification,
- dwarf::DW_FORM_ref4, VariableDIE);
+ addDIEEntry(VariableSpecDIE, dwarf::DW_AT_specification, VariableDIE);
addBlock(VariableSpecDIE, dwarf::DW_AT_location, 0, Block);
// A static member's declaration is already flagged as such.
if (!SDMDecl.Verify())
@@ -1578,7 +1576,7 @@ void CompileUnit::createGlobalVariableDI
void CompileUnit::constructSubrangeDIE(DIE &Buffer, DISubrange SR,
DIE *IndexTy) {
DIE *DW_Subrange = new DIE(dwarf::DW_TAG_subrange_type);
- addDIEEntry(DW_Subrange, dwarf::DW_AT_type, dwarf::DW_FORM_ref4, IndexTy);
+ addDIEEntry(DW_Subrange, dwarf::DW_AT_type, IndexTy);
// The LowerBound value defines the lower bounds which is typically zero for
// C/C++. The Count value is the number of elements. Values are 64 bit. If
@@ -1654,7 +1652,7 @@ void CompileUnit::constructContainingTyp
if (!N) continue;
DIE *NDie = getDIE(N);
if (!NDie) continue;
- addDIEEntry(SPDie, dwarf::DW_AT_containing_type, dwarf::DW_FORM_ref4, NDie);
+ addDIEEntry(SPDie, dwarf::DW_AT_containing_type, NDie);
}
}
@@ -1668,8 +1666,7 @@ DIE *CompileUnit::constructVariableDIE(D
DbgVariable *AbsVar = DV->getAbstractVariable();
DIE *AbsDIE = AbsVar ? AbsVar->getDIE() : NULL;
if (AbsDIE)
- addDIEEntry(VariableDie, dwarf::DW_AT_abstract_origin,
- dwarf::DW_FORM_ref4, AbsDIE);
+ addDIEEntry(VariableDie, dwarf::DW_AT_abstract_origin, AbsDIE);
else {
if (!Name.empty())
addString(VariableDie, dwarf::DW_AT_name, Name);
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h?rev=192517&r1=192516&r2=192517&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h Fri Oct 11 18:58:05 2013
@@ -207,7 +207,7 @@ public:
/// addDIEEntry - Add a DIE attribute data and value.
///
- void addDIEEntry(DIE *Die, uint16_t Attribute, uint16_t Form, DIE *Entry);
+ void addDIEEntry(DIE *Die, uint16_t Attribute, DIE *Entry);
/// addBlock - Add block data.
///
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=192517&r1=192516&r2=192517&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Fri Oct 11 18:58:05 2013
@@ -382,8 +382,7 @@ DIE *DwarfDebug::updateSubprogramScopeDI
if (DIE *AbsSPDIE = AbstractSPDies.lookup(SPNode)) {
// Pick up abstract subprogram DIE.
SPDie = new DIE(dwarf::DW_TAG_subprogram);
- SPCU->addDIEEntry(SPDie, dwarf::DW_AT_abstract_origin,
- dwarf::DW_FORM_ref4, AbsSPDIE);
+ SPCU->addDIEEntry(SPDie, dwarf::DW_AT_abstract_origin, AbsSPDIE);
SPCU->addDie(SPDie);
} else {
DISubprogram SPDecl = SP.getFunctionDeclaration();
@@ -411,14 +410,12 @@ DIE *DwarfDebug::updateSubprogramScopeDI
if (ATy.isArtificial())
SPCU->addFlag(Arg, dwarf::DW_AT_artificial);
if (ATy.isObjectPointer())
- SPCU->addDIEEntry(SPDie, dwarf::DW_AT_object_pointer,
- dwarf::DW_FORM_ref4, Arg);
+ SPCU->addDIEEntry(SPDie, dwarf::DW_AT_object_pointer, Arg);
SPDie->addChild(Arg);
}
DIE *SPDeclDie = SPDie;
SPDie = new DIE(dwarf::DW_TAG_subprogram);
- SPCU->addDIEEntry(SPDie, dwarf::DW_AT_specification,
- dwarf::DW_FORM_ref4, SPDeclDie);
+ SPCU->addDIEEntry(SPDie, dwarf::DW_AT_specification, SPDeclDie);
SPCU->addDie(SPDie);
}
}
@@ -528,8 +525,7 @@ DIE *DwarfDebug::constructInlinedScopeDI
}
DIE *ScopeDIE = new DIE(dwarf::DW_TAG_inlined_subroutine);
- TheCU->addDIEEntry(ScopeDIE, dwarf::DW_AT_abstract_origin,
- dwarf::DW_FORM_ref4, OriginDIE);
+ TheCU->addDIEEntry(ScopeDIE, dwarf::DW_AT_abstract_origin, OriginDIE);
if (Ranges.size() > 1) {
// .debug_range section has not been laid out yet. Emit offset in
@@ -674,8 +670,7 @@ DIE *DwarfDebug::constructScopeDIE(Compi
ScopeDIE->addChild(*I);
if (DS.isSubprogram() && ObjectPointer != NULL)
- TheCU->addDIEEntry(ScopeDIE, dwarf::DW_AT_object_pointer,
- dwarf::DW_FORM_ref4, ObjectPointer);
+ TheCU->addDIEEntry(ScopeDIE, dwarf::DW_AT_object_pointer, ObjectPointer);
if (DS.isSubprogram())
TheCU->addPubTypes(DISubprogram(DS));
@@ -893,8 +888,7 @@ void DwarfDebug::constructImportedEntity
TheCU->getUniqueID());
TheCU->addUInt(IMDie, dwarf::DW_AT_decl_file, 0, FileID);
TheCU->addUInt(IMDie, dwarf::DW_AT_decl_line, 0, Module.getLineNumber());
- TheCU->addDIEEntry(IMDie, dwarf::DW_AT_import, dwarf::DW_FORM_ref4,
- EntityDie);
+ TheCU->addDIEEntry(IMDie, dwarf::DW_AT_import, EntityDie);
StringRef Name = Module.getName();
if (!Name.empty())
TheCU->addString(IMDie, dwarf::DW_AT_name, Name);
More information about the llvm-commits
mailing list