blob: 39fc184677deac95a9f276149f6c0d5921675bee [file] [log] [blame]
Argyrios Kyrtzidis9eec4ed2009-07-05 22:22:19 +00001//===--- ProgramImpl.h - Internal Program implementation---------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// Internal implementation for the Program class
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_CLANG_INDEX_PROGRAMIMPL_H
15#define LLVM_CLANG_INDEX_PROGRAMIMPL_H
16
Argyrios Kyrtzidisf7cf15c2009-07-21 00:07:06 +000017#include "EntityImpl.h"
Argyrios Kyrtzidis9eec4ed2009-07-05 22:22:19 +000018
19namespace clang {
20
21namespace idx {
22 class EntityListener;
23
24class ProgramImpl {
25public:
Argyrios Kyrtzidisf7cf15c2009-07-21 00:07:06 +000026 typedef llvm::FoldingSet<EntityImpl> EntitySetTy;
27
Argyrios Kyrtzidis9eec4ed2009-07-05 22:22:19 +000028private:
Argyrios Kyrtzidisf7cf15c2009-07-21 00:07:06 +000029 EntitySetTy Entities;
Argyrios Kyrtzidis9eec4ed2009-07-05 22:22:19 +000030 llvm::StringSet<> Idents;
31 llvm::BumpPtrAllocator BumpAlloc;
32
33 ProgramImpl(const ProgramImpl&); // do not implement
34 ProgramImpl &operator=(const ProgramImpl &); // do not implement
35
36public:
37 ProgramImpl() { }
38
Argyrios Kyrtzidisf7cf15c2009-07-21 00:07:06 +000039 EntitySetTy &getEntities() { return Entities; }
Argyrios Kyrtzidis9eec4ed2009-07-05 22:22:19 +000040 llvm::StringSet<> &getIdents() { return Idents; }
41
42 void *Allocate(unsigned Size, unsigned Align = 8) {
43 return BumpAlloc.Allocate(Size, Align);
44 }
45};
46
47} // namespace idx
48
49} // namespace clang
50
51#endif