[builtins] Cleanup generic-file filtering
authorRyan Prichard <rprichard@google.com>
Fri, 19 Jun 2020 06:59:36 +0000 (23:59 -0700)
committerRyan Prichard <rprichard@google.com>
Mon, 13 Jul 2020 23:53:07 +0000 (16:53 -0700)
commit8cbb6ccc7fcb4184724b57ab78d7839469158c5b
tree3eb08f839e2204edaf5956de69c060aeb11a8e9a
parentf398e0f3d1fd56e5d06e95f3522bdcde48310088
[builtins] Cleanup generic-file filtering

Split filter_builtin_sources into two functions:
 - filter_builtin_sources that removes generic files when an
   arch-specific file is selected.
 - darwin_filter_builtin_sources that implements the EXCLUDE/INCLUDE
   lists (using the files in lib/builtins/Darwin-excludes).

darwin_filter_builtin_sources delegates to filter_builtin_sources.

Previously, lib/builtins/CMakeLists.txt had a number of calls to
filter_builtin_sources (with a confusing/broken use of the
`excluded_list` parameter), as well as a redundant arch-vs-generic
filtering for the non-Apple code path at the end of the file. Replace
all of this with a single call to filter_builtin_sources.

Remove i686_SOURCES. Previously, this list contained only the
arch-specific files common to 32-bit and 64-bit x86, which is a strange
set. Normally the ${ARCH}_SOURCES list contains everything needed for
the arch. "i686" isn't in ALL_BUILTIN_SUPPORTED_ARCH.

NFCI, but i686_SOURCES won't be defined, and the order of files in
${arch}_SOURCES lists will change.

Differential Revision: https://reviews.llvm.org/D82151
compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake
compiler-rt/cmake/Modules/CompilerRTUtils.cmake
compiler-rt/lib/builtins/CMakeLists.txt