diff options
author | Jan Svoboda <jan_svoboda@apple.com> | 2025-09-10 15:27:18 -0700 |
---|---|---|
committer | Jan Svoboda <jan_svoboda@apple.com> | 2025-09-10 15:27:54 -0700 |
commit | 613caa909c78f707e88960723c6a98364656a926 (patch) | |
tree | 8df1bbae63033816f9bf15d5f58c24c89c87ba9b /clang/lib/Frontend/CompilerInstance.cpp | |
parent | b8cefcb601ddaa18482555c4ff363c01a270c2fe (diff) | |
download | llvm-613caa909c78f707e88960723c6a98364656a926.zip llvm-613caa909c78f707e88960723c6a98364656a926.tar.gz llvm-613caa909c78f707e88960723c6a98364656a926.tar.bz2 |
Revert "[clang] Delay normalization of `-fmodules-cache-path` (#150123)"
This reverts commit 4a4bddec3571d78c8073fa45b57bbabc8796d13d. The Serialization library doesn't link Frontend, where CompilerInstance lives, causing link failures on some build bots.
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index 0a23e0b..8d1e9d6 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -553,25 +553,10 @@ void CompilerInstance::createPreprocessor(TranslationUnitKind TUKind) { PP->setDependencyDirectivesGetter(*GetDependencyDirectives); } -void CompilerInstance::normalizeModuleCachePath( - FileManager &FileMgr, StringRef Path, - SmallVectorImpl<char> &NormalizedPath) { - NormalizedPath.assign(Path.begin(), Path.end()); - FileMgr.makeAbsolutePath(NormalizedPath); - llvm::sys::path::remove_dots(NormalizedPath); -} - 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) + SmallString<256> SpecificModuleCache(getHeaderSearchOpts().ModuleCachePath); + if (!SpecificModuleCache.empty() && !getHeaderSearchOpts().DisableModuleHash) llvm::sys::path::append(SpecificModuleCache, ModuleHash); return std::string(SpecificModuleCache); } |