clang-tools  7.0.0
Merge.h
Go to the documentation of this file.
1 //===--- Merge.h ------------------------------------------------*- 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 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_MERGE_H
10 #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_MERGE_H
11 #include "Index.h"
12 namespace clang {
13 namespace clangd {
14 
15 // Merge symbols L and R, preferring data from L in case of conflict.
16 // The two symbols must have the same ID.
17 // Returned symbol may contain data owned by either source.
18 Symbol mergeSymbol(const Symbol &L, const Symbol &R, Symbol::Details *Scratch);
19 
20 // mergedIndex returns a composite index based on two provided Indexes:
21 // - the Dynamic index covers few files, but is relatively up-to-date.
22 // - the Static index covers a bigger set of files, but is relatively stale.
23 // The returned index attempts to combine results, and avoid duplicates.
24 std::unique_ptr<SymbolIndex> mergeIndex(const SymbolIndex *Dynamic,
25  const SymbolIndex *Static);
26 
27 } // namespace clangd
28 } // namespace clang
29 #endif
Symbol mergeSymbol(const Symbol &L, const Symbol &R, Symbol::Details *Scratch)
Definition: Merge.cpp:83
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
std::unique_ptr< SymbolIndex > mergeIndex(const SymbolIndex *Dynamic, const SymbolIndex *Static)
Definition: Merge.cpp:123