diff options
| author | Harlan Haskins <harlan@harlanhaskins.com> | 2019-08-01 21:32:01 +0000 |
|---|---|---|
| committer | Harlan Haskins <harlan@harlanhaskins.com> | 2019-08-01 21:32:01 +0000 |
| commit | a02f85768d2d1a77c7735ddd43226e1be51f3730 (patch) | |
| tree | 331b92c088cb3249848f387a358206770da95180 /clang-tools-extra/clang-include-fixer/IncludeFixer.cpp | |
| parent | 8d323d150610bed1feeb79d7a29c9958a4c8bcac (diff) | |
| download | bcm5719-llvm-a02f85768d2d1a77c7735ddd43226e1be51f3730.tar.gz bcm5719-llvm-a02f85768d2d1a77c7735ddd43226e1be51f3730.zip | |
[clang-tools-extra] Adopt FileManager's error-returning APIs
The FileManager has been updated to return llvm::ErrorOr from getFile
and getDirectory, this commit updates all the callers of those APIs from
clang.
llvm-svn: 367617
Diffstat (limited to 'clang-tools-extra/clang-include-fixer/IncludeFixer.cpp')
| -rw-r--r-- | clang-tools-extra/clang-include-fixer/IncludeFixer.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/clang-tools-extra/clang-include-fixer/IncludeFixer.cpp b/clang-tools-extra/clang-include-fixer/IncludeFixer.cpp index c4173426277..c07add2c760 100644 --- a/clang-tools-extra/clang-include-fixer/IncludeFixer.cpp +++ b/clang-tools-extra/clang-include-fixer/IncludeFixer.cpp @@ -306,8 +306,7 @@ std::string IncludeFixerSemaSource::minimizeInclude( // Get the FileEntry for the include. StringRef StrippedInclude = Include.trim("\"<>"); - const FileEntry *Entry = - SourceManager.getFileManager().getFile(StrippedInclude); + auto Entry = SourceManager.getFileManager().getFile(StrippedInclude); // If the file doesn't exist return the path from the database. // FIXME: This should never happen. @@ -316,7 +315,7 @@ std::string IncludeFixerSemaSource::minimizeInclude( bool IsSystem = false; std::string Suggestion = - HeaderSearch.suggestPathToFileForDiagnostics(Entry, "", &IsSystem); + HeaderSearch.suggestPathToFileForDiagnostics(*Entry, "", &IsSystem); return IsSystem ? '<' + Suggestion + '>' : '"' + Suggestion + '"'; } |

