[Lldb-commits] [lldb] [lldb] move XcodeSDK's sysroot into a separate class (PR #144396)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Tue Jun 17 07:52:34 PDT 2025


================
@@ -0,0 +1,48 @@
+//===-- XcodeSDK.h ----------------------------------------------*- C++ -*-===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_UTILITY_SDK_PATH_H
+#define LLDB_UTILITY_SDK_PATH_H
+
+#include "lldb/Utility/FileSpec.h"
+#include "lldb/Utility/XcodeSDK.h"
+
+namespace llvm {
+class Triple;
+}
+
+namespace lldb_private {
+
+/// An abstraction which groups an XcodeSDK with its parsed path.
+class XcodeSDKPath {
+  XcodeSDK m_sdk;
+  FileSpec m_sysroot;
+
+public:
+  /// Default constructor, constructs an empty sdk with an empty path.
+  XcodeSDKPath() = default;
+  XcodeSDKPath(XcodeSDK sdk, FileSpec sysroot)
+      : m_sdk(std::move(sdk)), m_sysroot(std::move(sysroot)) {}
+  XcodeSDKPath(std::string name, FileSpec sysroot)
+      : m_sdk(XcodeSDK(std::move(name))), m_sysroot(std::move(sysroot)) {}
+
+  bool operator==(const XcodeSDKPath &other) const;
+  bool operator!=(const XcodeSDKPath &other) const;
+
+  XcodeSDK TakeSDK() const;
----------------
JDevlieghere wrote:

```suggestion
  XcodeSDK GetSDK() const;
```

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


More information about the lldb-commits mailing list