]> granicus.if.org Git - llvm/commitdiff
Deprecate DwarfUnit::addBlockByrefAddress().
authorAdrian Prantl <aprantl@apple.com>
Thu, 12 Oct 2017 22:54:36 +0000 (22:54 +0000)
committerAdrian Prantl <aprantl@apple.com>
Thu, 12 Oct 2017 22:54:36 +0000 (22:54 +0000)
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

lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp

index 8b732765bf348235b1b08f3014acdfae2f8f3d9e..06b5b06c41bf38642dd2406640c1fe5de56bc35d 100644 (file)
@@ -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())