Skip to content

Commit d18c471

Browse files
committed
[clang][Darwin] Simplify deployment version assignment in the Driver (llvm#142013)
To be able to handle all of the ways the platform & deployment version can be represented in command line flags, the Darwin toolchain holds a type `DarwinPlatform` to help represent them. This patch simplifies the logic by: * reducing the amount of work done between string & version tuples conversions * renaming variables to reduce confusion about what target triple information is being manipulated. * allowing implicit transformation of macOS10.16 -> 11, there are other places in the compiler where this happens, and it was a bit confusing that the driver didn't do that for the cc1 call. This is not a major refactor, but more simple & common tweaks across the file, in hopes to make it more readable. (cherry picked from commit 752adc3)
1 parent 720d1c7 commit d18c471

File tree

4 files changed

+222
-147
lines changed

4 files changed

+222
-147
lines changed

clang/include/clang/Basic/DiagnosticDriverKinds.td

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,9 @@ def err_drv_cannot_open_randomize_layout_seed_file : Error<
205205
"cannot read randomize layout seed file '%0'">;
206206
def err_drv_invalid_version_number : Error<
207207
"invalid version number in '%0'">;
208+
def err_drv_missing_version_number : Error<"missing version number in '%0'">;
209+
def err_drv_kcfi_arity_unsupported_target : Error<
210+
"target '%0' is unsupported by -fsanitize-kcfi-arity">;
208211
def err_drv_no_linker_llvm_support : Error<
209212
"'%0': unable to pass LLVM bit-code files to linker">;
210213
def err_drv_no_ast_support : Error<
@@ -480,6 +483,9 @@ def warn_ignoring_ftabstop_value : Warning<
480483
def warn_drv_overriding_option : Warning<
481484
"overriding '%0' option with '%1'">,
482485
InGroup<DiagGroup<"overriding-option">>;
486+
def warn_drv_overriding_deployment_version
487+
: Warning<"overriding deployment version from '%0' to '%1'">,
488+
InGroup<DiagGroup<"overriding-deployment-version">>;
483489
def warn_drv_treating_input_as_cxx : Warning<
484490
"treating '%0' input as '%1' when in C++ mode, this behavior is deprecated">,
485491
InGroup<Deprecated>;

0 commit comments

Comments
 (0)