clang-tools 17.0.0git
|
Maps a definition location onto an #include file, based on a set of filename rules. More...
#include <CanonicalIncludes.h>
Public Member Functions | |
void | addMapping (FileEntryRef Header, llvm::StringRef CanonicalPath) |
Adds a file-to-string mapping from ID to CanonicalPath . | |
llvm::StringRef | mapSymbol (llvm::StringRef Scope, llvm::StringRef Name, const LangOptions &L) const |
Returns the overridden include for a qualified symbol with, or "". | |
llvm::StringRef | mapHeader (FileEntryRef Header) const |
Returns the overridden include for files in Header , or "". | |
void | addSystemHeadersMapping (const LangOptions &Language) |
Adds mapping for system headers and some special symbols (e.g. | |
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 37 of file CanonicalIncludes.h.
void clang::clangd::CanonicalIncludes::addMapping | ( | FileEntryRef | Header, |
llvm::StringRef | CanonicalPath | ||
) |
Adds a file-to-string mapping from ID
to CanonicalPath
.
Definition at line 672 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 752 of file CanonicalIncludes.cpp.
llvm::StringRef clang::clangd::CanonicalIncludes::mapHeader | ( | FileEntryRef | Header | ) | const |
Returns the overridden include for files in Header
, or "".
Definition at line 681 of file CanonicalIncludes.cpp.
References Filename, and clang::clangd::MaxSuffixComponents.
llvm::StringRef clang::clangd::CanonicalIncludes::mapSymbol | ( | llvm::StringRef | Scope, |
llvm::StringRef | Name, | ||
const LangOptions & | L | ||
) | const |
Returns the overridden include for a qualified symbol with, or "".
Scope
and Name
concatenation forms the fully qualified name. Scope
is the qualifier with the trailing "::" (e.g. "std::") or empty (for global namespace).
Definition at line 704 of file CanonicalIncludes.cpp.
References Name.
Referenced by clang::clangd::SymbolCollector::finish().