clang API Documentation

Analyzer.h
Go to the documentation of this file.
00001 //===--- Analyzer.h - Analysis for indexing information ---------*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This file declares the Analyzer interface.
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #ifndef LLVM_CLANG_INDEX_ANALYZER_H
00015 #define LLVM_CLANG_INDEX_ANALYZER_H
00016 
00017 namespace clang {
00018   class Decl;
00019   class ObjCMessageExpr;
00020 
00021 namespace idx {
00022   class Program;
00023   class IndexProvider;
00024   class TULocationHandler;
00025 
00026 /// \brief Provides indexing information, like finding all references of an
00027 /// Entity across translation units.
00028 class Analyzer {
00029   Program &Prog;
00030   IndexProvider &Idxer;
00031 
00032   Analyzer(const Analyzer&); // do not implement
00033   Analyzer &operator=(const Analyzer &); // do not implement
00034 
00035 public:
00036   explicit Analyzer(Program &prog, IndexProvider &idxer)
00037     : Prog(prog), Idxer(idxer) { }
00038 
00039   /// \brief Find all TULocations for declarations of the given Decl and pass
00040   /// them to Handler.
00041   void FindDeclarations(Decl *D, TULocationHandler &Handler);
00042 
00043   /// \brief Find all TULocations for references of the given Decl and pass
00044   /// them to Handler.
00045   void FindReferences(Decl *D, TULocationHandler &Handler);
00046 
00047   /// \brief Find methods that may respond to the given message and pass them
00048   /// to Handler.
00049   void FindObjCMethods(ObjCMessageExpr *MsgE, TULocationHandler &Handler);
00050 };
00051 
00052 } // namespace idx
00053 
00054 } // namespace clang
00055 
00056 #endif