150
|
1 set(files
|
|
2 adxintrin.h
|
|
3 altivec.h
|
|
4 ammintrin.h
|
207
|
5 amxintrin.h
|
150
|
6 arm_acle.h
|
|
7 arm_cmse.h
|
|
8 armintr.h
|
|
9 arm64intr.h
|
|
10 avx2intrin.h
|
|
11 avx512bf16intrin.h
|
|
12 avx512bwintrin.h
|
|
13 avx512bitalgintrin.h
|
|
14 avx512vlbitalgintrin.h
|
|
15 avx512cdintrin.h
|
|
16 avx512vpopcntdqintrin.h
|
|
17 avx512dqintrin.h
|
|
18 avx512erintrin.h
|
|
19 avx512fintrin.h
|
|
20 avx512ifmaintrin.h
|
|
21 avx512ifmavlintrin.h
|
|
22 avx512pfintrin.h
|
|
23 avx512vbmiintrin.h
|
|
24 avx512vbmivlintrin.h
|
|
25 avx512vbmi2intrin.h
|
|
26 avx512vlvbmi2intrin.h
|
|
27 avx512vlbf16intrin.h
|
|
28 avx512vlbwintrin.h
|
|
29 avx512vlcdintrin.h
|
|
30 avx512vldqintrin.h
|
|
31 avx512vlintrin.h
|
|
32 avx512vp2intersectintrin.h
|
|
33 avx512vlvp2intersectintrin.h
|
|
34 avx512vpopcntdqvlintrin.h
|
|
35 avx512vnniintrin.h
|
|
36 avx512vlvnniintrin.h
|
|
37 avxintrin.h
|
207
|
38 avxvnniintrin.h
|
150
|
39 bmi2intrin.h
|
|
40 bmiintrin.h
|
|
41 __clang_cuda_builtin_vars.h
|
173
|
42 __clang_cuda_math.h
|
150
|
43 __clang_cuda_cmath.h
|
|
44 __clang_cuda_complex_builtins.h
|
|
45 __clang_cuda_device_functions.h
|
|
46 __clang_cuda_intrinsics.h
|
|
47 __clang_cuda_libdevice_declares.h
|
|
48 __clang_cuda_math_forward_declares.h
|
|
49 __clang_cuda_runtime_wrapper.h
|
207
|
50 __clang_hip_libdevice_declares.h
|
|
51 __clang_hip_cmath.h
|
|
52 __clang_hip_math.h
|
|
53 __clang_hip_runtime_wrapper.h
|
150
|
54 cetintrin.h
|
173
|
55 cet.h
|
150
|
56 cldemoteintrin.h
|
|
57 clzerointrin.h
|
|
58 cpuid.h
|
|
59 clflushoptintrin.h
|
|
60 clwbintrin.h
|
|
61 emmintrin.h
|
|
62 enqcmdintrin.h
|
|
63 f16cintrin.h
|
|
64 float.h
|
|
65 fma4intrin.h
|
|
66 fmaintrin.h
|
|
67 fxsrintrin.h
|
|
68 gfniintrin.h
|
207
|
69 hresetintrin.h
|
150
|
70 htmintrin.h
|
|
71 htmxlintrin.h
|
|
72 ia32intrin.h
|
|
73 immintrin.h
|
|
74 intrin.h
|
|
75 inttypes.h
|
|
76 invpcidintrin.h
|
|
77 iso646.h
|
207
|
78 keylockerintrin.h
|
150
|
79 limits.h
|
|
80 lwpintrin.h
|
|
81 lzcntintrin.h
|
|
82 mm3dnow.h
|
|
83 mmintrin.h
|
|
84 mm_malloc.h
|
|
85 module.modulemap
|
|
86 movdirintrin.h
|
|
87 msa.h
|
|
88 mwaitxintrin.h
|
|
89 nmmintrin.h
|
|
90 opencl-c.h
|
|
91 opencl-c-base.h
|
|
92 pkuintrin.h
|
|
93 pmmintrin.h
|
|
94 pconfigintrin.h
|
|
95 popcntintrin.h
|
|
96 prfchwintrin.h
|
|
97 ptwriteintrin.h
|
|
98 rdseedintrin.h
|
|
99 rtmintrin.h
|
173
|
100 serializeintrin.h
|
150
|
101 sgxintrin.h
|
|
102 s390intrin.h
|
|
103 shaintrin.h
|
|
104 smmintrin.h
|
|
105 stdalign.h
|
|
106 stdarg.h
|
|
107 stdatomic.h
|
|
108 stdbool.h
|
|
109 stddef.h
|
|
110 __stddef_max_align_t.h
|
|
111 stdint.h
|
|
112 stdnoreturn.h
|
|
113 tbmintrin.h
|
|
114 tgmath.h
|
|
115 tmmintrin.h
|
173
|
116 tsxldtrkintrin.h
|
207
|
117 uintrintrin.h
|
150
|
118 unwind.h
|
|
119 vadefs.h
|
|
120 vaesintrin.h
|
|
121 varargs.h
|
|
122 vecintrin.h
|
|
123 vpclmulqdqintrin.h
|
|
124 waitpkgintrin.h
|
173
|
125 wasm_simd128.h
|
150
|
126 wbnoinvdintrin.h
|
|
127 wmmintrin.h
|
|
128 __wmmintrin_aes.h
|
|
129 __wmmintrin_pclmul.h
|
207
|
130 x86gprintrin.h
|
150
|
131 x86intrin.h
|
|
132 xmmintrin.h
|
|
133 xopintrin.h
|
|
134 xsavecintrin.h
|
|
135 xsaveintrin.h
|
|
136 xsaveoptintrin.h
|
|
137 xsavesintrin.h
|
|
138 xtestintrin.h
|
|
139 )
|
|
140
|
|
141 set(cuda_wrapper_files
|
|
142 cuda_wrappers/algorithm
|
|
143 cuda_wrappers/complex
|
|
144 cuda_wrappers/new
|
|
145 )
|
|
146
|
|
147 set(ppc_wrapper_files
|
|
148 ppc_wrappers/mmintrin.h
|
|
149 ppc_wrappers/xmmintrin.h
|
|
150 ppc_wrappers/mm_malloc.h
|
|
151 ppc_wrappers/emmintrin.h
|
|
152 ppc_wrappers/pmmintrin.h
|
|
153 ppc_wrappers/tmmintrin.h
|
|
154 ppc_wrappers/smmintrin.h
|
|
155 )
|
|
156
|
|
157 set(openmp_wrapper_files
|
|
158 openmp_wrappers/math.h
|
|
159 openmp_wrappers/cmath
|
207
|
160 openmp_wrappers/complex.h
|
|
161 openmp_wrappers/complex
|
173
|
162 openmp_wrappers/__clang_openmp_device_functions.h
|
207
|
163 openmp_wrappers/complex_cmath.h
|
150
|
164 openmp_wrappers/new
|
|
165 )
|
|
166
|
|
167 set(output_dir ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}/include)
|
|
168 set(out_files)
|
|
169 set(generated_files)
|
|
170
|
|
171 function(copy_header_to_output_dir src_dir file)
|
|
172 set(src ${src_dir}/${file})
|
|
173 set(dst ${output_dir}/${file})
|
|
174 add_custom_command(OUTPUT ${dst}
|
|
175 DEPENDS ${src}
|
|
176 COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
|
|
177 COMMENT "Copying clang's ${file}...")
|
|
178 list(APPEND out_files ${dst})
|
|
179 set(out_files ${out_files} PARENT_SCOPE)
|
|
180 endfunction(copy_header_to_output_dir)
|
|
181
|
|
182 function(clang_generate_header td_option td_file out_file)
|
|
183 clang_tablegen(${out_file} ${td_option}
|
|
184 -I ${CLANG_SOURCE_DIR}/include/clang/Basic/
|
|
185 SOURCE ${CLANG_SOURCE_DIR}/include/clang/Basic/${td_file})
|
|
186
|
|
187 copy_header_to_output_dir(${CMAKE_CURRENT_BINARY_DIR} ${out_file})
|
|
188 set(out_files ${out_files} PARENT_SCOPE)
|
|
189 list(APPEND generated_files "${CMAKE_CURRENT_BINARY_DIR}/${out_file}")
|
|
190 set(generated_files ${generated_files} PARENT_SCOPE)
|
|
191 endfunction(clang_generate_header)
|
|
192
|
|
193
|
|
194 # Copy header files from the source directory to the build directory
|
|
195 foreach( f ${files} ${cuda_wrapper_files} ${ppc_wrapper_files} ${openmp_wrapper_files})
|
|
196 copy_header_to_output_dir(${CMAKE_CURRENT_SOURCE_DIR} ${f})
|
|
197 endforeach( f )
|
|
198
|
|
199 # Generate header files and copy them to the build directory
|
|
200 # Generate arm_neon.h
|
|
201 clang_generate_header(-gen-arm-neon arm_neon.td arm_neon.h)
|
|
202 # Generate arm_fp16.h
|
|
203 clang_generate_header(-gen-arm-fp16 arm_fp16.td arm_fp16.h)
|
173
|
204 # Generate arm_sve.h
|
|
205 clang_generate_header(-gen-arm-sve-header arm_sve.td arm_sve.h)
|
207
|
206 # Generate arm_bf16.h
|
|
207 clang_generate_header(-gen-arm-bf16 arm_bf16.td arm_bf16.h)
|
150
|
208 # Generate arm_mve.h
|
|
209 clang_generate_header(-gen-arm-mve-header arm_mve.td arm_mve.h)
|
173
|
210 # Generate arm_cde.h
|
|
211 clang_generate_header(-gen-arm-cde-header arm_cde.td arm_cde.h)
|
207
|
212 # Generate riscv_vector.h
|
|
213 clang_generate_header(-gen-riscv-vector-header riscv_vector.td riscv_vector.h)
|
150
|
214
|
|
215 add_custom_target(clang-resource-headers ALL DEPENDS ${out_files})
|
|
216 set_target_properties(clang-resource-headers PROPERTIES
|
|
217 FOLDER "Misc"
|
|
218 RUNTIME_OUTPUT_DIRECTORY "${output_dir}")
|
|
219
|
|
220 set(header_install_dir lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
|
|
221
|
|
222 install(
|
|
223 FILES ${files} ${generated_files}
|
|
224 DESTINATION ${header_install_dir}
|
|
225 COMPONENT clang-resource-headers)
|
|
226
|
|
227 install(
|
|
228 FILES ${cuda_wrapper_files}
|
|
229 DESTINATION ${header_install_dir}/cuda_wrappers
|
|
230 COMPONENT clang-resource-headers)
|
|
231
|
|
232 install(
|
|
233 FILES ${ppc_wrapper_files}
|
|
234 DESTINATION ${header_install_dir}/ppc_wrappers
|
|
235 COMPONENT clang-resource-headers)
|
|
236
|
|
237 install(
|
|
238 FILES ${openmp_wrapper_files}
|
|
239 DESTINATION ${header_install_dir}/openmp_wrappers
|
|
240 COMPONENT clang-resource-headers)
|
|
241
|
|
242 if (NOT LLVM_ENABLE_IDE)
|
|
243 add_llvm_install_targets(install-clang-resource-headers
|
|
244 DEPENDS clang-resource-headers
|
|
245 COMPONENT clang-resource-headers)
|
|
246 endif()
|