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));
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.
///