clang-tools  8.0.0
IndexAction.h
Go to the documentation of this file.
1 //===--- IndexAction.h - Run the indexer as a frontend action ----*- C++-*-===//
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_TOOLS_EXTRA_CLANGD_INDEX_INDEX_ACTION_H
11 #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_INDEX_ACTION_H
12 #include "Headers.h"
13 #include "SymbolCollector.h"
14 #include "clang/Frontend/FrontendActions.h"
15 
16 namespace clang {
17 namespace clangd {
18 
19 // Creates an action that indexes translation units and delivers the results
20 // for SymbolsCallback (each slab corresponds to one TU).
21 //
22 // Only a subset of SymbolCollector::Options are respected:
23 // - include paths are always collected, and canonicalized appropriately
24 // - references are always counted
25 // - all references are collected (if RefsCallback is non-null)
26 // - the symbol origin is always Static
27 std::unique_ptr<FrontendAction> createStaticIndexingAction(
28  SymbolCollector::Options Opts,
29  std::function<void(SymbolSlab)> SymbolsCallback,
30  std::function<void(RefSlab)> RefsCallback,
31  std::function<void(IncludeGraph)> IncludeGraphCallback);
32 
33 } // namespace clangd
34 } // namespace clang
35 
36 #endif
llvm::StringMap< IncludeGraphNode > IncludeGraph
Definition: Headers.h:65
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
std::unique_ptr< FrontendAction > createStaticIndexingAction(SymbolCollector::Options Opts, std::function< void(SymbolSlab)> SymbolsCallback, std::function< void(RefSlab)> RefsCallback, std::function< void(IncludeGraph)> IncludeGraphCallback)