From: Adrian Prantl Date: Thu, 12 Oct 2017 22:54:36 +0000 (+0000) Subject: Deprecate DwarfUnit::addBlockByrefAddress(). X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=355469048133e9dee40631c8772ceb61e4496490;p=llvm Deprecate DwarfUnit::addBlockByrefAddress(). The clang frontend already creates a DIExpression that replicates the logic in addBlockByrefAddress() exactly, thus making this function effectively unreachable. To guard against human error I'm hereby marking the function with an assertion and let it hit the bots before eventually removing it. rdar://problem/31629055 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315636 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index 8b732765bf3..06b5b06c41b 100644 --- a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -810,6 +810,12 @@ void DwarfCompileUnit::addGlobalTypeUnitType(const DIType *Ty, /// DbgVariable based on provided MachineLocation. void DwarfCompileUnit::addVariableAddress(const DbgVariable &DV, DIE &Die, MachineLocation Location) { + // addBlockByrefAddress is obsolete and will be removed soon. + // The clang frontend always generates block byref variables with a + // complex expression that encodes exactly what addBlockByrefAddress + // would do. + assert((!DV.isBlockByrefVariable() || DV.hasComplexAddress()) && + "block byref variable without a complex expression"); if (DV.hasComplexAddress()) addComplexAddress(DV, Die, dwarf::DW_AT_location, Location); else if (DV.isBlockByrefVariable())