diff options
author | Harlan Haskins <harlan@harlanhaskins.com> | 2019-08-01 21:31:56 +0000 |
---|---|---|
committer | Harlan Haskins <harlan@harlanhaskins.com> | 2019-08-01 21:31:56 +0000 |
commit | 8d323d150610bed1feeb79d7a29c9958a4c8bcac (patch) | |
tree | 166514f9a8bba05ea1504afab5c319975a57675d /clang/lib/Serialization/GlobalModuleIndex.cpp | |
parent | 461f0722dd26487c1faa497ba37aabed1477a561 (diff) | |
download | llvm-8d323d150610bed1feeb79d7a29c9958a4c8bcac.zip llvm-8d323d150610bed1feeb79d7a29c9958a4c8bcac.tar.gz llvm-8d323d150610bed1feeb79d7a29c9958a4c8bcac.tar.bz2 |
[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/lib/Serialization/GlobalModuleIndex.cpp')
-rw-r--r-- | clang/lib/Serialization/GlobalModuleIndex.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/lib/Serialization/GlobalModuleIndex.cpp b/clang/lib/Serialization/GlobalModuleIndex.cpp index 2db8f83..1833ebb 100644 --- a/clang/lib/Serialization/GlobalModuleIndex.cpp +++ b/clang/lib/Serialization/GlobalModuleIndex.cpp @@ -657,7 +657,7 @@ llvm::Error GlobalModuleIndexBuilder::loadModuleFile(const FileEntry *File) { Idx += Length; // Find the imported module file. - const FileEntry *DependsOnFile + auto DependsOnFile = FileMgr.getFile(ImportedFile, /*OpenFile=*/false, /*CacheFailure=*/false); @@ -669,11 +669,11 @@ llvm::Error GlobalModuleIndexBuilder::loadModuleFile(const FileEntry *File) { // Save the information in ImportedModuleFileInfo so we can verify after // loading all pcms. ImportedModuleFiles.insert(std::make_pair( - DependsOnFile, ImportedModuleFileInfo(StoredSize, StoredModTime, - StoredSignature))); + *DependsOnFile, ImportedModuleFileInfo(StoredSize, StoredModTime, + StoredSignature))); // Record the dependency. - unsigned DependsOnID = getModuleFileInfo(DependsOnFile).ID; + unsigned DependsOnID = getModuleFileInfo(*DependsOnFile).ID; getModuleFileInfo(File).Dependencies.push_back(DependsOnID); } @@ -894,12 +894,12 @@ GlobalModuleIndex::writeIndex(FileManager &FileMgr, } // If we can't find the module file, skip it. - const FileEntry *ModuleFile = FileMgr.getFile(D->path()); + auto ModuleFile = FileMgr.getFile(D->path()); if (!ModuleFile) continue; // Load this module file. - if (llvm::Error Err = Builder.loadModuleFile(ModuleFile)) + if (llvm::Error Err = Builder.loadModuleFile(*ModuleFile)) return Err; } |