Skip to content

Commit 830bd0e

Browse files
authored
[SandboxIR] Remove sandboxir::PointerType::get(Type) (#123885)
This was just an alias for getting the LLVM Context from the type. We are in the process of removing the same function for the regular LLVM type in #123569
1 parent a88f31d commit 830bd0e

File tree

4 files changed

+2
-12
lines changed

4 files changed

+2
-12
lines changed

llvm/include/llvm/SandboxIR/Type.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,6 @@ class PointerType : public Type {
292292
public:
293293
// TODO: add missing functions
294294

295-
// TODO: Remove non-opaque variant of sandboxir::PointerType::get
296-
static PointerType *get(Type *ElementType, unsigned AddressSpace);
297295
static PointerType *get(Context &Ctx, unsigned AddressSpace);
298296

299297
static bool classof(const Type *From) {

llvm/lib/SandboxIR/Type.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@ void Type::dump() {
4545
}
4646
#endif
4747

48-
PointerType *PointerType::get(Type *ElementType, unsigned AddressSpace) {
49-
return get(ElementType->getContext(), AddressSpace);
50-
}
51-
5248
PointerType *PointerType::get(Context &Ctx, unsigned AddressSpace) {
5349
return cast<PointerType>(
5450
Ctx.getType(llvm::PointerType::get(Ctx.LLVMCtx, AddressSpace)));

llvm/unittests/SandboxIR/SandboxIRTest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5150,8 +5150,8 @@ define void @foo(i32 %arg, float %farg, double %darg, ptr %ptr) {
51505150
auto *Ti16 = sandboxir::Type::getInt16Ty(Ctx);
51515151
auto *Tdouble = sandboxir::Type::getDoubleTy(Ctx);
51525152
auto *Tfloat = sandboxir::Type::getFloatTy(Ctx);
5153-
auto *Tptr = sandboxir::PointerType::get(Tfloat, 0);
5154-
auto *Tptr1 = sandboxir::PointerType::get(Tfloat, 1);
5153+
auto *Tptr = sandboxir::PointerType::get(Ctx, 0);
5154+
auto *Tptr1 = sandboxir::PointerType::get(Ctx, 1);
51555155

51565156
// Check classof(), getOpcode(), getSrcTy(), getDstTy()
51575157
auto *ZExt = cast<sandboxir::CastInst>(&*It++);

llvm/unittests/SandboxIR/TypesTest.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,10 +217,6 @@ define void @foo(ptr %ptr) {
217217
auto *F = Ctx.createFunction(LLVMF);
218218
// Check classof(), creation.
219219
auto *PtrTy = cast<sandboxir::PointerType>(F->getArg(0)->getType());
220-
// Check get(ElementType, AddressSpace).
221-
auto *NewPtrTy =
222-
sandboxir::PointerType::get(sandboxir::Type::getInt32Ty(Ctx), 0u);
223-
EXPECT_EQ(NewPtrTy, PtrTy);
224220
// Check get(Ctx, AddressSpace).
225221
auto *NewPtrTy2 = sandboxir::PointerType::get(Ctx, 0u);
226222
EXPECT_EQ(NewPtrTy2, PtrTy);

0 commit comments

Comments
 (0)