Lines Matching +full:llvm +full:- +full:builddir

1 //===--- Headers.h - Include headers -----------------------------*- C++-*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
24 #include "llvm/ADT/ArrayRef.h"
25 #include "llvm/ADT/DenseSet.h"
26 #include "llvm/ADT/StringRef.h"
27 #include "llvm/ADT/StringSet.h"
28 #include "llvm/Support/Error.h"
29 #include "llvm/Support/FileSystem/UniqueID.h"
36 using HeaderFilter = llvm::ArrayRef<std::function<bool(llvm::StringRef)>>;
39 bool isLiteralInclude(llvm::StringRef Include);
55 llvm::StringRef Header;
62 llvm::Expected<HeaderFile> toHeaderFile(llvm::StringRef Header,
63 llvm::StringRef HintPath);
67 llvm::SmallVector<SymbolInclude, 1> getRankedIncludes(const Symbol &Sym);
75 int HashLine = 0; // Line number containing the directive, 0-indexed.
79 llvm::raw_ostream &operator<<(llvm::raw_ostream &, const Inclusion &);
84 // self-contained).
95 llvm::StringRef URI;
97 std::vector<llvm::StringRef> DirectIncludes;
103 using IncludeGraph = llvm::StringMap<IncludeGraphNode>;
129 // in any non-preamble inclusions.
156 llvm::ArrayRef<std::string> allHeaders() const { return RealPathNames; }
160 llvm::SmallVector<const Inclusion *>
161 mainFileIncludesWithSpelling(llvm::StringRef Spelling) const;
165 // Root --> 0, #included file --> 1, etc.
167 llvm::DenseMap<HeaderID, unsigned>
171 llvm::DenseMap<HeaderID, SmallVector<HeaderID>> IncludeChildren;
173 llvm::DenseMap<tooling::stdlib::Header, llvm::SmallVector<HeaderID>>
179 // Only includes the plain-directory entries (not header maps or frameworks).
201 llvm::DenseMap<llvm::sys::fs::UniqueID, HeaderID> UIDToIndex;
205 llvm::StringMap<llvm::SmallVector<unsigned>> MainFileIncludesBySpelling;
213 // include path of non-verbatim header will not be shortened.
215 const format::FormatStyle &Style, StringRef BuildDir,
218 : FileName(FileName), Code(Code), BuildDir(BuildDir),
227 /// - Either \p DeclaringHeader or \p InsertedHeader is already (directly)
229 /// - \p DeclaringHeader or \p InsertedHeader is the same as \p File.
251 llvm::StringRef IncludingFile) const;
255 std::optional<TextEdit> insert(llvm::StringRef VerbatimHeader,
261 StringRef BuildDir;
263 llvm::StringSet<> IncludedHeaders; // Both written and resolved.
272 namespace llvm {
277 return static_cast<clang::clangd::IncludeStructure::HeaderID>(-1);
281 return static_cast<clang::clangd::IncludeStructure::HeaderID>(-2);
295 } // namespace llvm