Skip to content

[lldb] Prefer PointerType::get with LLVMContext over Type (NFC) #133869

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ class Instrumenter {

FunctionType *fun_ty = FunctionType::get(
llvm::Type::getVoidTy(m_module.getContext()), params, true);
PointerType *fun_ptr_ty = PointerType::getUnqual(fun_ty);
PointerType *fun_ptr_ty = PointerType::getUnqual(m_module.getContext());
Constant *fun_addr_int =
ConstantInt::get(GetIntptrTy(), start_address, false);
return {fun_ty, ConstantExpr::getIntToPtr(fun_addr_int, fun_ptr_ty)};
Expand All @@ -264,7 +264,7 @@ class Instrumenter {

FunctionType *fun_ty = FunctionType::get(
llvm::Type::getVoidTy(m_module.getContext()), params, true);
PointerType *fun_ptr_ty = PointerType::getUnqual(fun_ty);
PointerType *fun_ptr_ty = PointerType::getUnqual(m_module.getContext());
Constant *fun_addr_int =
ConstantInt::get(GetIntptrTy(), start_address, false);
return {fun_ty, ConstantExpr::getIntToPtr(fun_addr_int, fun_ptr_ty)};
Expand Down
6 changes: 3 additions & 3 deletions lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ bool IRForTarget::RewriteObjCConstString(llvm::GlobalVariable *ns_str,
FunctionType::get(ns_str_ty, CFSCWB_arg_types, false);

// Build the constant containing the pointer to the function
PointerType *CFSCWB_ptr_ty = PointerType::getUnqual(CFSCWB_ty);
PointerType *CFSCWB_ptr_ty = PointerType::getUnqual(m_module->getContext());
Constant *CFSCWB_addr_int =
ConstantInt::get(m_intptr_ty, CFStringCreateWithBytes_addr, false);
m_CFStringCreateWithBytes = {
Expand Down Expand Up @@ -814,7 +814,7 @@ bool IRForTarget::RewriteObjCSelector(Instruction *selector_load) {
FunctionType::get(sel_ptr_type, srN_arg_types, false);

// Build the constant containing the pointer to the function
PointerType *srN_ptr_ty = PointerType::getUnqual(srN_type);
PointerType *srN_ptr_ty = PointerType::getUnqual(m_module->getContext());
Constant *srN_addr_int =
ConstantInt::get(m_intptr_ty, sel_registerName_addr, false);
m_sel_registerName = {srN_type,
Expand Down Expand Up @@ -1031,7 +1031,7 @@ bool IRForTarget::MaybeHandleVariable(Value *llvm_value_ptr) {
//
// We also do this for any user-declared persistent variables.
compiler_type = compiler_type.GetPointerType();
value_type = PointerType::get(global_variable->getType(), 0);
value_type = PointerType::getUnqual(global_variable->getContext());
} else {
value_type = global_variable->getType();
}
Expand Down