1 //===--- ProgramImpl.h - Internal Program implementation---------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // Internal implementation for the Program class
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_CLANG_INDEX_PROGRAMIMPL_H
15 #define LLVM_CLANG_INDEX_PROGRAMIMPL_H
17 #include "EntityImpl.h"
18 #include "clang/Basic/IdentifierTable.h"
19 #include "clang/Basic/LangOptions.h"
28 typedef llvm::FoldingSet<EntityImpl> EntitySetTy;
32 llvm::BumpPtrAllocator BumpAlloc;
34 IdentifierTable Identifiers;
35 SelectorTable Selectors;
37 ProgramImpl(const ProgramImpl&); // do not implement
38 ProgramImpl &operator=(const ProgramImpl &); // do not implement
41 ProgramImpl() : Identifiers(LangOptions()) { }
43 EntitySetTy &getEntities() { return Entities; }
44 IdentifierTable &getIdents() { return Identifiers; }
45 SelectorTable &getSelectors() { return Selectors; }
47 void *Allocate(unsigned Size, unsigned Align = 8) {
48 return BumpAlloc.Allocate(Size, Align);