Home | History | Annotate | Download | only in Index
      1 //===--- IndexingAction.h - Frontend index action -------------------------===//
      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 #ifndef LLVM_CLANG_INDEX_INDEXINGACTION_H
     11 #define LLVM_CLANG_INDEX_INDEXINGACTION_H
     12 
     13 #include "clang/Basic/LLVM.h"
     14 #include <memory>
     15 
     16 namespace clang {
     17   class ASTReader;
     18   class ASTUnit;
     19   class FrontendAction;
     20 
     21 namespace serialization {
     22   class ModuleFile;
     23 }
     24 
     25 namespace index {
     26   class IndexDataConsumer;
     27 
     28 struct IndexingOptions {
     29   enum class SystemSymbolFilterKind {
     30     None,
     31     DeclarationsOnly,
     32     All,
     33   };
     34 
     35   SystemSymbolFilterKind SystemSymbolFilter
     36     = SystemSymbolFilterKind::DeclarationsOnly;
     37   bool IndexFunctionLocals = false;
     38 };
     39 
     40 /// \param WrappedAction another frontend action to wrap over or null.
     41 std::unique_ptr<FrontendAction>
     42 createIndexingAction(std::shared_ptr<IndexDataConsumer> DataConsumer,
     43                      IndexingOptions Opts,
     44                      std::unique_ptr<FrontendAction> WrappedAction);
     45 
     46 void indexASTUnit(ASTUnit &Unit,
     47                   std::shared_ptr<IndexDataConsumer> DataConsumer,
     48                   IndexingOptions Opts);
     49 
     50 void indexModuleFile(serialization::ModuleFile &Mod,
     51                      ASTReader &Reader,
     52                      std::shared_ptr<IndexDataConsumer> DataConsumer,
     53                      IndexingOptions Opts);
     54 
     55 } // namespace index
     56 } // namespace clang
     57 
     58 #endif
     59