diff options
author | Raphael Isemann <teemperor@gmail.com> | 2019-12-16 08:16:56 +0100 |
---|---|---|
committer | Raphael Isemann <teemperor@gmail.com> | 2019-12-16 08:29:14 +0100 |
commit | e2d47614a81d0805a869e614ffff1512e0136da9 (patch) | |
tree | 8c7ca16cebd985cd745c2c081302ef8bc8732444 /lldb/source | |
parent | bc633a42dd409dbeb456263e3388b8caa4680aa0 (diff) | |
download | llvm-e2d47614a81d0805a869e614ffff1512e0136da9.zip llvm-e2d47614a81d0805a869e614ffff1512e0136da9.tar.gz llvm-e2d47614a81d0805a869e614ffff1512e0136da9.tar.bz2 |
[lldb][NFC] Replace ClangASTImporter's use of map/set with SmallPtrSet and DenseMap
We have several pointer->pointer mappings in the ClangASTImporter implemented using
STL data structures. This moves these variables to the appropriate LLVM data structures
that are intended for mapping pointers.
Diffstat (limited to 'lldb/source')
-rw-r--r-- | lldb/source/Symbol/ClangASTImporter.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lldb/source/Symbol/ClangASTImporter.cpp b/lldb/source/Symbol/ClangASTImporter.cpp index 8b1c6c8..80c5c4a 100644 --- a/lldb/source/Symbol/ClangASTImporter.cpp +++ b/lldb/source/Symbol/ClangASTImporter.cpp @@ -121,7 +121,7 @@ private: clang::DeclContext *lexical_decl_context; }; - std::map<clang::Decl *, Backup> m_backups; + llvm::DenseMap<clang::Decl *, Backup> m_backups; void OverrideOne(clang::Decl *decl) { if (m_backups.find(decl) != m_backups.end()) { @@ -228,10 +228,8 @@ namespace { /// imported while completing the original Decls). class CompleteTagDeclsScope : public ClangASTImporter::NewDeclListener { ClangASTImporter::ImporterDelegateSP m_delegate; - // FIXME: Investigate how many decls we usually have in these sets and - // see if we can use SmallPtrSet instead here. - std::set<NamedDecl *> m_decls_to_complete; - std::set<NamedDecl *> m_decls_already_completed; + llvm::SmallPtrSet<NamedDecl *, 32> m_decls_to_complete; + llvm::SmallPtrSet<NamedDecl *, 32> m_decls_already_completed; clang::ASTContext *m_dst_ctx; clang::ASTContext *m_src_ctx; ClangASTImporter &importer; |