From db7d874b712d173b50b5644bd3c5648de1bb39ca Mon Sep 17 00:00:00 2001 From: Raphael Isemann Date: Fri, 9 Aug 2019 14:21:27 +0000 Subject: [PATCH] [lldb][NFC] Remove unused IRForTarget::BuildRelocation llvm-svn: 368442 --- .../ExpressionParser/Clang/IRForTarget.cpp | 22 ------------------- .../ExpressionParser/Clang/IRForTarget.h | 14 ------------ 2 files changed, 36 deletions(-) diff --git a/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp b/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp index 33b3dead0a45..8b526dea5792 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp @@ -1896,28 +1896,6 @@ bool IRForTarget::ReplaceVariables(Function &llvm_function) { return true; } -llvm::Constant *IRForTarget::BuildRelocation(llvm::Type *type, - uint64_t offset) { - llvm::Constant *offset_int = ConstantInt::get(m_intptr_ty, offset); - - llvm::Constant *offset_array[1]; - - offset_array[0] = offset_int; - - llvm::ArrayRef offsets(offset_array, 1); - llvm::Type *char_type = llvm::Type::getInt8Ty(m_module->getContext()); - llvm::Type *char_pointer_type = char_type->getPointerTo(); - - llvm::Constant *reloc_placeholder_bitcast = - ConstantExpr::getBitCast(m_reloc_placeholder, char_pointer_type); - llvm::Constant *reloc_getelementptr = ConstantExpr::getGetElementPtr( - char_type, reloc_placeholder_bitcast, offsets); - llvm::Constant *reloc_bitcast = - ConstantExpr::getBitCast(reloc_getelementptr, type); - - return reloc_bitcast; -} - bool IRForTarget::runOnModule(Module &llvm_module) { lldb_private::Log *log( lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS)); diff --git a/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.h b/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.h index f87fd8ac32cb..5f484bdadd07 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.h +++ b/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.h @@ -539,20 +539,6 @@ private: FunctionValueCache &entry_instruction_finder, lldb_private::Stream &error_stream); - /// Construct a reference to m_reloc_placeholder with a given type and - /// offset. This typically happens after inserting data into - /// m_data_allocator. - /// - /// \param[in] type - /// The type of the value being loaded. - /// - /// \param[in] offset - /// The offset of the value from the base of m_data_allocator. - /// - /// \return - /// The Constant for the reference, usually a ConstantExpr. - llvm::Constant *BuildRelocation(llvm::Type *type, uint64_t offset); - /// Commit the allocation in m_data_allocator and use its final location to /// replace m_reloc_placeholder. /// -- 2.34.1