11 #include "llvm/Support/Path.h" 14 namespace find_all_symbols {
18 llvm::StringRef FilePath;
21 if (!Loc.isValid() || SM.isInMainFile(Loc))
23 FilePath = SM.getFilename(Loc);
26 if (!FilePath.endswith(
".inc"))
28 FileID ID = SM.getFileID(Loc);
29 Loc = SM.getIncludeLoc(ID);
34 SmallString<256> CleanedFilePath = FilePath;
35 llvm::sys::path::remove_dots(CleanedFilePath,
false);
37 return CleanedFilePath.str();
SourceLocation Loc
'#' location in the include directive
std::string getIncludePath(const SourceManager &SM, SourceLocation Loc, const HeaderMapCollector *Collector)
This calculates the include path for Loc.
std::shared_ptr< SymbolCollector > Collector
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//