clang-tools
11.0.0
|
Maps a definition location onto an #include file, based on a set of filename rules. More...
#include <CanonicalIncludes.h>
Public Member Functions | |
void | addMapping (llvm::StringRef Path, llvm::StringRef CanonicalPath) |
Adds a string-to-string mapping from Path to CanonicalPath . More... | |
llvm::StringRef | mapHeader (llvm::StringRef Header, llvm::StringRef QualifiedName) const |
Returns the canonical include for symbol with QualifiedName . More... | |
void | addSystemHeadersMapping (const LangOptions &Language) |
Adds mapping for system headers and some special symbols (e.g. More... | |
Maps a definition location onto an #include file, based on a set of filename rules.
Only const methods (i.e. mapHeader) in this class are thread safe.
Definition at line 36 of file CanonicalIncludes.h.
void clang::clangd::CanonicalIncludes::addMapping | ( | llvm::StringRef | Path, |
llvm::StringRef | CanonicalPath | ||
) |
Adds a string-to-string mapping from Path
to CanonicalPath
.
Definition at line 22 of file CanonicalIncludes.cpp.
void clang::clangd::CanonicalIncludes::addSystemHeadersMapping | ( | const LangOptions & | Language | ) |
Adds mapping for system headers and some special symbols (e.g.
STL symbols in <iosfwd> need to be mapped individually). Approximately, the following system headers are handled:
Definition at line 88 of file CanonicalIncludes.cpp.
llvm::StringRef clang::clangd::CanonicalIncludes::mapHeader | ( | llvm::StringRef | Header, |
llvm::StringRef | QualifiedName | ||
) | const |
Returns the canonical include for symbol with QualifiedName
.
Header
is the file the declaration was reachable from. Header itself will be returned if there is no relevant mapping.
Definition at line 32 of file CanonicalIncludes.cpp.