https://github.com/CarvedCoder updated 
https://github.com/llvm/llvm-project/pull/174560

>From f2d386e156e2e3197e8e86510e5c23b034cefcd4 Mon Sep 17 00:00:00 2001
From: CarvedCoder <[email protected]>
Date: Wed, 7 Jan 2026 12:57:47 +0530
Subject: [PATCH 1/2] [Clang][Modules] Emit C++20 BMIs to working directory
 with -fmodule-output

---
 clang/lib/Driver/ToolChains/Clang.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/clang/lib/Driver/ToolChains/Clang.cpp 
b/clang/lib/Driver/ToolChains/Clang.cpp
index 8692200b40a69..ff67aa5ea0f81 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -3783,8 +3783,11 @@ 
clang::driver::tools::getCXX20NamedModuleOutputPath(const ArgList &Args,
   if (Arg *FinalOutput = Args.getLastArg(options::OPT_o);
       FinalOutput && Args.hasArg(options::OPT_c))
     OutputPath = FinalOutput->getValue();
-  else
-    OutputPath = BaseInput;
+  else{
+    llvm::sys::fs::current_path(OutputPath);
+    llvm::sys::path::append(OutputPath,llvm::sys::path::filename(BaseInput));
+  }
+
 
   const char *Extension = types::getTypeTempSuffix(types::TY_ModuleFile);
   llvm::sys::path::replace_extension(OutputPath, Extension);

>From 5f837b872252b0b31500797ae8d01e22c287c84f Mon Sep 17 00:00:00 2001
From: CarvedCoder <[email protected]>
Date: Wed, 7 Jan 2026 12:58:22 +0530
Subject: [PATCH 2/2] [Clang][Modules] Emit C++20 BMIs to working directory
 with -fmodule-output

---
 clang/lib/Driver/ToolChains/Clang.cpp | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/clang/lib/Driver/ToolChains/Clang.cpp 
b/clang/lib/Driver/ToolChains/Clang.cpp
index ff67aa5ea0f81..47f2306e2f528 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -3783,12 +3783,11 @@ 
clang::driver::tools::getCXX20NamedModuleOutputPath(const ArgList &Args,
   if (Arg *FinalOutput = Args.getLastArg(options::OPT_o);
       FinalOutput && Args.hasArg(options::OPT_c))
     OutputPath = FinalOutput->getValue();
-  else{
+  else {
     llvm::sys::fs::current_path(OutputPath);
-    llvm::sys::path::append(OutputPath,llvm::sys::path::filename(BaseInput));
+    llvm::sys::path::append(OutputPath, llvm::sys::path::filename(BaseInput));
   }
 
-
   const char *Extension = types::getTypeTempSuffix(types::TY_ModuleFile);
   llvm::sys::path::replace_extension(OutputPath, Extension);
   return OutputPath;

_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to