mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-17 20:23:59 +00:00
DwarfCompileUnit: Push type safety of DIDescriptor through CompileUnit::createAndAddDIE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194902 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -296,11 +296,11 @@ void CompileUnit::addDIEEntry(DIE *Die, dwarf::Attribute Attribute,
|
|||||||
|
|
||||||
/// Create a DIE with the given Tag, add the DIE to its parent, and
|
/// Create a DIE with the given Tag, add the DIE to its parent, and
|
||||||
/// call insertDIE if MD is not null.
|
/// call insertDIE if MD is not null.
|
||||||
DIE *CompileUnit::createAndAddDIE(unsigned Tag, DIE &Parent, const MDNode *MD) {
|
DIE *CompileUnit::createAndAddDIE(unsigned Tag, DIE &Parent, DIDescriptor N) {
|
||||||
DIE *Die = new DIE(Tag);
|
DIE *Die = new DIE(Tag);
|
||||||
Parent.addChild(Die);
|
Parent.addChild(Die);
|
||||||
if (MD)
|
if (N)
|
||||||
insertDIE(DIDescriptor(MD), Die);
|
insertDIE(N, Die);
|
||||||
return Die;
|
return Die;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1541,7 +1541,7 @@ void CompileUnit::createGlobalVariableDIE(const MDNode *N) {
|
|||||||
DIE *ContextDIE = getOrCreateContextDIE(GVContext);
|
DIE *ContextDIE = getOrCreateContextDIE(GVContext);
|
||||||
|
|
||||||
// Add to map.
|
// Add to map.
|
||||||
VariableDIE = createAndAddDIE(GV.getTag(), *ContextDIE, N);
|
VariableDIE = createAndAddDIE(GV.getTag(), *ContextDIE, GV);
|
||||||
|
|
||||||
// Add name and type.
|
// Add name and type.
|
||||||
addString(VariableDIE, dwarf::DW_AT_name, GV.getDisplayName());
|
addString(VariableDIE, dwarf::DW_AT_name, GV.getDisplayName());
|
||||||
|
@ -321,7 +321,7 @@ public:
|
|||||||
|
|
||||||
/// Create a DIE with the given Tag, add the DIE to its parent, and
|
/// Create a DIE with the given Tag, add the DIE to its parent, and
|
||||||
/// call insertDIE if MD is not null.
|
/// call insertDIE if MD is not null.
|
||||||
DIE *createAndAddDIE(unsigned Tag, DIE &Parent, const MDNode *MD = NULL);
|
DIE *createAndAddDIE(unsigned Tag, DIE &Parent, DIDescriptor N = DIDescriptor());
|
||||||
|
|
||||||
/// Compute the size of a header for this unit, not including the initial
|
/// Compute the size of a header for this unit, not including the initial
|
||||||
/// length field.
|
/// length field.
|
||||||
|
Reference in New Issue
Block a user