aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/SourceManager.cpp
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2019-07-15 17:27:46 +0000
committerNico Weber <nicolasweber@gmx.de>2019-07-15 17:27:46 +0000
commita2dcbd3643993b67c0722f58610bed138626cd86 (patch)
treeee60927ea21fab3c41bc1cf7c1317a470e8e00bf /clang/lib/Basic/SourceManager.cpp
parenta65913e752e00f97df20aec6bbd3fea78fef973c (diff)
downloadllvm-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.cpp4
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.