Skip to content

Commit

Permalink
removes interfaces for get_member
Browse files Browse the repository at this point in the history
  • Loading branch information
gitoleg committed Jun 5, 2024
1 parent 0bfffdc commit 65cf0b1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 20 deletions.
2 changes: 1 addition & 1 deletion clang/include/clang/CIR/Dialect/IR/CIROps.td
Original file line number Diff line number Diff line change
Expand Up @@ -2204,7 +2204,7 @@ def GetBitfieldOp : CIR_Op<"get_bitfield"> {
// GetMemberOp
//===----------------------------------------------------------------------===//

def GetMemberOp : CIR_Op<"get_member", [DeclareOpInterfaceMethods<PromotableOpInterface>] > {
def GetMemberOp : CIR_Op<"get_member"> {
let summary = "Get the address of a member of a struct";
let description = [{
The `cir.get_member` operation gets the address of a particular named
Expand Down
19 changes: 0 additions & 19 deletions clang/lib/CIR/Dialect/IR/CIRMemorySlot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,25 +154,6 @@ bool cir::CopyOp::canUsesBeRemoved(
return getLength() == dataLayout.getTypeSize(slot.elemType);
}

//===----------------------------------------------------------------------===//
// Interfaces for GetMemberOp
//===----------------------------------------------------------------------===//

bool cir::GetMemberOp::canUsesBeRemoved(
const SmallPtrSetImpl<OpOperand *> &blockingUses,
SmallVectorImpl<OpOperand *> &newBlockingUses,
const DataLayout &dataLayout) {
// GetMemberOp can be removed as long as it is a no-op and its users can be removed.
if (getIndex() != 0)
return false;
return forwardToUsers(*this, newBlockingUses);
}

DeletionKind cir::GetMemberOp::removeBlockingUses(
const SmallPtrSetImpl<OpOperand *> &blockingUses, RewriterBase &rewriter) {
return DeletionKind::Delete;
}

//===----------------------------------------------------------------------===//
// Interfaces for CastOp
//===----------------------------------------------------------------------===//
Expand Down

0 comments on commit 65cf0b1

Please sign in to comment.