Skip to content

Commit 502ac89

Browse files
committed
Fix some suggestions by the bot
1 parent 61cd557 commit 502ac89

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/Interpreter/CXCppInterOp.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,13 +271,12 @@ static inline compat::Interpreter* getInterpreter(const CXInterpreterImpl* I) {
271271
}
272272

273273
CXInterpreter clang_createInterpreter(const char* const* argv, int argc) {
274-
auto* I = new CXInterpreterImpl(); // NOLINT(*-owning-memory)
274+
auto I = std::make_unique<CXInterpreterImpl>(); // NOLINT(*-owning-memory)
275275
#ifdef CPPINTEROP_USE_CLING
276276
I->Interp = std::make_unique<compat::Interpreter>(argc, argv);
277277
#else
278278
I->Interp = compat::Interpreter::create(argc, argv);
279279
if (!I->Interp) {
280-
delete I;
281280
return nullptr;
282281
}
283282
#endif
@@ -289,7 +288,7 @@ CXInterpreter clang_createInterpreter(const char* const* argv, int argc) {
289288
// AU->Ctx = &I->Interp->getSema().getASTContext();
290289
// I->TU.reset(MakeCXTranslationUnit(static_cast<CIndexer*>(clang_createIndex(0,
291290
// 0)), AU));
292-
return I;
291+
return I.release();
293292
}
294293

295294
CXInterpreter clang_createInterpreterFromRawPtr(TInterp_t I) {

0 commit comments

Comments
 (0)