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 cpp,h -- 
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 
clang/unittests/Interpreter/DeviceOffloadTest.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/DeviceOffload.cpp 
b/clang/lib/Interpreter/DeviceOffload.cpp
index 25f870dbf..e010a44b4 100644
--- a/clang/lib/Interpreter/DeviceOffload.cpp
+++ b/clang/lib/Interpreter/DeviceOffload.cpp
@@ -127,9 +127,9 @@ IncrementalHIPDeviceParser::GenerateHSACO(llvm::StringRef 
Object) {
     Linker = LdPath;
   if (!Linker)
     return llvm::make_error<llvm::StringError>(
-        LdPath.empty() ? "Could not find lld."
-                       : "Invalid linker name in argument '--ld-path=" +
-                             LdPath + "'.",
+        LdPath.empty()
+            ? "Could not find lld."
+            : "Invalid linker name in argument '--ld-path=" + LdPath + "'.",
         llvm::inconvertibleErrorCode());
 
   int ObjFD = -1;
@@ -152,10 +152,10 @@ IncrementalHIPDeviceParser::GenerateHSACO(llvm::StringRef 
Object) {
   llvm::FileRemover HSACORemover(HSACOFile);
 
   // These match the driver's HIP device link (AMDGCN::Linker) for an object.
-  llvm::StringRef Args[] = {*Linker,         "-flavor",        "gnu",
-                            "-m",            "elf64_amdgpu",   
"--no-undefined",
-                            "-shared",       "--whole-archive", "-o",
-                            HSACOFile,       ObjFile,          
"--no-whole-archive"};
+  llvm::StringRef Args[] = {*Linker,   "-flavor",         "gnu",
+                            "-m",      "elf64_amdgpu",    "--no-undefined",
+                            "-shared", "--whole-archive", "-o",
+                            HSACOFile, ObjFile,           
"--no-whole-archive"};
   if (llvm::sys::ExecuteAndWait(*Linker, Args) != 0)
     return llvm::make_error<llvm::StringError>("The linker invocation failed.",
                                                llvm::inconvertibleErrorCode());
diff --git a/clang/lib/Interpreter/Interpreter.cpp 
b/clang/lib/Interpreter/Interpreter.cpp
index 13b58bcc3..b0fc3e143 100644
--- a/clang/lib/Interpreter/Interpreter.cpp
+++ b/clang/lib/Interpreter/Interpreter.cpp
@@ -569,11 +569,9 @@ llvm::Expected<std::unique_ptr<Interpreter>> 
Interpreter::create(
   return std::move(Interp);
 }
 
-llvm::Expected<std::unique_ptr<Interpreter>>
-Interpreter::createWithDevice(std::unique_ptr<CompilerInstance> CI,
-                              std::unique_ptr<CompilerInstance> DCI,
-                              OffloadType Type,
-                              llvm::ArrayRef<const char *> DriverArgs) {
+llvm::Expected<std::unique_ptr<Interpreter>> Interpreter::createWithDevice(
+    std::unique_ptr<CompilerInstance> CI, std::unique_ptr<CompilerInstance> 
DCI,
+    OffloadType Type, llvm::ArrayRef<const char *> DriverArgs) {
   if (Type == OffloadType::Detect)
     return llvm::make_error<llvm::StringError>(
         "Detecting the device vendor is not supported yet.",
diff --git a/clang/unittests/Interpreter/DeviceOffloadTest.cpp 
b/clang/unittests/Interpreter/DeviceOffloadTest.cpp
index ff3096d1f..d79af4812 100644
--- a/clang/unittests/Interpreter/DeviceOffloadTest.cpp
+++ b/clang/unittests/Interpreter/DeviceOffloadTest.cpp
@@ -159,10 +159,9 @@ TEST_F(DeviceOffloadHIPTest, DeviceObjectIsGenerated) {
   // FIXME: Replace this with a check of the embedded bundle once the offload
   // binary is generated.
   std::string Exe = llvm::sys::fs::getMainExecutable(nullptr, nullptr);
-  bool HasLLD =
-      llvm::sys::findProgramByName("lld",
-                                   {llvm::sys::path::parent_path(Exe)}) ||
-      llvm::sys::findProgramByName("lld");
+  bool HasLLD = llvm::sys::findProgramByName(
+                    "lld", {llvm::sys::path::parent_path(Exe)}) ||
+                llvm::sys::findProgramByName("lld");
   auto PTU = (*Interp)->Parse("__attribute__((device)) void f() {}");
   EXPECT_THAT_EXPECTED(
       PTU, llvm::FailedWithMessage(

``````````

</details>


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

Reply via email to