diff --git a/llvm/lib/SandboxIR/Context.cpp b/llvm/lib/SandboxIR/Context.cpp index b86ed5864c1ac..21efa1091c7eb 100644 --- a/llvm/lib/SandboxIR/Context.cpp +++ b/llvm/lib/SandboxIR/Context.cpp @@ -295,20 +295,17 @@ Value *Context::getOrCreateValueInternal(llvm::Value *LLVMV, llvm::User *U) { } case llvm::Instruction::CatchSwitch: { auto *LLVMCatchSwitchInst = cast(LLVMV); - It->second = std::unique_ptr( - new CatchSwitchInst(LLVMCatchSwitchInst, *this)); + It->second = std::make_unique(LLVMCatchSwitchInst, *this); return It->second.get(); } case llvm::Instruction::Resume: { auto *LLVMResumeInst = cast(LLVMV); - It->second = - std::unique_ptr(new ResumeInst(LLVMResumeInst, *this)); + It->second = std::make_unique(LLVMResumeInst, *this); return It->second.get(); } case llvm::Instruction::Switch: { auto *LLVMSwitchInst = cast(LLVMV); - It->second = - std::unique_ptr(new SwitchInst(LLVMSwitchInst, *this)); + It->second = std::make_unique(LLVMSwitchInst, *this); return It->second.get(); } case llvm::Instruction::FNeg: { @@ -549,15 +546,15 @@ Context::createGetElementPtrInst(llvm::GetElementPtrInst *I) { return cast(registerValue(std::move(NewPtr))); } CatchSwitchInst *Context::createCatchSwitchInst(llvm::CatchSwitchInst *I) { - auto NewPtr = std::unique_ptr(new CatchSwitchInst(I, *this)); + auto NewPtr = std::make_unique(I, *this); return cast(registerValue(std::move(NewPtr))); } ResumeInst *Context::createResumeInst(llvm::ResumeInst *I) { - auto NewPtr = std::unique_ptr(new ResumeInst(I, *this)); + auto NewPtr = std::make_unique(I, *this); return cast(registerValue(std::move(NewPtr))); } SwitchInst *Context::createSwitchInst(llvm::SwitchInst *I) { - auto NewPtr = std::unique_ptr(new SwitchInst(I, *this)); + auto NewPtr = std::make_unique(I, *this); return cast(registerValue(std::move(NewPtr))); } UnaryOperator *Context::createUnaryOperator(llvm::UnaryOperator *I) {