diff --git a/llvm/include/llvm/SandboxIR/Instruction.h b/llvm/include/llvm/SandboxIR/Instruction.h index d9b0e93725813..4d21c4d3da355 100644 --- a/llvm/include/llvm/SandboxIR/Instruction.h +++ b/llvm/include/llvm/SandboxIR/Instruction.h @@ -1744,11 +1744,12 @@ class GetElementPtrInst final class CatchSwitchInst : public SingleLLVMInstructionImpl { -public: CatchSwitchInst(llvm::CatchSwitchInst *CSI, Context &Ctx) : SingleLLVMInstructionImpl(ClassID::CatchSwitch, Opcode::CatchSwitch, CSI, Ctx) {} + friend class Context; // For accessing the constructor in create*() +public: static CatchSwitchInst *create(Value *ParentPad, BasicBlock *UnwindBB, unsigned NumHandlers, InsertPosition Pos, Context &Ctx, const Twine &Name = ""); @@ -1833,10 +1834,11 @@ class CatchSwitchInst }; class ResumeInst : public SingleLLVMInstructionImpl { -public: ResumeInst(llvm::ResumeInst *CSI, Context &Ctx) : SingleLLVMInstructionImpl(ClassID::Resume, Opcode::Resume, CSI, Ctx) {} + friend class Context; // For accessing the constructor in create*() +public: static ResumeInst *create(Value *Exn, InsertPosition Pos, Context &Ctx); Value *getValue() const; unsigned getNumSuccessors() const { @@ -1848,10 +1850,11 @@ class ResumeInst : public SingleLLVMInstructionImpl { }; class SwitchInst : public SingleLLVMInstructionImpl { -public: SwitchInst(llvm::SwitchInst *SI, Context &Ctx) : SingleLLVMInstructionImpl(ClassID::Switch, Opcode::Switch, SI, Ctx) {} + friend class Context; // For accessing the constructor in create*() +public: static constexpr const unsigned DefaultPseudoIndex = llvm::SwitchInst::DefaultPseudoIndex;