summaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-11-16 00:29:01 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-11-16 00:29:01 +0000
commit1dc27239969889661115f40b293c83ab9ff3efd5 (patch)
treed7988663dbec188d13e402e49b520ce8499595d7 /lib/CodeGen
parent21c9708c0909a4373d04f0910ab0cb05b94f25ef (diff)
downloadllvm-1dc27239969889661115f40b293c83ab9ff3efd5.tar.gz
llvm-1dc27239969889661115f40b293c83ab9ff3efd5.tar.bz2
llvm-1dc27239969889661115f40b293c83ab9ff3efd5.tar.xz
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
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp8
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfCompileUnit.h2
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
index d5eb8f397d..cb0e89977c 100644
--- a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
@@ -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
/// 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);
Parent.addChild(Die);
- if (MD)
- insertDIE(DIDescriptor(MD), Die);
+ if (N)
+ insertDIE(N, Die);
return Die;
}
@@ -1541,7 +1541,7 @@ void CompileUnit::createGlobalVariableDIE(const MDNode *N) {
DIE *ContextDIE = getOrCreateContextDIE(GVContext);
// Add to map.
- VariableDIE = createAndAddDIE(GV.getTag(), *ContextDIE, N);
+ VariableDIE = createAndAddDIE(GV.getTag(), *ContextDIE, GV);
// Add name and type.
addString(VariableDIE, dwarf::DW_AT_name, GV.getDisplayName());
diff --git a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
index 059f2be210..884e51a7ef 100644
--- a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
+++ b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
@@ -321,7 +321,7 @@ public:
/// Create a DIE with the given Tag, add the DIE to its parent, and
/// 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
/// length field.