Skip to content

Commit fca2109

Browse files
committed
[clang][NFC] Make HeaderSearch::suggestPathToFileForDiagnostics method const.
1 parent 9694e0f commit fca2109

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

clang/include/clang/Lex/HeaderSearch.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,7 @@ class HeaderSearch {
867867
/// path is relative to a system header directory.
868868
std::string suggestPathToFileForDiagnostics(const FileEntry *File,
869869
llvm::StringRef MainFile,
870-
bool *IsSystem = nullptr);
870+
bool *IsSystem = nullptr) const;
871871

872872
/// Suggest a path by which the specified file could be found, for use in
873873
/// diagnostics to suggest a #include. Returned path will only contain forward
@@ -881,7 +881,7 @@ class HeaderSearch {
881881
std::string suggestPathToFileForDiagnostics(llvm::StringRef File,
882882
llvm::StringRef WorkingDir,
883883
llvm::StringRef MainFile,
884-
bool *IsSystem = nullptr);
884+
bool *IsSystem = nullptr) const;
885885

886886
void PrintStats();
887887

clang/lib/Lex/HeaderSearch.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1919,7 +1919,7 @@ void HeaderSearch::loadSubdirectoryModuleMaps(DirectoryLookup &SearchDir) {
19191919
}
19201920

19211921
std::string HeaderSearch::suggestPathToFileForDiagnostics(
1922-
const FileEntry *File, llvm::StringRef MainFile, bool *IsSystem) {
1922+
const FileEntry *File, llvm::StringRef MainFile, bool *IsSystem) const {
19231923
// FIXME: We assume that the path name currently cached in the FileEntry is
19241924
// the most appropriate one for this analysis (and that it's spelled the
19251925
// same way as the corresponding header search path).
@@ -1929,7 +1929,7 @@ std::string HeaderSearch::suggestPathToFileForDiagnostics(
19291929

19301930
std::string HeaderSearch::suggestPathToFileForDiagnostics(
19311931
llvm::StringRef File, llvm::StringRef WorkingDir, llvm::StringRef MainFile,
1932-
bool *IsSystem) {
1932+
bool *IsSystem) const {
19331933
using namespace llvm::sys;
19341934

19351935
llvm::SmallString<32> FilePath = File;

0 commit comments

Comments
 (0)