[lldb][NFC] Remove unused IRForTarget::BuildRelocation

llvm-svn: 368442
This commit is contained in:
Raphael Isemann 2019-08-09 14:21:27 +00:00
parent 6349ce5ca5
commit db7d874b71
2 changed files with 0 additions and 36 deletions

View File

@ -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<llvm::Constant *> 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));

View File

@ -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.
///