diff options
Diffstat (limited to 'contrib/llvm/tools/clang/lib/Index/ProgramImpl.h')
-rw-r--r-- | contrib/llvm/tools/clang/lib/Index/ProgramImpl.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/contrib/llvm/tools/clang/lib/Index/ProgramImpl.h b/contrib/llvm/tools/clang/lib/Index/ProgramImpl.h new file mode 100644 index 0000000..57b9ce3 --- /dev/null +++ b/contrib/llvm/tools/clang/lib/Index/ProgramImpl.h @@ -0,0 +1,56 @@ +//===--- ProgramImpl.h - Internal Program implementation---------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// Internal implementation for the Program class +// +//===----------------------------------------------------------------------===// + +#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&); // do not implement + ProgramImpl &operator=(const ProgramImpl &); // do not implement + +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); + } +}; + +} // namespace idx + +} // namespace clang + +#endif |