summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2015-08-18 23:56:00 +0000
committerDavid Blaikie <dblaikie@gmail.com>2015-08-18 23:56:00 +0000
commit8f2a7feec80009dd19031d80f0a6a002e6b2c7f4 (patch)
treec18cb50720a9e6702b5a76a7d0c09bc3af95038c /clang/lib
parent401cd25b2346d13e2ae77d7ced4e798a252b15e4 (diff)
downloadbcm5719-llvm-8f2a7feec80009dd19031d80f0a6a002e6b2c7f4.tar.gz
bcm5719-llvm-8f2a7feec80009dd19031d80f0a6a002e6b2c7f4.zip
unique_ptrify CXXBasePaths::DeclsFound & remove the then-unnecessary user-defined dtor
Maybe this and the NumDeclsFound member should just be a std::vector instead. (it could be a std::dynarray, but that missed standardization) llvm-svn: 245392
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/AST/CXXInheritance.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/AST/CXXInheritance.cpp b/clang/lib/AST/CXXInheritance.cpp
index 75d775f260c..6785a0c2935 100644
--- a/clang/lib/AST/CXXInheritance.cpp
+++ b/clang/lib/AST/CXXInheritance.cpp
@@ -31,16 +31,16 @@ void CXXBasePaths::ComputeDeclsFound() {
Decls.insert(Path->Decls.front());
NumDeclsFound = Decls.size();
- DeclsFound = new NamedDecl * [NumDeclsFound];
- std::copy(Decls.begin(), Decls.end(), DeclsFound);
+ DeclsFound = llvm::make_unique<NamedDecl *[]>(NumDeclsFound);
+ std::copy(Decls.begin(), Decls.end(), DeclsFound.get());
}
CXXBasePaths::decl_range CXXBasePaths::found_decls() {
if (NumDeclsFound == 0)
ComputeDeclsFound();
- return decl_range(decl_iterator(DeclsFound),
- decl_iterator(DeclsFound + NumDeclsFound));
+ return decl_range(decl_iterator(DeclsFound.get()),
+ decl_iterator(DeclsFound.get() + NumDeclsFound));
}
/// isAmbiguous - Determines whether the set of paths provided is
OpenPOWER on IntegriCloud