summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
index 6334be5f027..355582298e5 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
@@ -704,7 +704,7 @@ DIE *DwarfUnit::createTypeDIE(const DICompositeType *Ty) {
return &TyDIE;
}
-DIE *DwarfUnit::getOrCreateTypeDIE(const MDNode *TyNode, DIE *ContextDIE) {
+DIE *DwarfUnit::getOrCreateTypeDIE(const MDNode *TyNode) {
if (!TyNode)
return nullptr;
@@ -714,20 +714,17 @@ DIE *DwarfUnit::getOrCreateTypeDIE(const MDNode *TyNode, DIE *ContextDIE) {
// DW_TAG_restrict_type is not supported in DWARF2
if (Ty->getTag() == dwarf::DW_TAG_restrict_type && DD->getDwarfVersion() <= 2)
- return getOrCreateTypeDIE(resolve(cast<DIDerivedType>(Ty)->getBaseType()),
- ContextDIE);
+ return getOrCreateTypeDIE(resolve(cast<DIDerivedType>(Ty)->getBaseType()));
// Construct the context before querying for the existence of the DIE in case
// such construction creates the DIE.
auto *Context = resolve(Ty->getScope());
- if (ContextDIE == nullptr)
- ContextDIE = getOrCreateContextDIE(Context);
+ DIE *ContextDIE = getOrCreateContextDIE(Context);
+ assert(ContextDIE);
if (DIE *TyDIE = getDIE(Ty))
return TyDIE;
- assert(ContextDIE);
-
// Create new type.
DIE &TyDIE = createAndAddDIE(Ty->getTag(), *ContextDIE, Ty);
OpenPOWER on IntegriCloud