diff options
author | Nico Weber <nicolasweber@gmx.de> | 2019-07-15 17:27:46 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2019-07-15 17:27:46 +0000 |
commit | a2dcbd3643993b67c0722f58610bed138626cd86 (patch) | |
tree | ee60927ea21fab3c41bc1cf7c1317a470e8e00bf /clang/lib/Basic/SourceManager.cpp | |
parent | a65913e752e00f97df20aec6bbd3fea78fef973c (diff) | |
download | llvm-a2dcbd3643993b67c0722f58610bed138626cd86.zip llvm-a2dcbd3643993b67c0722f58610bed138626cd86.tar.gz llvm-a2dcbd3643993b67c0722f58610bed138626cd86.tar.bz2 |
Use a unique_ptr instead of manual memory management for LineTable
llvm-svn: 366088
Diffstat (limited to 'clang/lib/Basic/SourceManager.cpp')
-rw-r--r-- | clang/lib/Basic/SourceManager.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp index c7588aa..12b0305 100644 --- a/clang/lib/Basic/SourceManager.cpp +++ b/clang/lib/Basic/SourceManager.cpp @@ -329,7 +329,7 @@ void SourceManager::AddLineNote(SourceLocation Loc, unsigned LineNo, LineTableInfo &SourceManager::getLineTable() { if (!LineTable) - LineTable = new LineTableInfo(); + LineTable.reset(new LineTableInfo()); return *LineTable; } @@ -345,8 +345,6 @@ SourceManager::SourceManager(DiagnosticsEngine &Diag, FileManager &FileMgr, } SourceManager::~SourceManager() { - delete LineTable; - // Delete FileEntry objects corresponding to content caches. Since the actual // content cache objects are bump pointer allocated, we just have to run the // dtors, but we call the deallocate method for completeness. |