Skip to content

Commit 7bb949e

Browse files
authored
[IR][unittests] Replace of PointerType::getUnqual(Type) with opaque version (NFC) (#123901)
Follow up to #123569
1 parent 047e8e4 commit 7bb949e

File tree

5 files changed

+10
-12
lines changed

5 files changed

+10
-12
lines changed

llvm/unittests/ExecutionEngine/Orc/IndirectionUtilsTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ TEST(IndirectionUtilsTest, MakeStub) {
1919
LLVMContext Context;
2020
ModuleBuilder MB(Context, "x86_64-apple-macosx10.10", "");
2121
StructType *ArgTy = getDummyStructTy(Context);
22-
Type *ArgPtrTy = PointerType::getUnqual(ArgTy);
22+
Type *ArgPtrTy = PointerType::getUnqual(Context);
2323
FunctionType *FTy = FunctionType::get(
2424
Type::getVoidTy(Context), {ArgPtrTy, ArgPtrTy}, false);
2525
Function *F = MB.createFunctionDecl(FTy, "");

llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3087,8 +3087,7 @@ TEST_F(OpenMPIRBuilderTest, CriticalDirective) {
30873087
EXPECT_EQ(CriticalEndCI->arg_size(), 3U);
30883088
EXPECT_TRUE(isa<GlobalVariable>(CriticalEndCI->getArgOperand(0)));
30893089
EXPECT_EQ(CriticalEndCI->getArgOperand(1), CriticalEntryCI->getArgOperand(1));
3090-
PointerType *CriticalNamePtrTy =
3091-
PointerType::getUnqual(ArrayType::get(Type::getInt32Ty(Ctx), 8));
3090+
PointerType *CriticalNamePtrTy = PointerType::getUnqual(Ctx);
30923091
EXPECT_EQ(CriticalEndCI->getArgOperand(2), CriticalEntryCI->getArgOperand(2));
30933092
GlobalVariable *GV =
30943093
dyn_cast<GlobalVariable>(CriticalEndCI->getArgOperand(2));

llvm/unittests/IR/ConstantsTest.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,9 @@ TEST(ConstantsTest, AsInstructionsTest) {
184184
Type *Int16Ty = Type::getInt16Ty(Context);
185185

186186
Constant *Global =
187-
M->getOrInsertGlobal("dummy", PointerType::getUnqual(Int32Ty));
187+
M->getOrInsertGlobal("dummy", PointerType::getUnqual(Context));
188188
Constant *Global2 =
189-
M->getOrInsertGlobal("dummy2", PointerType::getUnqual(Int32Ty));
189+
M->getOrInsertGlobal("dummy2", PointerType::getUnqual(Context));
190190

191191
Constant *P0 = ConstantExpr::getPtrToInt(Global, Int32Ty);
192192
Constant *P4 = ConstantExpr::getPtrToInt(Global2, Int32Ty);
@@ -222,7 +222,7 @@ TEST(ConstantsTest, AsInstructionsTest) {
222222
// not a normal one!
223223
// CHECK(ConstantExpr::getGetElementPtr(Global, V, false),
224224
// "getelementptr i32*, i32** @dummy, i32 1");
225-
CHECK(ConstantExpr::getInBoundsGetElementPtr(PointerType::getUnqual(Int32Ty),
225+
CHECK(ConstantExpr::getInBoundsGetElementPtr(PointerType::getUnqual(Context),
226226
Global, V),
227227
"getelementptr inbounds ptr, ptr @dummy, i32 1");
228228

@@ -250,9 +250,9 @@ TEST(ConstantsTest, ReplaceWithConstantTest) {
250250
Constant *One = ConstantInt::get(Int32Ty, 1);
251251

252252
Constant *Global =
253-
M->getOrInsertGlobal("dummy", PointerType::getUnqual(Int32Ty));
253+
M->getOrInsertGlobal("dummy", PointerType::getUnqual(Context));
254254
Constant *GEP = ConstantExpr::getGetElementPtr(
255-
PointerType::getUnqual(Int32Ty), Global, One);
255+
PointerType::getUnqual(Context), Global, One);
256256
EXPECT_DEATH(Global->replaceAllUsesWith(GEP),
257257
"this->replaceAllUsesWith\\(expr\\(this\\)\\) is NOT valid!");
258258
}

llvm/unittests/IR/InstructionsTest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -850,8 +850,8 @@ TEST(InstructionsTest, GEPIndices) {
850850
Builder.getInt32(13),
851851
Builder.getInt32(42) };
852852

853-
Value *V = Builder.CreateGEP(ArrTy, UndefValue::get(PointerType::getUnqual(ArrTy)),
854-
Indices);
853+
Value *V = Builder.CreateGEP(
854+
ArrTy, UndefValue::get(PointerType::getUnqual(Context)), Indices);
855855
ASSERT_TRUE(isa<GetElementPtrInst>(V));
856856

857857
auto *GEPI = cast<GetElementPtrInst>(V);

llvm/unittests/IR/PatternMatch.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2606,8 +2606,7 @@ TYPED_TEST(MutableConstTest, FCmp) {
26062606
}
26072607

26082608
TEST_F(PatternMatchTest, ConstExpr) {
2609-
Constant *G =
2610-
M->getOrInsertGlobal("dummy", PointerType::getUnqual(IRB.getInt32Ty()));
2609+
Constant *G = M->getOrInsertGlobal("dummy", PointerType::getUnqual(Ctx));
26112610
Constant *S = ConstantExpr::getPtrToInt(G, IRB.getInt32Ty());
26122611
Type *VecTy = FixedVectorType::get(IRB.getInt32Ty(), 2);
26132612
PoisonValue *P = PoisonValue::get(VecTy);

0 commit comments

Comments
 (0)