11#include "llvm/ADT/SmallString.h"
12#include "llvm/Support/Path.h"
15namespace find_all_symbols {
19 llvm::StringRef FilePath;
22 if (!
Loc.isValid() || SM.isInMainFile(
Loc))
24 FilePath = SM.getFilename(
Loc);
27 if (!FilePath.ends_with(
".inc"))
29 FileID
ID = SM.getFileID(
Loc);
30 Loc = SM.getIncludeLoc(
ID);
34 FilePath = Collector->getMappedHeader(FilePath);
35 SmallString<256> CleanedFilePath = FilePath;
36 llvm::sys::path::remove_dots(CleanedFilePath,
false);
38 return std::string(CleanedFilePath);
std::string getIncludePath(const SourceManager &SM, SourceLocation Loc, const HeaderMapCollector *Collector)
This calculates the include path for Loc.
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//