[Lldb-commits] [lldb] r165754 - in /lldb/trunk/source/Expression: IRDynamicChecks.cpp IRForTarget.cpp IRInterpreter.cpp

Sean Callanan scallanan at apple.com
Thu Oct 11 15:00:52 PDT 2012


Author: spyffe
Date: Thu Oct 11 17:00:52 2012
New Revision: 165754

URL: http://llvm.org/viewvc/llvm-project?rev=165754&view=rev
Log:
Fixed the IR interaction layer to deal with a
change in the LLDB target data API.

Modified:
    lldb/trunk/source/Expression/IRDynamicChecks.cpp
    lldb/trunk/source/Expression/IRForTarget.cpp
    lldb/trunk/source/Expression/IRInterpreter.cpp

Modified: lldb/trunk/source/Expression/IRDynamicChecks.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRDynamicChecks.cpp?rev=165754&r1=165753&r2=165754&view=diff
==============================================================================
--- lldb/trunk/source/Expression/IRDynamicChecks.cpp (original)
+++ lldb/trunk/source/Expression/IRDynamicChecks.cpp Thu Oct 11 17:00:52 2012
@@ -280,7 +280,7 @@
     llvm::Value *BuildPointerValidatorFunc(lldb::addr_t start_address)
     {
         IntegerType *intptr_ty = llvm::Type::getIntNTy(m_module.getContext(),
-                                                             (m_module.getPointerSize(0) == llvm::Module::Pointer64) ? 64 : 32);
+                                                             (m_module.getPointerSize() == llvm::Module::Pointer64) ? 64 : 32);
         
         llvm::Type *param_array[1];
         
@@ -307,7 +307,7 @@
     llvm::Value *BuildObjectCheckerFunc(lldb::addr_t start_address)
     {
         IntegerType *intptr_ty = llvm::Type::getIntNTy(m_module.getContext(),
-                                                       (m_module.getPointerSize(0) == llvm::Module::Pointer64) ? 64 : 32);
+                                                       (m_module.getPointerSize() == llvm::Module::Pointer64) ? 64 : 32);
         
         llvm::Type *param_array[2];
         

Modified: lldb/trunk/source/Expression/IRForTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRForTarget.cpp?rev=165754&r1=165753&r2=165754&view=diff
==============================================================================
--- lldb/trunk/source/Expression/IRForTarget.cpp (original)
+++ lldb/trunk/source/Expression/IRForTarget.cpp Thu Oct 11 17:00:52 2012
@@ -300,9 +300,8 @@
 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 @@
     
     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 @@
         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 @@
         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 @@
         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 @@
 {
     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 @@
     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()));

Modified: lldb/trunk/source/Expression/IRInterpreter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRInterpreter.cpp?rev=165754&r1=165753&r2=165754&view=diff
==============================================================================
--- lldb/trunk/source/Expression/IRInterpreter.cpp (original)
+++ lldb/trunk/source/Expression/IRInterpreter.cpp Thu Oct 11 17:00:52 2012
@@ -425,7 +425,7 @@
         m_decl_map (decl_map)
     {
         m_byte_order = (target_data.isLittleEndian() ? lldb::eByteOrderLittle : lldb::eByteOrderBig);
-        m_addr_byte_size = (target_data.getPointerSize());
+        m_addr_byte_size = (target_data.getPointerSize(0));
     }
     
     void Jump (const BasicBlock *bb)
@@ -1042,7 +1042,7 @@
     }
     
     DataLayout target_data(&llvm_module);
-    if (target_data.getPointerSize() != target_info.address_byte_size)
+    if (target_data.getPointerSize(0) != target_info.address_byte_size)
     {
         err.SetErrorToGenericError();
         err.SetErrorString(interpreter_initialization_error);





More information about the lldb-commits mailing list