Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion clang/lib/Headers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,14 @@ set(hlsl_files
${hlsl_subdir_files}
)

set(swift_bridging_files
swift/bridging
swift/bridging.h
swift/bridging.modulemap # Note: the modulemap isn't named module.modulemap
# because that would allow #include <bridging>;
# we only want #include <swift/bridging>.
)

set(loongarch_files
larchintrin.h
lasxintrin.h
Expand Down Expand Up @@ -468,7 +476,7 @@ endfunction(clang_generate_header)
foreach( f ${files} ${cuda_wrapper_files} ${cuda_wrapper_bits_files}
${cuda_wrapper_utility_files} ${ppc_wrapper_files} ${openmp_wrapper_files}
${zos_wrapper_files} ${hlsl_files} ${llvm_libc_wrapper_files}
${llvm_offload_wrapper_files})
${llvm_offload_wrapper_files} ${swift_bridging_files})
copy_header_to_output_dir(${CMAKE_CURRENT_SOURCE_DIR} ${f})
endforeach( f )

Expand Down Expand Up @@ -570,6 +578,7 @@ add_dependencies("clang-resource-headers"
"ppc-htm-resource-headers"
"riscv-resource-headers"
"spirv-resource-headers"
"swift-bridging-resource-headers"
"systemz-resource-headers"
"ve-resource-headers"
"webassembly-resource-headers"
Expand Down Expand Up @@ -603,6 +612,7 @@ add_header_target("gpu-resource-headers" "${gpu_files}")

# Other header groupings
add_header_target("hlsl-resource-headers" "${hlsl_files};${hlsl_generated_files}")
add_header_target("swift-bridging-resource-headers" ${swift_bridging_files})
add_header_target("spirv-resource-headers" ${spirv_files})
add_header_target("opencl-resource-headers" ${opencl_files})
add_header_target("llvm-libc-resource-headers" ${llvm_libc_wrapper_files})
Expand Down Expand Up @@ -664,6 +674,11 @@ install(
DESTINATION ${header_install_dir}/zos_wrappers
COMPONENT clang-resource-headers)

install(
FILES ${swift_bridging_files}
DESTINATION ${header_install_dir}/swift
COMPONENT clang-resource-headers)

#############################################################
# Install rules for separate header lists
install(
Expand Down Expand Up @@ -826,6 +841,12 @@ install(
${EXCLUDE_HLSL}
COMPONENT hlsl-resource-headers)

install(
FILES ${swift_bridging_files}
DESTINATION ${header_install_dir}/swift
EXCLUDE_FROM_ALL
COMPONENT swift-bridging-resource-headers)

install(
FILES ${spirv_files}
DESTINATION ${header_install_dir}
Expand Down Expand Up @@ -920,6 +941,9 @@ if (NOT LLVM_ENABLE_IDE)
add_llvm_install_targets(install-hlsl-resource-headers
DEPENDS hlsl-resource-headers
COMPONENT hlsl-resource-headers)
add_llvm_install_targets(install-swift-bridging-resource-headers
DEPENDS swift-bridging-resource-headers
COMPONENT swift-bridging-resource-headers)
add_llvm_install_targets(install-opencl-resource-headers
DEPENDS opencl-resource-headers
COMPONENT opencl-resource-headers)
Expand Down
2 changes: 2 additions & 0 deletions clang/lib/Headers/module.modulemap
Original file line number Diff line number Diff line change
Expand Up @@ -397,3 +397,5 @@ module lifetimebound [system] {
export *
}
/* TO_UPSTREAM(Lifetimebound) OFF */

extern module SwiftBridging "swift/bridging.modulemap"
19 changes: 19 additions & 0 deletions clang/lib/Headers/swift/bridging
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//===--- bridging - Swift and [Obj]C[++] Interop ----------------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2026 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//
// This file is a C++ compatibility alias for swift/bridging.h, which provides
// annotations for C, ObjC, and C++ code written to interoperate with Swift.
//
//===----------------------------------------------------------------------===//

#pragma once
#include <swift/bridging.h>
Loading