blob: 52f153f1dcd7863b8fae8e265d7f433db358163f [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
17#include "clang/Index/Entity.h"
18#include "llvm/ADT/StringSet.h"
19
20namespace clang {
21
22namespace idx {
23 class EntityListener;
24
25class ProgramImpl {
26public:
27 typedef llvm::FoldingSet<Entity> EntitySetTy;
28 typedef llvm::StringMapEntry<char> IdEntryTy;
29
30private:
31 llvm::FoldingSet<Entity> Entities;
32 llvm::StringSet<> Idents;
33 llvm::BumpPtrAllocator BumpAlloc;
34
35 ProgramImpl(const ProgramImpl&); // do not implement
36 ProgramImpl &operator=(const ProgramImpl &); // do not implement
37
38public:
39 ProgramImpl() { }
40
41 llvm::FoldingSet<Entity> &getEntities() { return Entities; }
42 llvm::StringSet<> &getIdents() { return Idents; }
43
44 void *Allocate(unsigned Size, unsigned Align = 8) {
45 return BumpAlloc.Allocate(Size, Align);
46 }
47};
48
49} // namespace idx
50
51} // namespace clang
52
53#endif