[Driver][Darwin] Use Host Triple to infer target os version
authorSteven Wu <stevenwu@apple.com>
Tue, 3 Jul 2018 04:15:49 +0000 (04:15 +0000)
committerSteven Wu <stevenwu@apple.com>
Tue, 3 Jul 2018 04:15:49 +0000 (04:15 +0000)
commitdfaeda652003e27649d6bc3412290e2fe3ed6b1d
tree034d6c59d2e3bf5387404716b1df00dcfffa8c9b
parentdc62c17dd66d77a4779395adabb8c28da756689f
[Driver][Darwin] Use Host Triple to infer target os version

Summary:
When clang required to infer target os version from --target option and
the os version is not specified in targets, check the host triple. If the
host and target are both macOS, use host triple to infer target os
version.

rdar://problem/41651999

Reviewers: arphaman, dexonsmith

Reviewed By: arphaman

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D48849

llvm-svn: 336168
clang/lib/Driver/ToolChains/Darwin.cpp
clang/test/Driver/clang-g-opts.c
clang/test/Driver/target-triple-deployment.c