[clang] [clang][Darwin] Simplify deployment version assignment in the Driver (PR #142013)

Steven Wu via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 3 09:58:04 PDT 2025


================
@@ -1938,11 +1942,22 @@ struct DarwinPlatform {
   SourceKind Kind;
   DarwinPlatformKind Platform;
   DarwinEnvironmentKind Environment = DarwinEnvironmentKind::NativeEnvironment;
-  VersionTuple NativeTargetVersion;
-  std::string OSVersion;
-  bool HasOSVersion = true, InferSimulatorFromArch = true;
+  // When compiling for a zippered target, this means both target &
+  // target variant is set on the command line, ZipperedOSVersion holds the
+  // OSVersion tied to the main target value.
+  VersionTuple ZipperedOSVersion;
+  // We allow multiple ways to set or default the OS
+  // version used for compilation. The ResolvedOSVersion always represents what
+  // will be used.
+  VersionTuple ResolvedOSVersion;
----------------
cachemeifyoucan wrote:

The only complaint now is I am not sure `ResolvedOSVersion` is a good name here, or maybe we can fix the implementation to make it a truly "resolved" version number. I don't like this is being initialized with being "resolved", you can get it before set it.

Ideally, I hope there is an explicit resolve function needs to be called before this is available.

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


More information about the cfe-commits mailing list