[clang] [llvm] [clang][driver][darwin] Base the system prefix on the SDK, not the target (PR #171970)

Cyndy Ishida via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 23 09:22:13 PST 2025


================
@@ -28,6 +32,38 @@ namespace clang {
 /// The information about the darwin SDK that was used during this compilation.
 class DarwinSDKInfo {
 public:
+  /// Information about the supported platforms in the SDK
+  struct SupportedPlatform {
+  public:
+    SupportedPlatform(llvm::Triple::VendorType Vendor, llvm::Triple::OSType OS,
+                      llvm::Triple::EnvironmentType Environment,
+                      llvm::Triple::ObjectFormatType ObjectFormat,
+                      StringRef SystemPrefix)
+        : Vendor(Vendor), OS(OS), Environment(Environment),
+          ObjectFormat(ObjectFormat), SystemPrefix(SystemPrefix) {}
+
+    llvm::Triple::VendorType getVendor() const { return Vendor; }
+    llvm::Triple::OSType getOS() const { return OS; }
+    llvm::Triple::EnvironmentType getEnvironment() const { return Environment; }
+    llvm::Triple::ObjectFormatType getObjectFormat() const {
+      return ObjectFormat;
+    }
+    StringRef getSystemPrefix() const { return SystemPrefix; }
+
+    bool operator==(const llvm::Triple &RHS) const {
+      return (Vendor == RHS.getVendor()) && (OS == RHS.getOS()) &&
+             (Environment == RHS.getEnvironment()) &&
+             (ObjectFormat == RHS.getObjectFormat());
+    }
+
+  private:
+    llvm::Triple::VendorType Vendor;
+    llvm::Triple::OSType OS;
+    llvm::Triple::EnvironmentType Environment;
+    llvm::Triple::ObjectFormatType ObjectFormat;
+    std::string SystemPrefix;
+  };
+
   /// A value that describes two os-environment pairs that can be used as a key
   /// to the version map in the SDK.
   struct OSEnvPair {
----------------
cyndyishida wrote:

Not necessary for this PR, but it seems like this type can be defined from "SupportedPlatform", it would be good to unify here.

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


More information about the llvm-commits mailing list