[Lldb-commits] [lldb] [lldb] Fix Intel PT plugin compile errors (PR #77252)

via lldb-commits lldb-commits at lists.llvm.org
Mon Jan 8 15:26:53 PST 2024


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 036e48e2f5f890e1f9574cdb610e2336f12038a2 77aa29a286cbf06a9959790ec26eb025ab5e3a16 -- lldb/source/Plugins/Trace/intel-pt/CommandObjectTraceStartIntelPT.cpp lldb/source/Plugins/Trace/intel-pt/DecodedThread.cpp lldb/source/Plugins/Trace/intel-pt/DecodedThread.h lldb/source/Plugins/Trace/intel-pt/LibiptDecoder.cpp lldb/source/Plugins/Trace/intel-pt/TraceCursorIntelPT.cpp lldb/source/Plugins/Trace/intel-pt/TraceIntelPTBundleLoader.cpp lldb/source/Target/ProcessTrace.cpp
``````````

</details>

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

``````````diff
diff --git a/lldb/source/Plugins/Trace/intel-pt/DecodedThread.cpp b/lldb/source/Plugins/Trace/intel-pt/DecodedThread.cpp
index cd9ede789b..9c075398d5 100644
--- a/lldb/source/Plugins/Trace/intel-pt/DecodedThread.cpp
+++ b/lldb/source/Plugins/Trace/intel-pt/DecodedThread.cpp
@@ -103,7 +103,7 @@ template <typename Data>
 DecodedThread::TraceItemStorage &
 DecodedThread::CreateNewTraceItem(lldb::TraceItemKind kind, Data &&data) {
   m_item_data.emplace_back(data);
-  
+
   if (m_last_tsc)
     (*m_last_tsc)->second.items_count++;
   if (m_last_nanoseconds)
@@ -235,10 +235,12 @@ const DecodedThread::ErrorStats &DecodedThread::GetErrorStats() const {
 
 lldb::TraceItemKind
 DecodedThread::GetItemKindByIndex(uint64_t item_index) const {
-  return std::visit(llvm::makeVisitor([] (const std::string &) { return lldb::eTraceItemKindError; },
-                                      [] (lldb::TraceEvent) { return lldb::eTraceItemKindEvent; },
-                                      [] (lldb::addr_t) { return lldb::eTraceItemKindInstruction; }),
-                    m_item_data[item_index]);
+  return std::visit(
+      llvm::makeVisitor(
+          [](const std::string &) { return lldb::eTraceItemKindError; },
+          [](lldb::TraceEvent) { return lldb::eTraceItemKindEvent; },
+          [](lldb::addr_t) { return lldb::eTraceItemKindInstruction; }),
+      m_item_data[item_index]);
 }
 
 llvm::StringRef DecodedThread::GetErrorByIndex(uint64_t item_index) const {
diff --git a/lldb/source/Plugins/Trace/intel-pt/DecodedThread.h b/lldb/source/Plugins/Trace/intel-pt/DecodedThread.h
index 6b5dd20909..a48c55cc76 100644
--- a/lldb/source/Plugins/Trace/intel-pt/DecodedThread.h
+++ b/lldb/source/Plugins/Trace/intel-pt/DecodedThread.h
@@ -266,14 +266,16 @@ private:
   /// to update \a CalculateApproximateMemoryUsage() accordingly.
   lldb::ThreadSP m_thread_sp;
 
-  using TraceItemStorage = std::variant<std::string, lldb::TraceEvent, lldb::addr_t>;
+  using TraceItemStorage =
+      std::variant<std::string, lldb::TraceEvent, lldb::addr_t>;
 
   /// Create a new trace item.
   ///
   /// \return
   ///   The index of the new item.
   template <typename Data>
-  DecodedThread::TraceItemStorage &CreateNewTraceItem(lldb::TraceItemKind kind, Data &&data);
+  DecodedThread::TraceItemStorage &CreateNewTraceItem(lldb::TraceItemKind kind,
+                                                      Data &&data);
 
   /// Most of the trace data is stored here.
   std::deque<TraceItemStorage> m_item_data;

``````````

</details>


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


More information about the lldb-commits mailing list