Skip to content

Commit d535554

Browse files
authored
[lldb] Prefer PointerType::get with LLVMContext over Type (NFC) (llvm#133869)
Part of llvm#123569
1 parent 07504af commit d535554

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lldb/source/Plugins/ExpressionParser/Clang/IRDynamicChecks.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ class Instrumenter {
240240

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

265265
FunctionType *fun_ty = FunctionType::get(
266266
llvm::Type::getVoidTy(m_module.getContext()), params, true);
267-
PointerType *fun_ptr_ty = PointerType::getUnqual(fun_ty);
267+
PointerType *fun_ptr_ty = PointerType::getUnqual(m_module.getContext());
268268
Constant *fun_addr_int =
269269
ConstantInt::get(GetIntptrTy(), start_address, false);
270270
return {fun_ty, ConstantExpr::getIntToPtr(fun_addr_int, fun_ptr_ty)};

lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ bool IRForTarget::RewriteObjCConstString(llvm::GlobalVariable *ns_str,
462462
FunctionType::get(ns_str_ty, CFSCWB_arg_types, false);
463463

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

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

0 commit comments

Comments
 (0)