From 3e31f5eeb105539a137447f6b7c3914d304db008 Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Tue, 14 Apr 2015 01:59:58 +0000 Subject: [PATCH] DebugInfo: Inline DIVariable::isBlockByrefVariable() into its callers I don't think this API is helping much. Change the callers to call `MDType::isBlockByrefStruct()` directly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234837 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/IR/DebugInfo.h | 5 ----- lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 6 ++++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/include/llvm/IR/DebugInfo.h b/include/llvm/IR/DebugInfo.h index 462695b6c50..6eb37a07541 100644 --- a/include/llvm/IR/DebugInfo.h +++ b/include/llvm/IR/DebugInfo.h @@ -643,11 +643,6 @@ public: /// \brief If this variable is inlined then return inline location. MDNode *getInlinedAt() const { return get()->getInlinedAt(); } - /// \brief Check if this is a "__block" variable (Apple Blocks). - bool isBlockByrefVariable(const DITypeIdentifierMap &Map) const { - return (getType().resolve(Map)).isBlockByrefStruct(); - } - void printExtendedName(raw_ostream &OS) const; }; diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index a10ceefa4f6..53cd85532ae 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -135,14 +135,16 @@ template T DbgVariable::resolve(DIRef Ref) const { bool DbgVariable::isBlockByrefVariable() const { assert(Var && "Invalid complex DbgVariable!"); - return Var.isBlockByrefVariable(DD->getTypeIdentifierMap()); + return Var->getType() + .resolve(DD->getTypeIdentifierMap()) + ->isBlockByrefStruct(); } DIType DbgVariable::getType() const { DIType Ty = Var.getType().resolve(DD->getTypeIdentifierMap()); // FIXME: isBlockByrefVariable should be reformulated in terms of complex // addresses instead. - if (Var.isBlockByrefVariable(DD->getTypeIdentifierMap())) { + if (Ty->isBlockByrefStruct()) { /* Byref variables, in Blocks, are declared by the programmer as "SomeType VarName;", but the compiler creates a __Block_byref_x_VarName struct, and gives the variable VarName -- 2.34.1