[Lldb-commits] [lldb] [lldb] Add target groups for related targets (PR #229180)

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 12 11:51:18 PDT 2026


================
@@ -0,0 +1,109 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "lldb/Target/TargetGroup.h"
+#include "lldb/Target/Target.h"
+#include "lldb/Target/TargetGroupList.h"
+
+#include <algorithm>
+
+using namespace lldb;
+using namespace lldb_private;
+
+bool TargetGroup::AddTarget(const TargetSP &target_sp, TargetRole role) {
+  if (!target_sp || role == TargetRole::None)
----------------
clayborg wrote:

This seems wrong if someone specifies `TargetRole::None` and tries to add a target for it not to add it. Maybe we should we get rid of `TargetRole::None` all together in this patch as it can only cause problems. We can add a `TargetRole::Other` if needed, but users would need to specify this.

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


More information about the lldb-commits mailing list