diff options
Diffstat (limited to 'clang-tools-extra/include-fixer/IncludeFixerContext.h')
-rw-r--r-- | clang-tools-extra/include-fixer/IncludeFixerContext.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/clang-tools-extra/include-fixer/IncludeFixerContext.h b/clang-tools-extra/include-fixer/IncludeFixerContext.h index e40aed656f2..3c44574b846 100644 --- a/clang-tools-extra/include-fixer/IncludeFixerContext.h +++ b/clang-tools-extra/include-fixer/IncludeFixerContext.h @@ -18,7 +18,8 @@ namespace clang { namespace include_fixer { -/// \brief A context for the symbol being queried. +/// \brief A context for a file being processed. It includes all query +/// information, e.g. symbols being queried in database, all header candidates. class IncludeFixerContext { public: struct HeaderInfo { @@ -46,7 +47,8 @@ public: }; IncludeFixerContext() = default; - IncludeFixerContext(std::vector<QuerySymbolInfo> QuerySymbols, + IncludeFixerContext(StringRef FilePath, + std::vector<QuerySymbolInfo> QuerySymbols, std::vector<find_all_symbols::SymbolInfo> Symbols); /// \brief Get symbol name. @@ -59,6 +61,9 @@ public: return QuerySymbolInfos.front().Range; } + /// \brief Get the file path to the file being processed. + StringRef getFilePath() const { return FilePath; } + /// \brief Get header information. const std::vector<HeaderInfo> &getHeaderInfos() const { return HeaderInfos; } @@ -70,6 +75,9 @@ public: private: friend struct llvm::yaml::MappingTraits<IncludeFixerContext>; + /// \brief The file path to the file being processed. + std::string FilePath; + /// \brief All instances of an unidentified symbol being queried. std::vector<QuerySymbolInfo> QuerySymbolInfos; |