diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-07-29 23:40:14 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-07-29 23:40:14 +0000 |
commit | 7f4656eb6b60a7f3596fb26b9d5aed3731b3109e (patch) | |
tree | bc9c8fa565a421c6712d27c947e4bb3d3ff297c7 /include/clang/Index/Analyzer.h | |
parent | 40c0e73be6b2508c33f802368080f6b369dc67bc (diff) |
-Introduce the idx::Analyzer class used for getting indexing information, like finding
references of a declaration across translation units.
-Modify the index-test tool to use it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77536 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Index/Analyzer.h')
-rw-r--r-- | include/clang/Index/Analyzer.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/include/clang/Index/Analyzer.h b/include/clang/Index/Analyzer.h new file mode 100644 index 0000000000..90118b5173 --- /dev/null +++ b/include/clang/Index/Analyzer.h @@ -0,0 +1,51 @@ +//===--- Analyzer.h - Analysis for indexing information ---------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file declares the Analyzer interface. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_INDEX_ANALYZER_H +#define LLVM_CLANG_INDEX_ANALYZER_H + +namespace clang { + class Decl; + +namespace idx { + class Program; + class IndexProvider; + class TULocationHandler; + +/// \brief Provides indexing information, like finding all references of an +/// Entity across translation units. +class Analyzer { + Program &Prog; + IndexProvider &Idxer; + + Analyzer(const Analyzer&); // do not implement + Analyzer &operator=(const Analyzer &); // do not implement + +public: + explicit Analyzer(Program &prog, IndexProvider &idxer) + : Prog(prog), Idxer(idxer) { } + + /// \brief Find all TULocations for declarations of the given Decl and pass + /// them to Handler. + void FindDeclarations(Decl *D, TULocationHandler &Handler); + + /// \brief Find all TULocations for references of the given Decl and pass + /// them to Handler. + void FindReferences(Decl *D, TULocationHandler &Handler); +}; + +} // namespace idx + +} // namespace clang + +#endif |