[llvm] [SandboxIR][NFC] SingleLLVMInstructionImpl class (PR #102687)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 9 15:51:41 PDT 2024
================
@@ -713,27 +713,43 @@ class Instruction : public sandboxir::User {
#endif
};
-class SelectInst : public Instruction {
- /// Use Context::createSelectInst(). Don't call the
- /// constructor directly.
- SelectInst(llvm::SelectInst *CI, Context &Ctx)
- : Instruction(ClassID::Select, Opcode::Select, CI, Ctx) {}
- friend Context; // for SelectInst()
+/// Instructions that contain a single LLVM Instruction can inherit from this.
+class SingleLLVMInstructionImpl : public Instruction {
----------------
vporpo wrote:
`SingleLLVMInstructionImpl` is now a template that takes the llvm type as the argument, which is then used in verify(). I also removed the `dump()` functions. We now only have a non virtual `Value::dump()` that calls virtual `Value::dumpOS(raw_ostream &)` that gets overriden by the instructions. I had to rename `dump(raw_ostream &)` to `dumpOS(raw_ostream &)` because otherwise gdb would try to call the stream version of the dump and would not work with a simple `(gdb) call I->dump()`
https://github.com/llvm/llvm-project/pull/102687
More information about the llvm-commits
mailing list