summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression/IRForTarget.cpp
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2012-10-11 22:00:52 +0000
committerSean Callanan <scallanan@apple.com>2012-10-11 22:00:52 +0000
commit95769bf4899712e641fb52ac6965e520623009a7 (patch)
tree1259a8c8ddc6651b6b4a2cc4aa1257a6ed3b4ffb /lldb/source/Expression/IRForTarget.cpp
parent8c9e94119682db6ffbfe4b5803b40e9bf6525394 (diff)
downloadbcm5719-llvm-95769bf4899712e641fb52ac6965e520623009a7.tar.gz
bcm5719-llvm-95769bf4899712e641fb52ac6965e520623009a7.zip
Fixed the IR interaction layer to deal with a
change in the LLDB target data API. llvm-svn: 165754
Diffstat (limited to 'lldb/source/Expression/IRForTarget.cpp')
-rw-r--r--lldb/source/Expression/IRForTarget.cpp19
1 files changed, 7 insertions, 12 deletions
diff --git a/lldb/source/Expression/IRForTarget.cpp b/lldb/source/Expression/IRForTarget.cpp
index fa98eb251ac..02b901d469c 100644
--- a/lldb/source/Expression/IRForTarget.cpp
+++ b/lldb/source/Expression/IRForTarget.cpp
@@ -300,9 +300,8 @@ llvm::Constant *
IRForTarget::BuildFunctionPointer (llvm::Type *type,
uint64_t ptr)
{
- unsigned AS = type->isPointerTy() ? cast<PointerType>(type)->getAddressSpace: 0;
IntegerType *intptr_ty = Type::getIntNTy(m_module->getContext(),
- (m_module->getPointerSize(AS) == Module::Pointer64) ? 64 : 32);
+ (m_module->getPointerSize() == Module::Pointer64) ? 64 : 32);
PointerType *fun_ptr_ty = PointerType::getUnqual(type);
Constant *fun_addr_int = ConstantInt::get(intptr_ty, ptr, false);
return ConstantExpr::getIntToPtr(fun_addr_int, fun_ptr_ty);
@@ -841,7 +840,7 @@ IRForTarget::RewriteObjCConstString (llvm::GlobalVariable *ns_str,
Type *i8_ptr_ty = Type::getInt8PtrTy(m_module->getContext());
IntegerType *intptr_ty = Type::getIntNTy(m_module->getContext(),
- (m_module->getPointerSize(ns_str->getType()->getAddressSpace())
+ (m_module->getPointerSize()
== Module::Pointer64) ? 64 : 32);
Type *i32_ty = Type::getInt32Ty(m_module->getContext());
Type *i8_ty = Type::getInt8Ty(m_module->getContext());
@@ -1273,11 +1272,10 @@ IRForTarget::RewriteObjCSelector (Instruction* selector_load)
ArrayRef<Type *> srN_arg_types(type_array, 1);
llvm::Type *srN_type = FunctionType::get(sel_ptr_type, srN_arg_types, false);
- unsigned AS = srN_type->isPointerTy() ? cast<PointerType>(srN_type)->getAddressSpace() : 0;
// Build the constant containing the pointer to the function
IntegerType *intptr_ty = Type::getIntNTy(m_module->getContext(),
- (m_module->getPointerSize(AS) == Module::Pointer64) ? 64 : 32);
+ (m_module->getPointerSize() == Module::Pointer64) ? 64 : 32);
PointerType *srN_ptr_ty = PointerType::getUnqual(srN_type);
Constant *srN_addr_int = ConstantInt::get(intptr_ty, sel_registerName_addr, false);
m_sel_registerName = ConstantExpr::getIntToPtr(srN_addr_int, srN_ptr_ty);
@@ -1727,9 +1725,8 @@ IRForTarget::HandleSymbol (Value *symbol)
log->Printf("Found \"%s\" at 0x%llx", name.GetCString(), symbol_addr);
Type *symbol_type = symbol->getType();
- unsigned AS = symbol_type->isPointerTy() ? cast<PointerType>(symbol_type)->getAddressSpace() : 0;
IntegerType *intptr_ty = Type::getIntNTy(m_module->getContext(),
- (m_module->getPointerSize(AS) == Module::Pointer64) ? 64 : 32);
+ (m_module->getPointerSize() == Module::Pointer64) ? 64 : 32);
Constant *symbol_addr_int = ConstantInt::get(intptr_ty, symbol_addr, false);
@@ -1810,7 +1807,7 @@ IRForTarget::HandleObjCClass(Value *classlist_reference)
return false;
IntegerType *intptr_ty = Type::getIntNTy(m_module->getContext(),
- (m_module->getPointerSize(global_variable->getAddressSpace())
+ (m_module->getPointerSize()
== Module::Pointer64) ? 64 : 32);
Constant *class_addr = ConstantInt::get(intptr_ty, (uint64_t)class_ptr);
@@ -2581,9 +2578,8 @@ IRForTarget::BuildRelocation(llvm::Type *type,
{
lldb::LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS));
- unsigned AS = type->isPointerTy() ? cast<PointerType>(type)->getAddressSpace() : 0;
IntegerType *intptr_ty = Type::getIntNTy(m_module->getContext(),
- (m_module->getPointerSize(AS) == Module::Pointer64) ? 64 : 32);
+ (m_module->getPointerSize() == Module::Pointer64) ? 64 : 32);
llvm::Constant *offset_int = ConstantInt::get(intptr_ty, offset);
@@ -2623,9 +2619,8 @@ IRForTarget::CompleteDataAllocation ()
if (!allocation)
return false;
- unsigned AS = 0;
IntegerType *intptr_ty = Type::getIntNTy(m_module->getContext(),
- (m_module->getPointerSize(AS) == Module::Pointer64) ? 64 : 32);
+ (m_module->getPointerSize() == Module::Pointer64) ? 64 : 32);
Constant *relocated_addr = ConstantInt::get(intptr_ty, (uint64_t)allocation);
Constant *relocated_bitcast = ConstantExpr::getIntToPtr(relocated_addr, llvm::Type::getInt8PtrTy(m_module->getContext()));
OpenPOWER on IntegriCloud