Skip to content

Commit c4d0e26

Browse files
authored
Update GenFiles.cpp
1 parent d546005 commit c4d0e26

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/lib/DPCT/FileGenerator/GenFiles.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ static bool formatFile(const clang::tooling::UnifiedPath &FileName,
111111
// the first input (the original output of dpct without format), then the
112112
// result is wrong.
113113
clang::LangOptions DefaultLangOptions;
114-
auto *DO = new DiagnosticOptions;
114+
auto *DO = std::make_shared<DiagnosticOptions>();
115115
clang::TextDiagnosticPrinter DiagnosticPrinter(llvm::errs(), *DO);
116116
clang::DiagnosticsEngine Diagnostics(
117117
IntrusiveRefCntPtr<clang::DiagnosticIDs>(new clang::DiagnosticIDs()),
@@ -909,7 +909,7 @@ int saveNewFiles(clang::tooling::RefactoringTool &Tool,
909909
volatile ProcessStatus status = MigrationSucceeded;
910910
// Set up Rewriter.
911911
LangOptions DefaultLangOptions;
912-
auto DiagOpts = std::make_shared<DiagnosticOptions>();
912+
auto DiagOpts = std::make_shared<DiagnosticOptions>();
913913
TextDiagnosticPrinter DiagnosticPrinter(llvm::errs(), *DiagOpts);
914914
DiagnosticsEngine Diagnostics(
915915
IntrusiveRefCntPtr<DiagnosticIDs>(new DiagnosticIDs()), *DiagOpts,

0 commit comments

Comments
 (0)