mirror of
https://github.com/llvm/llvm-project.git
synced 2025-05-15 13:46:09 +00:00

Its purpose is to provide the basic infrastructure for cross-translation-unit analysis like indexing, refactoring, etc. Currently it is very "primitive" and with no type-names support. It can provide functionality like "show me all references of this function from these translation units". llvm-svn: 74802
54 lines
1.3 KiB
C++
54 lines
1.3 KiB
C++
//===--- 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 "clang/Index/Entity.h"
|
|
#include "llvm/ADT/StringSet.h"
|
|
|
|
namespace clang {
|
|
|
|
namespace idx {
|
|
class EntityListener;
|
|
|
|
class ProgramImpl {
|
|
public:
|
|
typedef llvm::FoldingSet<Entity> EntitySetTy;
|
|
typedef llvm::StringMapEntry<char> IdEntryTy;
|
|
|
|
private:
|
|
llvm::FoldingSet<Entity> Entities;
|
|
llvm::StringSet<> Idents;
|
|
llvm::BumpPtrAllocator BumpAlloc;
|
|
|
|
ProgramImpl(const ProgramImpl&); // do not implement
|
|
ProgramImpl &operator=(const ProgramImpl &); // do not implement
|
|
|
|
public:
|
|
ProgramImpl() { }
|
|
|
|
llvm::FoldingSet<Entity> &getEntities() { return Entities; }
|
|
llvm::StringSet<> &getIdents() { return Idents; }
|
|
|
|
void *Allocate(unsigned Size, unsigned Align = 8) {
|
|
return BumpAlloc.Allocate(Size, Align);
|
|
}
|
|
};
|
|
|
|
} // namespace idx
|
|
|
|
} // namespace clang
|
|
|
|
#endif
|