Skip to content

Commit d03f417

Browse files
committed
[clang] Drop some references to typed pointers (getInt8PtrTy). NFC
Differential Revision: https://reviews.llvm.org/D157550
1 parent ad52c9c commit d03f417

File tree

6 files changed

+11
-12
lines changed

6 files changed

+11
-12
lines changed

clang/lib/CodeGen/CGBlocks.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,8 @@ static llvm::Constant *buildBlockDescriptor(CodeGenModule &CGM,
152152
cast<llvm::IntegerType>(CGM.getTypes().ConvertType(C.UnsignedLongTy));
153153
llvm::PointerType *i8p = nullptr;
154154
if (CGM.getLangOpts().OpenCL)
155-
i8p =
156-
llvm::Type::getInt8PtrTy(
157-
CGM.getLLVMContext(), C.getTargetAddressSpace(LangAS::opencl_constant));
155+
i8p = llvm::PointerType::get(
156+
CGM.getLLVMContext(), C.getTargetAddressSpace(LangAS::opencl_constant));
158157
else
159158
i8p = CGM.VoidPtrTy;
160159

clang/lib/CodeGen/CGBuiltin.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5010,7 +5010,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
50105010
unsigned NumArgs = E->getNumArgs();
50115011

50125012
llvm::Type *QueueTy = ConvertType(getContext().OCLQueueTy);
5013-
llvm::Type *GenericVoidPtrTy = Builder.getInt8PtrTy(
5013+
llvm::Type *GenericVoidPtrTy = Builder.getPtrTy(
50145014
getContext().getTargetAddressSpace(LangAS::opencl_generic));
50155015

50165016
llvm::Value *Queue = EmitScalarExpr(E->getArg(0));
@@ -5188,7 +5188,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
51885188
// OpenCL v2.0 s6.13.17.6 - Kernel query functions need bitcast of block
51895189
// parameter.
51905190
case Builtin::BIget_kernel_work_group_size: {
5191-
llvm::Type *GenericVoidPtrTy = Builder.getInt8PtrTy(
5191+
llvm::Type *GenericVoidPtrTy = Builder.getPtrTy(
51925192
getContext().getTargetAddressSpace(LangAS::opencl_generic));
51935193
auto Info =
51945194
CGM.getOpenCLRuntime().emitOpenCLEnqueuedBlock(*this, E->getArg(0));
@@ -5203,7 +5203,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
52035203
{Kernel, Arg}));
52045204
}
52055205
case Builtin::BIget_kernel_preferred_work_group_size_multiple: {
5206-
llvm::Type *GenericVoidPtrTy = Builder.getInt8PtrTy(
5206+
llvm::Type *GenericVoidPtrTy = Builder.getPtrTy(
52075207
getContext().getTargetAddressSpace(LangAS::opencl_generic));
52085208
auto Info =
52095209
CGM.getOpenCLRuntime().emitOpenCLEnqueuedBlock(*this, E->getArg(0));
@@ -5219,7 +5219,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
52195219
}
52205220
case Builtin::BIget_kernel_max_sub_group_size_for_ndrange:
52215221
case Builtin::BIget_kernel_sub_group_count_for_ndrange: {
5222-
llvm::Type *GenericVoidPtrTy = Builder.getInt8PtrTy(
5222+
llvm::Type *GenericVoidPtrTy = Builder.getPtrTy(
52235223
getContext().getTargetAddressSpace(LangAS::opencl_generic));
52245224
LValue NDRangeL = EmitAggExprToLValue(E->getArg(0));
52255225
llvm::Value *NDRange = NDRangeL.getAddress(*this).getPointer();

clang/lib/CodeGen/CGCoroutine.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ static void emitBodyAndFallthrough(CodeGenFunction &CGF,
594594
}
595595

596596
void CodeGenFunction::EmitCoroutineBody(const CoroutineBodyStmt &S) {
597-
auto *NullPtr = llvm::ConstantPointerNull::get(Builder.getInt8PtrTy());
597+
auto *NullPtr = llvm::ConstantPointerNull::get(Builder.getPtrTy());
598598
auto &TI = CGM.getContext().getTargetInfo();
599599
unsigned NewAlign = TI.getNewAlign() / TI.getCharWidth();
600600

@@ -783,7 +783,7 @@ RValue CodeGenFunction::EmitCoroutineIntrinsic(const CallExpr *E,
783783
}
784784
CGM.Error(E->getBeginLoc(), "this builtin expect that __builtin_coro_begin "
785785
"has been used earlier in this function");
786-
auto *NullPtr = llvm::ConstantPointerNull::get(Builder.getInt8PtrTy());
786+
auto *NullPtr = llvm::ConstantPointerNull::get(Builder.getPtrTy());
787787
return RValue::get(NullPtr);
788788
}
789789
case llvm::Intrinsic::coro_size: {

clang/lib/CodeGen/CGOpenCLRuntime.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ llvm::Value *CGOpenCLRuntime::getPipeElemAlign(const Expr *PipeArg) {
134134

135135
llvm::PointerType *CGOpenCLRuntime::getGenericVoidPointerType() {
136136
assert(CGM.getLangOpts().OpenCL);
137-
return llvm::IntegerType::getInt8PtrTy(
137+
return llvm::PointerType::get(
138138
CGM.getLLVMContext(),
139139
CGM.getContext().getTargetAddressSpace(LangAS::opencl_generic));
140140
}

clang/lib/CodeGen/CodeGenFunction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2504,7 +2504,7 @@ void CodeGenFunction::EmitVarAnnotations(const VarDecl *D, llvm::Value *V) {
25042504
// FIXME We create a new bitcast for every annotation because that's what
25052505
// llvm-gcc was doing.
25062506
unsigned AS = V->getType()->getPointerAddressSpace();
2507-
llvm::Type *I8PtrTy = Builder.getInt8PtrTy(AS);
2507+
llvm::Type *I8PtrTy = Builder.getPtrTy(AS);
25082508
for (const auto *I : D->specific_attrs<AnnotateAttr>())
25092509
EmitAnnotationCall(CGM.getIntrinsic(llvm::Intrinsic::var_annotation,
25102510
{I8PtrTy, CGM.ConstGlobalsPtrTy}),

clang/lib/CodeGen/CodeGenModule.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4500,7 +4500,7 @@ llvm::Constant *CodeGenModule::GetFunctionStart(const ValueDecl *Decl) {
45004500

45014501
return llvm::ConstantExpr::getBitCast(
45024502
llvm::NoCFIValue::get(F),
4503-
llvm::Type::getInt8PtrTy(VMContext, F->getAddressSpace()));
4503+
llvm::PointerType::get(VMContext, F->getAddressSpace()));
45044504
}
45054505

45064506
static const FunctionDecl *

0 commit comments

Comments
 (0)