================ @@ -157,6 +157,32 @@ static void optimizeCWD(CowCompilerInvocation &BuildInvocation, StringRef CWD) { } } +/// Check a subset of invocation options to determine whether the current +/// context can safely be considered as shareable. +static bool areOptionsInSharedDir(CowCompilerInvocation &BuildInvocation, + const ArrayRef<StringRef> SharedDirs) { + const auto &HSOpts = BuildInvocation.getHeaderSearchOpts(); + if (!isPathInSharedDir(SharedDirs, HSOpts.Sysroot)) ---------------- benlangmuir wrote:
Should the first two checks be asserts since we derive sharable directories from sysroot and resource dir? Or is there a case where they will differ? https://github.com/llvm/llvm-project/pull/130634 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits