summaryrefslogtreecommitdiffstats
path: root/clang/tools/clang-format/ClangFormat.cpp
diff options
context:
space:
mode:
authorHarlan Haskins <harlan@harlanhaskins.com>2019-08-01 21:31:56 +0000
committerHarlan Haskins <harlan@harlanhaskins.com>2019-08-01 21:31:56 +0000
commit8d323d150610bed1feeb79d7a29c9958a4c8bcac (patch)
tree166514f9a8bba05ea1504afab5c319975a57675d /clang/tools/clang-format/ClangFormat.cpp
parent461f0722dd26487c1faa497ba37aabed1477a561 (diff)
downloadbcm5719-llvm-8d323d150610bed1feeb79d7a29c9958a4c8bcac.tar.gz
bcm5719-llvm-8d323d150610bed1feeb79d7a29c9958a4c8bcac.zip
[clang] Adopt new FileManager error-returning APIs
Update the callers of FileManager::getFile and FileManager::getDirectory to handle the new llvm::ErrorOr-returning methods. Signed-off-by: Harlan Haskins <harlan@apple.com> llvm-svn: 367616
Diffstat (limited to 'clang/tools/clang-format/ClangFormat.cpp')
-rw-r--r--clang/tools/clang-format/ClangFormat.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/tools/clang-format/ClangFormat.cpp b/clang/tools/clang-format/ClangFormat.cpp
index 60a7feb7119..c0c8dc0e2c7 100644
--- a/clang/tools/clang-format/ClangFormat.cpp
+++ b/clang/tools/clang-format/ClangFormat.cpp
@@ -117,7 +117,8 @@ static FileID createInMemoryFile(StringRef FileName, MemoryBuffer *Source,
SourceManager &Sources, FileManager &Files,
llvm::vfs::InMemoryFileSystem *MemFS) {
MemFS->addFileNoOwn(FileName, 0, Source);
- return Sources.createFileID(Files.getFile(FileName), SourceLocation(),
+ auto File = Files.getFile(FileName);
+ return Sources.createFileID(File ? *File : nullptr, SourceLocation(),
SrcMgr::C_User);
}
OpenPOWER on IntegriCloud