Argyrios Kyrtzidis | 9eec4ed | 2009-07-05 22:22:19 +0000 | [diff] [blame] | 1 | //===--- 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 Kyrtzidis | f7cf15c | 2009-07-21 00:07:06 +0000 | [diff] [blame^] | 17 | #include "EntityImpl.h" |
Argyrios Kyrtzidis | 9eec4ed | 2009-07-05 22:22:19 +0000 | [diff] [blame] | 18 | |
| 19 | namespace clang { |
| 20 | |
| 21 | namespace idx { |
| 22 | class EntityListener; |
| 23 | |
| 24 | class ProgramImpl { |
| 25 | public: |
Argyrios Kyrtzidis | f7cf15c | 2009-07-21 00:07:06 +0000 | [diff] [blame^] | 26 | typedef llvm::FoldingSet<EntityImpl> EntitySetTy; |
| 27 | |
Argyrios Kyrtzidis | 9eec4ed | 2009-07-05 22:22:19 +0000 | [diff] [blame] | 28 | private: |
Argyrios Kyrtzidis | f7cf15c | 2009-07-21 00:07:06 +0000 | [diff] [blame^] | 29 | EntitySetTy Entities; |
Argyrios Kyrtzidis | 9eec4ed | 2009-07-05 22:22:19 +0000 | [diff] [blame] | 30 | llvm::StringSet<> Idents; |
| 31 | llvm::BumpPtrAllocator BumpAlloc; |
| 32 | |
| 33 | ProgramImpl(const ProgramImpl&); // do not implement |
| 34 | ProgramImpl &operator=(const ProgramImpl &); // do not implement |
| 35 | |
| 36 | public: |
| 37 | ProgramImpl() { } |
| 38 | |
Argyrios Kyrtzidis | f7cf15c | 2009-07-21 00:07:06 +0000 | [diff] [blame^] | 39 | EntitySetTy &getEntities() { return Entities; } |
Argyrios Kyrtzidis | 9eec4ed | 2009-07-05 22:22:19 +0000 | [diff] [blame] | 40 | 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 |