HomePhabricator

[lit] Refactor lit detection of macOS triples to use a centralized query in lit.

Authored by gottesmm on Jun 19 2016, 8:43 PM.

Description

[lit] Refactor lit detection of macOS triples to use a centralized query in lit.util.isMacOSTriple.

Currently, lit assumes that a triple is a macOS triple if it contains the string
'darwin' (pattern matching against $ARCH-apple-darwin$NUM). This is incorrect
since the $ARCH-apple-macosx$NUM triples are /also/ valid triples for
macOS. More importantly, turns out Swift is using this triple as well,
preventing a build-script built llvm from passing all of its unit tests on a
bot.

Given where we are in the schedule I don't want to touch the triples on either
projects, so instead I am adding this workaround, teaching lit that a triple
with macosx in it should have a 'darwin' supported_feature.

This commit centralizes all the places in LLVM to use the query,
lit.util.isMacOSTriple, instead of checking if 'darwin' is in a triple directly.

In subsequent commits I will:

  1. Change clang/compiler-rt's lit to use this utility function as well.
  2. Update isMacOSTriple to recognize other valid triples for macOS such as

triples that replace darwin with macosx (i.e. x86_64-apple-darwin vs
x86_64-apple-macosx).

rdar://26780128

apple-llvm-split-commit: 01436117652b41eb389ddbad9c9fd8df0de9b4b2
apple-llvm-split-dir: llvm/

Details

Committed
gottesmmJun 20 2016, 12:26 AM
Parents
rGd16f29f1a7cc: Propagating prior merge from 'llvm.org/master'.
Branches
Unknown
Tags
Unknown