[clang] [clang-repl] Delegate CodeGen related operations for PTU to IncrementalParser (PR #137458)

via cfe-commits cfe-commits at lists.llvm.org
Mon May 5 00:18:54 PDT 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff HEAD~1 HEAD --extensions cpp,h -- clang/lib/Interpreter/IncrementalAction.cpp clang/lib/Interpreter/IncrementalAction.h clang/include/clang/Interpreter/Interpreter.h clang/lib/Interpreter/DeviceOffload.cpp clang/lib/Interpreter/DeviceOffload.h clang/lib/Interpreter/IncrementalParser.cpp clang/lib/Interpreter/IncrementalParser.h clang/lib/Interpreter/Interpreter.cpp clang/lib/Interpreter/InterpreterValuePrinter.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/Interpreter/DeviceOffload.cpp b/clang/lib/Interpreter/DeviceOffload.cpp
index 30f51f98a..1d3c75e98 100644
--- a/clang/lib/Interpreter/DeviceOffload.cpp
+++ b/clang/lib/Interpreter/DeviceOffload.cpp
@@ -25,8 +25,8 @@
 namespace clang {
 
 IncrementalCUDADeviceParser::IncrementalCUDADeviceParser(
-    CompilerInstance &DeviceInstance,
-    CompilerInstance &HostInstance, IncrementalAction *DeviceAct,
+    CompilerInstance &DeviceInstance, CompilerInstance &HostInstance,
+    IncrementalAction *DeviceAct,
     llvm::IntrusiveRefCntPtr<llvm::vfs::InMemoryFileSystem> FS,
     llvm::Error &Err, std::list<PartialTranslationUnit> &PTUs)
     : IncrementalParser(DeviceInstance, DeviceAct, Err, PTUs), VFS(FS),
diff --git a/clang/lib/Interpreter/DeviceOffload.h b/clang/lib/Interpreter/DeviceOffload.h
index a7a098e52..a31bd5a04 100644
--- a/clang/lib/Interpreter/DeviceOffload.h
+++ b/clang/lib/Interpreter/DeviceOffload.h
@@ -28,8 +28,8 @@ class IncrementalCUDADeviceParser : public IncrementalParser {
 
 public:
   IncrementalCUDADeviceParser(
-      CompilerInstance &DeviceInstance,
-      CompilerInstance &HostInstance, IncrementalAction *DeviceAct,
+      CompilerInstance &DeviceInstance, CompilerInstance &HostInstance,
+      IncrementalAction *DeviceAct,
       llvm::IntrusiveRefCntPtr<llvm::vfs::InMemoryFileSystem> VFS,
       llvm::Error &Err, std::list<PartialTranslationUnit> &PTUs);
 
diff --git a/clang/lib/Interpreter/IncrementalAction.cpp b/clang/lib/Interpreter/IncrementalAction.cpp
index 0815a90ef..2f269718b 100644
--- a/clang/lib/Interpreter/IncrementalAction.cpp
+++ b/clang/lib/Interpreter/IncrementalAction.cpp
@@ -90,7 +90,7 @@ void IncrementalAction::CacheCodeGenModule() {
   CachedInCodeGenModule = GenModule();
 }
 
-llvm::Module* IncrementalAction::getCachedCodeGenModule() const {
+llvm::Module *IncrementalAction::getCachedCodeGenModule() const {
   return CachedInCodeGenModule.get();
 }
 
diff --git a/clang/lib/Interpreter/IncrementalAction.h b/clang/lib/Interpreter/IncrementalAction.h
index 15b23e284..92eabacd4 100644
--- a/clang/lib/Interpreter/IncrementalAction.h
+++ b/clang/lib/Interpreter/IncrementalAction.h
@@ -67,7 +67,7 @@ public:
   void CacheCodeGenModule();
 
   /// Access the cached CodeGen module.
-  llvm::Module* getCachedCodeGenModule() const;
+  llvm::Module *getCachedCodeGenModule() const;
 
   /// Access the current code generator.
   CodeGenerator *getCodeGen() const;
diff --git a/clang/lib/Interpreter/Interpreter.cpp b/clang/lib/Interpreter/Interpreter.cpp
index 023c0f31b..e54a3242b 100644
--- a/clang/lib/Interpreter/Interpreter.cpp
+++ b/clang/lib/Interpreter/Interpreter.cpp
@@ -395,8 +395,8 @@ Interpreter::createWithCUDA(std::unique_ptr<CompilerInstance> CI,
   Interp->DeviceCI = std::move(DCI);
 
   auto DeviceParser = std::make_unique<IncrementalCUDADeviceParser>(
-      *Interp->DeviceCI, *Interp->getCompilerInstance(), Interp->DeviceAct.get(),
-      IMVFS, Err, Interp->PTUs);
+      *Interp->DeviceCI, *Interp->getCompilerInstance(),
+      Interp->DeviceAct.get(), IMVFS, Err, Interp->PTUs);
 
   if (Err)
     return std::move(Err);

``````````

</details>


https://github.com/llvm/llvm-project/pull/137458


More information about the cfe-commits mailing list