Merge pull request #5061 from lplarson/coverage-abspath

[coverage] Pass abspath of coverage-db to build-script-impl
diff --git a/cmake/modules/SwiftComponents.cmake b/cmake/modules/SwiftComponents.cmake
index d2c3baf..c79ca52 100644
--- a/cmake/modules/SwiftComponents.cmake
+++ b/cmake/modules/SwiftComponents.cmake
@@ -126,7 +126,10 @@
 function(swift_install_symlink_component component)
   cmake_parse_arguments(
       ARG # prefix
-      "" "LINK_NAME;TARGET;DESTINATION" "" ${ARGN})
+      "" # options
+      "LINK_NAME;TARGET;DESTINATION" # single-value args
+      "" # multi-value args
+      ${ARGN})
   precondition(ARG_LINK_NAME MESSAGE "LINK_NAME is required")
   precondition(ARG_TARGET MESSAGE "TARGET is required")
   precondition(ARG_DESTINATION MESSAGE "DESTINATION is required")
@@ -136,12 +139,9 @@
     return()
   endif()
 
-  foreach(path ${CMAKE_MODULE_PATH})
-    if(EXISTS ${path}/LLVMInstallSymlink.cmake)
-      set(INSTALL_SYMLINK ${path}/LLVMInstallSymlink.cmake)
-      break()
-    endif()
-  endforeach()
+  if(EXISTS ${LLVM_CMAKE_DIR}/LLVMInstallSymlink.cmake)
+    set(INSTALL_SYMLINK ${LLVM_CMAKE_DIR}/LLVMInstallSymlink.cmake)
+  endif()
   precondition(INSTALL_SYMLINK
     MESSAGE "LLVMInstallSymlink script must be available.")
 
diff --git a/cmake/modules/SwiftSharedCMakeConfig.cmake b/cmake/modules/SwiftSharedCMakeConfig.cmake
index 5f0dda9..fd91d64 100644
--- a/cmake/modules/SwiftSharedCMakeConfig.cmake
+++ b/cmake/modules/SwiftSharedCMakeConfig.cmake
@@ -230,6 +230,7 @@
   set(${product}_NATIVE_CLANG_TOOLS_PATH "${CMAKE_BINARY_DIR}/bin")
   set(LLVM_PACKAGE_VERSION ${PACKAGE_VERSION})
   set(SWIFT_TABLEGEN_EXE llvm-tblgen)
+  set(LLVM_CMAKE_DIR "${CMAKE_SOURCE_DIR}/cmake/modules")
 
   # If cmark was checked out into tools/cmark, expect to build it as
   # part of the unified build.
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index a097a18..c71ea9c 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -147,7 +147,7 @@
 
   if(NOT "${COVERAGE_DB}" STREQUAL "")
     add_custom_target("touch-covering-tests"
-        COMMAND "${SWIFT_SOURCE_DIR}/utils/coverage-touch-tests" "--swift-dir" "${SWIFT_SOURCE_DIR}" "--coverage-db" "${COVERAGE_DB}"
+        COMMAND "${SWIFT_SOURCE_DIR}/utils/coverage/coverage-touch-tests" "--swift-dir" "${SWIFT_SOURCE_DIR}" "--coverage-db" "${COVERAGE_DB}"
         COMMENT "Touching covering tests")
   endif()