================
@@ -397,9 +397,91 @@ void 
ModuleDepCollector::applyDiscoveredDependencies(CompilerInvocation &CI) {
   }
 }
 
+static bool isSafeToIgnoreCWD(const CowCompilerInvocation &CI) {
+  // Check if the command line input uses relative paths.
+  // It is not safe to ignore the current working directory if any of the
+  // command line inputs use relative paths.
+#define IF_RELATIVE_RETURN_FALSE(PATH)                                         
\
+  do {                                                                         
\
+    if (!PATH.empty() && !llvm::sys::path::is_absolute(PATH))                  
\
+      return false;                                                            
\
+  } while (0)
+
+#define IF_ANY_RELATIVE_RETURN_FALSE(PATHS)                                    
\
+  do {                                                                         
\
+    if (std::any_of(PATHS.begin(), PATHS.end(), [](const auto &P) {            
\
----------------
qiongsiwu wrote:

Fixed! Thanks! 

https://github.com/llvm/llvm-project/pull/124786
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to