aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Transforms/Utils/CloningTest.cpp
diff options
context:
space:
mode:
authorBjorn Pettersson <bjorn.a.pettersson@ericsson.com>2023-07-31 16:32:44 +0200
committerBjorn Pettersson <bjorn.a.pettersson@ericsson.com>2023-08-02 12:08:37 +0200
commitfd05c34b18fbc3f37494bef9118c368f0c11595a (patch)
tree97a28f8b1c4742e1bc5f775e374763edab2446a2 /llvm/unittests/Transforms/Utils/CloningTest.cpp
parentf40af3b351a9f282edd414d2ebf20a9fcd74d8f1 (diff)
downloadllvm-fd05c34b18fbc3f37494bef9118c368f0c11595a.zip
llvm-fd05c34b18fbc3f37494bef9118c368f0c11595a.tar.gz
llvm-fd05c34b18fbc3f37494bef9118c368f0c11595a.tar.bz2
Stop using legacy helpers indicating typed pointer types. NFC
Since we no longer support typed LLVM IR pointer types, the code can be simplified into for example using PointerType::get directly instead of using Type::getInt8PtrTy and Type::getInt32PtrTy etc. Differential Revision: https://reviews.llvm.org/D156733
Diffstat (limited to 'llvm/unittests/Transforms/Utils/CloningTest.cpp')
-rw-r--r--llvm/unittests/Transforms/Utils/CloningTest.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/llvm/unittests/Transforms/Utils/CloningTest.cpp b/llvm/unittests/Transforms/Utils/CloningTest.cpp
index d5cd285..01ad41f 100644
--- a/llvm/unittests/Transforms/Utils/CloningTest.cpp
+++ b/llvm/unittests/Transforms/Utils/CloningTest.cpp
@@ -137,7 +137,7 @@ TEST_F(CloneInstruction, OverflowBits) {
}
TEST_F(CloneInstruction, Inbounds) {
- V = new Argument(Type::getInt32PtrTy(context));
+ V = new Argument(PointerType::get(context, 0));
Constant *Z = Constant::getNullValue(Type::getInt32Ty(context));
std::vector<Value *> ops;
@@ -161,8 +161,9 @@ TEST_F(CloneInstruction, Exact) {
}
TEST_F(CloneInstruction, Attributes) {
- Type *ArgTy1[] = { Type::getInt32PtrTy(context) };
- FunctionType *FT1 = FunctionType::get(Type::getVoidTy(context), ArgTy1, false);
+ Type *ArgTy1[] = {PointerType::get(context, 0)};
+ FunctionType *FT1 =
+ FunctionType::get(Type::getVoidTy(context), ArgTy1, false);
Function *F1 = Function::Create(FT1, Function::ExternalLinkage);
BasicBlock *BB = BasicBlock::Create(context, "", F1);
@@ -187,8 +188,9 @@ TEST_F(CloneInstruction, Attributes) {
}
TEST_F(CloneInstruction, CallingConvention) {
- Type *ArgTy1[] = { Type::getInt32PtrTy(context) };
- FunctionType *FT1 = FunctionType::get(Type::getVoidTy(context), ArgTy1, false);
+ Type *ArgTy1[] = {PointerType::get(context, 0)};
+ FunctionType *FT1 =
+ FunctionType::get(Type::getVoidTy(context), ArgTy1, false);
Function *F1 = Function::Create(FT1, Function::ExternalLinkage);
F1->setCallingConv(CallingConv::Cold);
@@ -211,7 +213,7 @@ TEST_F(CloneInstruction, CallingConvention) {
}
TEST_F(CloneInstruction, DuplicateInstructionsToSplit) {
- Type *ArgTy1[] = {Type::getInt32PtrTy(context)};
+ Type *ArgTy1[] = {PointerType::get(context, 0)};
FunctionType *FT = FunctionType::get(Type::getVoidTy(context), ArgTy1, false);
V = new Argument(Type::getInt32Ty(context));
@@ -260,7 +262,7 @@ TEST_F(CloneInstruction, DuplicateInstructionsToSplit) {
}
TEST_F(CloneInstruction, DuplicateInstructionsToSplitBlocksEq1) {
- Type *ArgTy1[] = {Type::getInt32PtrTy(context)};
+ Type *ArgTy1[] = {PointerType::get(context, 0)};
FunctionType *FT = FunctionType::get(Type::getVoidTy(context), ArgTy1, false);
V = new Argument(Type::getInt32Ty(context));
@@ -313,7 +315,7 @@ TEST_F(CloneInstruction, DuplicateInstructionsToSplitBlocksEq1) {
}
TEST_F(CloneInstruction, DuplicateInstructionsToSplitBlocksEq2) {
- Type *ArgTy1[] = {Type::getInt32PtrTy(context)};
+ Type *ArgTy1[] = {PointerType::get(context, 0)};
FunctionType *FT = FunctionType::get(Type::getVoidTy(context), ArgTy1, false);
V = new Argument(Type::getInt32Ty(context));