#ifndef LLVM_CLANG_INDEX_PROGRAMIMPL_H
#define LLVM_CLANG_INDEX_PROGRAMIMPL_H
#include "EntityImpl.h"
#include "clang/Basic/IdentifierTable.h"
#include "clang/Basic/LangOptions.h"
namespace clang {
namespace idx {
class EntityListener;
class ProgramImpl {
public:
typedef llvm::FoldingSet<EntityImpl> EntitySetTy;
private:
EntitySetTy Entities;
llvm::BumpPtrAllocator BumpAlloc;
IdentifierTable Identifiers;
SelectorTable Selectors;
ProgramImpl(const ProgramImpl&); ProgramImpl &operator=(const ProgramImpl &);
public:
ProgramImpl() : Identifiers(LangOptions()) { }
EntitySetTy &getEntities() { return Entities; }
IdentifierTable &getIdents() { return Identifiers; }
SelectorTable &getSelectors() { return Selectors; }
void *Allocate(unsigned Size, unsigned Align = 8) {
return BumpAlloc.Allocate(Size, Align);
}
};
}
}
#endif