@@ -295,20 +295,17 @@ Value *Context::getOrCreateValueInternal(llvm::Value *LLVMV, llvm::User *U) {
295295 }
296296 case llvm::Instruction::CatchSwitch: {
297297 auto *LLVMCatchSwitchInst = cast<llvm::CatchSwitchInst>(LLVMV);
298- It->second = std::unique_ptr<CatchSwitchInst>(
299- new CatchSwitchInst (LLVMCatchSwitchInst, *this ));
298+ It->second = std::make_unique<CatchSwitchInst>(LLVMCatchSwitchInst, *this );
300299 return It->second .get ();
301300 }
302301 case llvm::Instruction::Resume: {
303302 auto *LLVMResumeInst = cast<llvm::ResumeInst>(LLVMV);
304- It->second =
305- std::unique_ptr<ResumeInst>(new ResumeInst (LLVMResumeInst, *this ));
303+ It->second = std::make_unique<ResumeInst>(LLVMResumeInst, *this );
306304 return It->second .get ();
307305 }
308306 case llvm::Instruction::Switch: {
309307 auto *LLVMSwitchInst = cast<llvm::SwitchInst>(LLVMV);
310- It->second =
311- std::unique_ptr<SwitchInst>(new SwitchInst (LLVMSwitchInst, *this ));
308+ It->second = std::make_unique<SwitchInst>(LLVMSwitchInst, *this );
312309 return It->second .get ();
313310 }
314311 case llvm::Instruction::FNeg: {
@@ -549,15 +546,15 @@ Context::createGetElementPtrInst(llvm::GetElementPtrInst *I) {
549546 return cast<GetElementPtrInst>(registerValue (std::move (NewPtr)));
550547}
551548CatchSwitchInst *Context::createCatchSwitchInst (llvm::CatchSwitchInst *I) {
552- auto NewPtr = std::unique_ptr <CatchSwitchInst>(new CatchSwitchInst ( I, *this ) );
549+ auto NewPtr = std::make_unique <CatchSwitchInst>(I, *this );
553550 return cast<CatchSwitchInst>(registerValue (std::move (NewPtr)));
554551}
555552ResumeInst *Context::createResumeInst (llvm::ResumeInst *I) {
556- auto NewPtr = std::unique_ptr <ResumeInst>(new ResumeInst ( I, *this ) );
553+ auto NewPtr = std::make_unique <ResumeInst>(I, *this );
557554 return cast<ResumeInst>(registerValue (std::move (NewPtr)));
558555}
559556SwitchInst *Context::createSwitchInst (llvm::SwitchInst *I) {
560- auto NewPtr = std::unique_ptr <SwitchInst>(new SwitchInst ( I, *this ) );
557+ auto NewPtr = std::make_unique <SwitchInst>(I, *this );
561558 return cast<SwitchInst>(registerValue (std::move (NewPtr)));
562559}
563560UnaryOperator *Context::createUnaryOperator (llvm::UnaryOperator *I) {
0 commit comments