Skip to content
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
4 changes: 4 additions & 0 deletions llvm/include/llvm/SandboxIR/SandboxIR.h
Original file line number Diff line number Diff line change
Expand Up @@ -2744,6 +2744,10 @@ class AtomicCmpXchgInst
AtomicOrdering SuccessOrdering, AtomicOrdering FailureOrdering,
BasicBlock *InsertAtEnd, Context &Ctx,
SyncScope::ID SSID = SyncScope::System, const Twine &Name = "");

static bool classof(const Value *From) {
return From->getSubclassID() == ClassID::AtomicCmpXchg;
}
};

class AllocaInst final : public UnaryInstruction {
Expand Down
7 changes: 7 additions & 0 deletions llvm/unittests/SandboxIR/SandboxIRTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4317,3 +4317,10 @@ define void @foo() {
EXPECT_EQ(NewUIEnd->getParent(), BB);
EXPECT_EQ(NewUIEnd->getNextNode(), nullptr);
}

/// Makes sure that all Instruction sub-classes have a classof().
TEST_F(SandboxIRTest, CheckClassof) {
#define DEF_INSTR(ID, OPC, CLASS) \
EXPECT_NE(&sandboxir::CLASS::classof, &sandboxir::Instruction::classof);
#include "llvm/SandboxIR/SandboxIRValues.def"
}
Loading