clang::Decl *decl;
};
- typedef std::map<const clang::Decl *, DeclOrigin> OriginMap;
+ typedef llvm::DenseMap<const clang::Decl *, DeclOrigin> OriginMap;
/// Listener interface used by the ASTImporterDelegate to inform other code
/// about decls that have been imported the first time.
/// ASTContext. Used by the CxxModuleHandler to mark declarations that
/// were created from the 'std' C++ module to prevent that the Importer
/// tries to sync them with the broken equivalent in the debug info AST.
- std::set<clang::Decl *> m_decls_to_ignore;
+ llvm::SmallPtrSet<clang::Decl *, 16> m_decls_to_ignore;
ClangASTImporter &m_master;
clang::ASTContext *m_source_ctx;
CxxModuleHandler *m_std_handler = nullptr;
};
typedef std::shared_ptr<ASTImporterDelegate> ImporterDelegateSP;
- typedef std::map<clang::ASTContext *, ImporterDelegateSP> DelegateMap;
- typedef std::map<const clang::NamespaceDecl *, NamespaceMapSP>
+ typedef llvm::DenseMap<clang::ASTContext *, ImporterDelegateSP> DelegateMap;
+ typedef llvm::DenseMap<const clang::NamespaceDecl *, NamespaceMapSP>
NamespaceMetaMap;
struct ASTContextMetadata {
};
typedef std::shared_ptr<ASTContextMetadata> ASTContextMetadataSP;
- typedef std::map<const clang::ASTContext *, ASTContextMetadataSP>
+ typedef llvm::DenseMap<const clang::ASTContext *, ASTContextMetadataSP>
ContextMetadataMap;
ContextMetadataMap m_metadata_map;
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()) {
/// 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;