[clang] [clang-repl] Added -hip option (PR #231783)

via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 14 00:39:19 PDT 2026


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 origin/main HEAD --extensions h,cpp -- clang/include/clang/Interpreter/Interpreter.h clang/lib/Interpreter/DeviceOffload.cpp clang/lib/Interpreter/DeviceOffload.h clang/lib/Interpreter/Interpreter.cpp clang/tools/clang-repl/ClangRepl.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

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

``````````diff
diff --git a/clang/lib/Interpreter/Interpreter.cpp b/clang/lib/Interpreter/Interpreter.cpp
index a902afc2b..d6c3d47e1 100644
--- a/clang/lib/Interpreter/Interpreter.cpp
+++ b/clang/lib/Interpreter/Interpreter.cpp
@@ -306,7 +306,8 @@ IncrementalCompilerBuilder::CreateCpp() {
 }
 
 llvm::Expected<std::unique_ptr<CompilerInstance>>
-IncrementalCompilerBuilder::createOffload(bool device, OffloadType Type = OffloadType::Detect) {
+IncrementalCompilerBuilder::createOffload(
+    bool device, OffloadType Type = OffloadType::Detect) {
   if (Type == OffloadType::Detect)
     return llvm::make_error<llvm::StringError>(
         "Detecting the device vendor is not supported yet.",
diff --git a/clang/tools/clang-repl/ClangRepl.cpp b/clang/tools/clang-repl/ClangRepl.cpp
index 7e3d1a7b1..3782c0b7f 100644
--- a/clang/tools/clang-repl/ClangRepl.cpp
+++ b/clang/tools/clang-repl/ClangRepl.cpp
@@ -313,9 +313,8 @@ int main(int argc, const char **argv) {
   IEB->UseSharedMemory = UseSharedMemory;
 
   // If both -cuda and -hip are passed, the one that appears later wins.
-  bool UseHip =
-      HipEnabled && (!CudaEnabled || HipEnabled.getPosition() >
-                                         CudaEnabled.getPosition());
+  bool UseHip = HipEnabled && (!CudaEnabled || HipEnabled.getPosition() >
+                                                   CudaEnabled.getPosition());
   bool DeviceEnabled = HipEnabled || CudaEnabled;
 
   clang::OffloadType OffloadKind =

``````````

</details>


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


More information about the cfe-commits mailing list