20 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_CANONICALINCLUDES_H 21 #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_CANONICALINCLUDES_H 23 #include "clang/Lex/Preprocessor.h" 24 #include "llvm/ADT/StringMap.h" 25 #include "llvm/Support/Regex.h" 41 void addMapping(llvm::StringRef
Path, llvm::StringRef CanonicalPath);
44 void addRegexMapping(llvm::StringRef RE, llvm::StringRef CanonicalPath);
49 llvm::StringRef CanonicalPath);
54 llvm::StringRef
mapHeader(llvm::ArrayRef<std::string> Headers,
55 llvm::StringRef QualifiedName)
const;
63 mutable std::vector<std::pair<llvm::Regex, std::string>>
64 RegexHeaderMappingTable;
66 llvm::StringMap<std::string> SymbolMapping;
68 mutable std::mutex RegexMutex;
77 std::unique_ptr<CommentHandler>
93 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANGD_INDEX_HEADERMAPCOLLECTOR_H std::unique_ptr< CommentHandler > collectIWYUHeaderMaps(CanonicalIncludes *Includes)
Returns a CommentHandler that parses pragma comment on include files to determine when we should incl...
void addSymbolMapping(llvm::StringRef QualifiedName, llvm::StringRef CanonicalPath)
Sets the canonical include for any symbol with QualifiedName.
Maps a definition location onto an #include file, based on a set of filename rules.
void addMapping(llvm::StringRef Path, llvm::StringRef CanonicalPath)
Adds a string-to-string mapping from Path to CanonicalPath.
void addRegexMapping(llvm::StringRef RE, llvm::StringRef CanonicalPath)
Maps all files matching RE to CanonicalPath.
std::string Path
A typedef to represent a file path.
CanonicalIncludes()=default
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
llvm::StringRef mapHeader(llvm::ArrayRef< std::string > Headers, llvm::StringRef QualifiedName) const
Returns the canonical include for symbol with QualifiedName.
void addSystemHeadersMapping(CanonicalIncludes *Includes)
Adds mapping for system headers and some special symbols (e.g.