diff options
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
| -rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index 5844366..6b09f7f 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -160,8 +160,6 @@ bool CompilerInstance::createTarget() { } void CompilerInstance::setFileManager(IntrusiveRefCntPtr<FileManager> Value) { - if (!hasVirtualFileSystem()) - setVirtualFileSystem(Value->getVirtualFileSystemPtr()); assert(Value == nullptr || getVirtualFileSystemPtr() == Value->getVirtualFileSystemPtr()); FileMgr = std::move(Value); @@ -548,14 +546,11 @@ void CompilerInstance::createPreprocessor(TranslationUnitKind TUKind) { std::string CompilerInstance::getSpecificModuleCachePath(StringRef ModuleHash) { assert(FileMgr && "Specific module cache path requires a FileManager"); - if (getHeaderSearchOpts().ModuleCachePath.empty()) - return ""; - // Set up the module path, including the hash for the module-creation options. SmallString<256> SpecificModuleCache; normalizeModuleCachePath(*FileMgr, getHeaderSearchOpts().ModuleCachePath, SpecificModuleCache); - if (!getHeaderSearchOpts().DisableModuleHash) + if (!SpecificModuleCache.empty() && !getHeaderSearchOpts().DisableModuleHash) llvm::sys::path::append(SpecificModuleCache, ModuleHash); return std::string(SpecificModuleCache); } @@ -887,7 +882,7 @@ CompilerInstance::createOutputFileImpl(StringRef OutputPath, bool Binary, "File Manager is required to fix up relative path.\n"); AbsPath.emplace(OutputPath); - FileMgr->FixupRelativePath(*AbsPath); + FileManager::fixupRelativePath(getFileSystemOpts(), *AbsPath); OutputPath = *AbsPath; } |
