Skip to content

[SandboxIR] Remove sandboxir::PointerType::get(Type) #123885

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions llvm/include/llvm/SandboxIR/Type.h
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,6 @@ class PointerType : public Type {
public:
// TODO: add missing functions

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

static bool classof(const Type *From) {
Expand Down
4 changes: 0 additions & 4 deletions llvm/lib/SandboxIR/Type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ void Type::dump() {
}
#endif

PointerType *PointerType::get(Type *ElementType, unsigned AddressSpace) {
return get(ElementType->getContext(), AddressSpace);
}

PointerType *PointerType::get(Context &Ctx, unsigned AddressSpace) {
return cast<PointerType>(
Ctx.getType(llvm::PointerType::get(Ctx.LLVMCtx, AddressSpace)));
Expand Down
4 changes: 2 additions & 2 deletions llvm/unittests/SandboxIR/SandboxIRTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5150,8 +5150,8 @@ define void @foo(i32 %arg, float %farg, double %darg, ptr %ptr) {
auto *Ti16 = sandboxir::Type::getInt16Ty(Ctx);
auto *Tdouble = sandboxir::Type::getDoubleTy(Ctx);
auto *Tfloat = sandboxir::Type::getFloatTy(Ctx);
auto *Tptr = sandboxir::PointerType::get(Tfloat, 0);
auto *Tptr1 = sandboxir::PointerType::get(Tfloat, 1);
auto *Tptr = sandboxir::PointerType::get(Ctx, 0);
auto *Tptr1 = sandboxir::PointerType::get(Ctx, 1);

// Check classof(), getOpcode(), getSrcTy(), getDstTy()
auto *ZExt = cast<sandboxir::CastInst>(&*It++);
Expand Down
4 changes: 0 additions & 4 deletions llvm/unittests/SandboxIR/TypesTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,6 @@ define void @foo(ptr %ptr) {
auto *F = Ctx.createFunction(LLVMF);
// Check classof(), creation.
auto *PtrTy = cast<sandboxir::PointerType>(F->getArg(0)->getType());
// Check get(ElementType, AddressSpace).
auto *NewPtrTy =
sandboxir::PointerType::get(sandboxir::Type::getInt32Ty(Ctx), 0u);
EXPECT_EQ(NewPtrTy, PtrTy);
// Check get(Ctx, AddressSpace).
auto *NewPtrTy2 = sandboxir::PointerType::get(Ctx, 0u);
EXPECT_EQ(NewPtrTy2, PtrTy);
Expand Down
Loading