/// Sorted (by file offset) vector of pairs of file offset/Decl.
using LocDeclsTy = SmallVector<std::pair<unsigned, Decl *>, 64>;
- using FileDeclsTy = llvm::DenseMap<FileID, LocDeclsTy *>;
+ using FileDeclsTy = llvm::DenseMap<FileID, std::unique_ptr<LocDeclsTy>>;
/// Map from FileID to the file-level declarations that it contains.
/// The files and decls are only local (and non-preamble) ones.
};
void ASTUnit::clearFileLevelDecls() {
- llvm::DeleteContainerSeconds(FileDecls);
+ FileDecls.clear();
}
/// After failing to build a precompiled preamble (due to
if (FID.isInvalid())
return;
- LocDeclsTy *&Decls = FileDecls[FID];
+ std::unique_ptr<LocDeclsTy> &Decls = FileDecls[FID];
if (!Decls)
- Decls = new LocDeclsTy();
+ Decls = std::make_unique<LocDeclsTy>();
std::pair<unsigned, Decl *> LocDecl(Offset, D);