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 -- 
lldb/test/API/python_api/sbvalue_set_type_synthetic/main.cpp 
lldb/test/API/python_api/sbvalue_set_type_synthetic_override/main.cpp 
lldb/include/lldb/API/SBValue.h 
lldb/include/lldb/DataFormatters/TypeSynthetic.h 
lldb/include/lldb/ValueObject/ValueObject.h 
lldb/include/lldb/ValueObject/ValueObjectSynthetic.h 
lldb/source/API/SBValue.cpp lldb/source/DataFormatters/TypeSynthetic.cpp 
lldb/source/ValueObject/ValueObject.cpp 
lldb/source/ValueObject/ValueObjectSynthetic.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/lldb/test/API/python_api/sbvalue_set_type_synthetic/main.cpp 
b/lldb/test/API/python_api/sbvalue_set_type_synthetic/main.cpp
index 150eca4c5..d9e67bff5 100644
--- a/lldb/test/API/python_api/sbvalue_set_type_synthetic/main.cpp
+++ b/lldb/test/API/python_api/sbvalue_set_type_synthetic/main.cpp
@@ -2,7 +2,7 @@
 // library_c_api.h - Mock type erased C API for library
 #include <cstddef>
 
-typedef void* Handle;
+typedef void *Handle;
 
 typedef Handle FooHandle;
 typedef Handle BarHandle;
@@ -10,7 +10,7 @@ typedef Handle BarHandle;
 // To minimize API surface, the C API has a single type for arrays of handles
 struct HandleArray {
   size_t size;
-  Handle* data;
+  Handle *data;
 };
 
 struct SessionInfo {
@@ -21,11 +21,11 @@ struct SessionInfo {
 };
 
 extern "C" {
-  void InitSession();
-  void StopSession();
+void InitSession();
+void StopSession();
 
-  void ReadSessionInfo(SessionInfo* into);
-  void FreeSessionInfo(SessionInfo* info);
+void ReadSessionInfo(SessionInfo *into);
+void FreeSessionInfo(SessionInfo *info);
 }
 
 // library.cpp
@@ -43,45 +43,45 @@ static std::vector<std::unique_ptr<Foo>> g_foos;
 static std::vector<std::unique_ptr<Bar>> g_bars;
 
 extern "C" {
-  void InitSession() {
-    g_foos.emplace_back(new Foo{ .foo = 10 });
-    g_foos.emplace_back(new Foo{ .foo = 20 });
-    g_bars.emplace_back(new Bar{ .bar = false });
-  }
-  void StopSession() {
-    g_foos.clear();
-    g_bars.clear();
-  }
+void InitSession() {
+  g_foos.emplace_back(new Foo{.foo = 10});
+  g_foos.emplace_back(new Foo{.foo = 20});
+  g_bars.emplace_back(new Bar{.bar = false});
+}
+void StopSession() {
+  g_foos.clear();
+  g_bars.clear();
+}
 
-  void ReadSessionInfo(SessionInfo* into) {
-    into->foos.size = g_foos.size();
-    into->foos.data = (Handle*) malloc(sizeof(Handle) * g_foos.size());
-    for (size_t i = 0; i < g_foos.size(); i++) {
-      into->foos.data[i] = g_foos[i].get();
-    }
-
-    into->bars.size = g_bars.size();
-    into->bars.data = (Handle*) malloc(sizeof(Handle) * g_bars.size());
-    for (size_t i = 0; i < g_bars.size(); i++) {
-      into->bars.data[i] = g_bars[i].get();
-    }
+void ReadSessionInfo(SessionInfo *into) {
+  into->foos.size = g_foos.size();
+  into->foos.data = (Handle *)malloc(sizeof(Handle) * g_foos.size());
+  for (size_t i = 0; i < g_foos.size(); i++) {
+    into->foos.data[i] = g_foos[i].get();
   }
-  void FreeSessionInfo(SessionInfo* info) {
-    free(info->foos.data);
-    free(info->bars.data);
 
-    info->foos.size = 0;
-    info->foos.data = NULL;
-    info->bars.size = 0;
-    info->bars.data = NULL;
-  }  
-} 
+  into->bars.size = g_bars.size();
+  into->bars.data = (Handle *)malloc(sizeof(Handle) * g_bars.size());
+  for (size_t i = 0; i < g_bars.size(); i++) {
+    into->bars.data[i] = g_bars[i].get();
+  }
+}
+void FreeSessionInfo(SessionInfo *info) {
+  free(info->foos.data);
+  free(info->bars.data);
+
+  info->foos.size = 0;
+  info->foos.data = NULL;
+  info->bars.size = 0;
+  info->bars.data = NULL;
+}
+}
 
 // app.cpp - being debugged by library.cpp authors
 
 int main() {
   InitSession();
-  
+
   SessionInfo info;
   ReadSessionInfo(&info);
   FreeSessionInfo(&info); // break here

``````````

</details>


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

Reply via email to