Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[lldb] Fix calls to Type::getInt8PtrTy #71561

Merged
merged 1 commit into from Nov 7, 2023
Merged

[lldb] Fix calls to Type::getInt8PtrTy #71561

merged 1 commit into from Nov 7, 2023

Conversation

pmatos
Copy link
Contributor

@pmatos pmatos commented Nov 7, 2023

These have been removed in 7b9d73c. This is a followup patch to apply the changes to lldb.

These have been removed in 7b9d73c.
This is a followup patch to apply the changes to lldb.
@pmatos pmatos requested a review from dtcxzyw November 7, 2023 17:28
@pmatos pmatos self-assigned this Nov 7, 2023
@llvmbot llvmbot added the lldb label Nov 7, 2023
@llvmbot
Copy link
Collaborator

llvmbot commented Nov 7, 2023

@llvm/pr-subscribers-lldb

Author: Paulo Matos (pmatos)

Changes

These have been removed in 7b9d73c. This is a followup patch to apply the changes to lldb.


Full diff: https://github.com/llvm/llvm-project/pull/71561.diff

2 Files Affected:

  • (modified) lldb/source/Plugins/ExpressionParser/Clang/IRDynamicChecks.cpp (+1-1)
  • (modified) lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp (+3-3)
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/IRDynamicChecks.cpp b/lldb/source/Plugins/ExpressionParser/Clang/IRDynamicChecks.cpp
index cd7d1ff6148b3b7..bc0f5993aad0d6a 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/IRDynamicChecks.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/IRDynamicChecks.cpp
@@ -273,7 +273,7 @@ class Instrumenter {
 
   PointerType *GetI8PtrTy() {
     if (!m_i8ptr_ty)
-      m_i8ptr_ty = llvm::Type::getInt8PtrTy(m_module.getContext());
+      m_i8ptr_ty = llvm::PointerType::getUnqual(m_module.getContext());
 
     return m_i8ptr_ty;
   }
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp b/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp
index 81bb0e73e91f9f9..33e5dd0015aebf8 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp
@@ -404,7 +404,7 @@ bool IRForTarget::RewriteObjCConstString(llvm::GlobalVariable *ns_str,
 
   Type *ns_str_ty = ns_str->getType();
 
-  Type *i8_ptr_ty = Type::getInt8PtrTy(m_module->getContext());
+  Type *i8_ptr_ty = PointerType::getUnqual(m_module->getContext());
   Type *i32_ty = Type::getInt32Ty(m_module->getContext());
   Type *i8_ty = Type::getInt8Ty(m_module->getContext());
 
@@ -801,11 +801,11 @@ bool IRForTarget::RewriteObjCSelector(Instruction *selector_load) {
     // is uint8_t*
     // Type *sel_type = StructType::get(m_module->getContext());
     // Type *sel_ptr_type = PointerType::getUnqual(sel_type);
-    Type *sel_ptr_type = Type::getInt8PtrTy(m_module->getContext());
+    Type *sel_ptr_type = PointerType::getUnqual(m_module->getContext());
 
     Type *type_array[1];
 
-    type_array[0] = llvm::Type::getInt8PtrTy(m_module->getContext());
+    type_array[0] = llvm::PointerType::getUnqual(m_module->getContext());
 
     ArrayRef<Type *> srN_arg_types(type_array, 1);
 

Copy link
Member

@dtcxzyw dtcxzyw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
BTW, I found other uses of Type::getInt8PtrTy in llvm-project/llvm/include/llvm/ProfileData/InstrProfData.inc and llvm-project/compiler-rt/include/profile/InstrProfData.inc.

@pmatos
Copy link
Contributor Author

pmatos commented Nov 7, 2023

LGTM. BTW, I found other uses of Type::getInt8PtrTy in llvm-project/llvm/include/llvm/ProfileData/InstrProfData.inc and llvm-project/compiler-rt/include/profile/InstrProfData.inc.

Thanks, will fix those separately. Lets get lldb to build.

@pmatos pmatos merged commit 3267cd3 into llvm:main Nov 7, 2023
4 checks passed
@pmatos pmatos deleted the LLDBFix branch November 7, 2023 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants