[llvm] 4b95806 - [llvm][unittests] Avoid Type::getPointerTo() (NFC)
Youngsuk Kim via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 30 10:07:20 PDT 2024
Author: Youngsuk Kim
Date: 2024-09-30T12:03:55-05:00
New Revision: 4b95806d49d812de708762dd411d4823eef5cbb6
URL: https://github.com/llvm/llvm-project/commit/4b95806d49d812de708762dd411d4823eef5cbb6
DIFF: https://github.com/llvm/llvm-project/commit/4b95806d49d812de708762dd411d4823eef5cbb6.diff
LOG: [llvm][unittests] Avoid Type::getPointerTo() (NFC)
`llvm::Type::getPointerTo()` is to be deprecated & removed soon.
Added:
Modified:
llvm/unittests/IR/VFABIDemanglerTest.cpp
Removed:
################################################################################
diff --git a/llvm/unittests/IR/VFABIDemanglerTest.cpp b/llvm/unittests/IR/VFABIDemanglerTest.cpp
index a9dd93a0c2b1b9..07bff16df49335 100644
--- a/llvm/unittests/IR/VFABIDemanglerTest.cpp
+++ b/llvm/unittests/IR/VFABIDemanglerTest.cpp
@@ -161,7 +161,7 @@ TEST_F(VFABIParserTest, ParamListParsing) {
Type::getVoidTy(Ctx),
{VectorType::get(Type::getInt32Ty(Ctx), ElementCount::getFixed(2)),
Type::getInt32Ty(Ctx), Type::getInt32Ty(Ctx),
- Type::getInt32Ty(Ctx)->getPointerTo(), Type::getInt32Ty(Ctx)},
+ PointerType::getUnqual(Ctx), Type::getInt32Ty(Ctx)},
false);
EXPECT_EQ(getFunctionType(), FTy);
EXPECT_EQ(Parameters.size(), (unsigned)5);
@@ -225,11 +225,11 @@ TEST_F(VFABIParserTest, Parse) {
Type::getInt32Ty(Ctx),
Type::getInt32Ty(Ctx),
Type::getInt32Ty(Ctx),
- Type::getInt32Ty(Ctx)->getPointerTo(),
+ PointerType::getUnqual(Ctx),
Type::getInt32Ty(Ctx),
Type::getInt32Ty(Ctx),
Type::getInt32Ty(Ctx),
- Type::getInt32Ty(Ctx)->getPointerTo(),
+ PointerType::getUnqual(Ctx),
},
false);
EXPECT_EQ(getFunctionType(), FTy);
@@ -265,11 +265,11 @@ TEST_F(VFABIParserTest, LinearWithCompileTimeNegativeStep) {
"void(i32, i32, i32, ptr)"));
EXPECT_EQ(ISA, VFISAKind::AdvancedSIMD);
EXPECT_FALSE(isMasked());
- FunctionType *FTy = FunctionType::get(
- Type::getVoidTy(Ctx),
- {Type::getInt32Ty(Ctx), Type::getInt32Ty(Ctx), Type::getInt32Ty(Ctx),
- Type::getInt32Ty(Ctx)->getPointerTo()},
- false);
+ FunctionType *FTy =
+ FunctionType::get(Type::getVoidTy(Ctx),
+ {Type::getInt32Ty(Ctx), Type::getInt32Ty(Ctx),
+ Type::getInt32Ty(Ctx), PointerType::getUnqual(Ctx)},
+ false);
EXPECT_EQ(getFunctionType(), FTy);
EXPECT_EQ(VF, ElementCount::getFixed(2));
EXPECT_EQ(Parameters.size(), (unsigned)4);
@@ -332,13 +332,13 @@ TEST_F(VFABIParserTest, LinearWithoutCompileTime) {
"void(i32, i32, ptr, i32, i32, i32, ptr, i32)"));
EXPECT_EQ(ISA, VFISAKind::AdvancedSIMD);
EXPECT_FALSE(isMasked());
- FunctionType *FTy = FunctionType::get(
- Type::getVoidTy(Ctx),
- {Type::getInt32Ty(Ctx), Type::getInt32Ty(Ctx),
- Type::getInt32Ty(Ctx)->getPointerTo(), Type::getInt32Ty(Ctx),
- Type::getInt32Ty(Ctx), Type::getInt32Ty(Ctx),
- Type::getInt32Ty(Ctx)->getPointerTo(), Type::getInt32Ty(Ctx)},
- false);
+ FunctionType *FTy =
+ FunctionType::get(Type::getVoidTy(Ctx),
+ {Type::getInt32Ty(Ctx), Type::getInt32Ty(Ctx),
+ PointerType::getUnqual(Ctx), Type::getInt32Ty(Ctx),
+ Type::getInt32Ty(Ctx), Type::getInt32Ty(Ctx),
+ PointerType::getUnqual(Ctx), Type::getInt32Ty(Ctx)},
+ false);
EXPECT_EQ(getFunctionType(), FTy);
EXPECT_EQ(Parameters.size(), (unsigned)8);
EXPECT_EQ(Parameters[0], VFParameter({0, VFParamKind::OMP_Linear, 1}));
@@ -423,7 +423,7 @@ TEST_F(VFABIParserTest, ISAIndependentMangling) {
Type::getVoidTy(Ctx),
{VectorType::get(Type::getInt32Ty(Ctx), ElementCount::getFixed(2)),
Type::getInt32Ty(Ctx), Type::getInt32Ty(Ctx), Type::getInt32Ty(Ctx),
- Type::getInt32Ty(Ctx)->getPointerTo(), Type::getInt32Ty(Ctx),
+ PointerType::getUnqual(Ctx), Type::getInt32Ty(Ctx),
Type::getInt32Ty(Ctx), Type::getInt32Ty(Ctx), Type::getInt32Ty(Ctx),
Type::getInt32Ty(Ctx)},
false);
@@ -692,8 +692,8 @@ TEST_F(VFABIParserTest, ParseScalableMaskingSVESincos) {
Type::getVoidTy(Ctx),
{
VectorType::get(Type::getDoubleTy(Ctx), ElementCount::getScalable(2)),
- Type::getInt32Ty(Ctx)->getPointerTo(),
- Type::getInt32Ty(Ctx)->getPointerTo(),
+ PointerType::getUnqual(Ctx),
+ PointerType::getUnqual(Ctx),
VectorType::get(Type::getInt1Ty(Ctx), ElementCount::getScalable(2)),
},
false);
More information about the llvm-commits
mailing list