xref: /llvm-project/llvm/include/module.modulemap (revision dcc141bc0bb471ba209c89aca4288dc5cd2ef8bc)
1module LLVM_C {
2  umbrella "llvm-c"
3  module * { export * }
4}
5
6module LLVM_Analysis {
7  requires cplusplus
8  umbrella "llvm/Analysis"
9  module * { export * }
10
11  // This is intended for (repeated) textual inclusion.
12  textual header "llvm/Analysis/ScalarFuncs.def"
13  textual header "llvm/Analysis/TargetLibraryInfo.def"
14  textual header "llvm/Analysis/VecFuncs.def"
15}
16
17module LLVM_AsmParser {
18  requires cplusplus
19  umbrella "llvm/AsmParser"
20  module * { export * }
21}
22
23module LLVM_CodeGenTypes {
24  requires cplusplus
25
26  module LLT {
27    header "llvm/CodeGenTypes/LowLevelType.h" export *
28  }
29  module MVT {
30    header "llvm/CodeGenTypes/MachineValueType.h" export *
31    extern module LLVM_Extern_CodeGenTypes_Gen "module.extern.modulemap"
32  }
33}
34
35// A module covering CodeGen/ and Target/. These are intertwined
36// and codependent, and thus notionally form a single module.
37module LLVM_Backend {
38  requires cplusplus
39
40  module CodeGen {
41    umbrella "llvm/CodeGen"
42    module * { export * }
43
44    // Exclude these; they're intended to be included into only a single
45    // translation unit (or none) and aren't part of this module.
46    exclude header "llvm/CodeGen/LinkAllAsmWriterComponents.h"
47    exclude header "llvm/CodeGen/LinkAllCodegenComponents.h"
48
49    // These are intended for (repeated) textual inclusion.
50    textual header "llvm/CodeGen/DIEValue.def"
51  }
52}
53
54// FIXME: Make this as a submodule of LLVM_Backend again.
55//        Doing so causes a linker error in clang-format.
56module LLVM_Backend_Target {
57  umbrella "llvm/Target"
58  module * { export * }
59}
60
61module LLVM_Bitcode {
62 requires cplusplus
63 umbrella "llvm/Bitcode"
64 module * { export * }
65}
66
67module LLVM_Bitstream {
68 requires cplusplus
69 umbrella "llvm/Bitstream"
70 module * { export * }
71}
72
73module LLVM_BinaryFormat {
74    requires cplusplus
75    umbrella "llvm/BinaryFormat" module * { export * }
76    textual header "llvm/BinaryFormat/Dwarf.def"
77    textual header "llvm/BinaryFormat/DXContainerConstants.def"
78    textual header "llvm/BinaryFormat/DynamicTags.def"
79    textual header "llvm/BinaryFormat/MachO.def"
80    textual header "llvm/BinaryFormat/MinidumpConstants.def"
81    textual header "llvm/BinaryFormat/Swift.def"
82    textual header "llvm/BinaryFormat/ELFRelocs/AArch64.def"
83    textual header "llvm/BinaryFormat/ELFRelocs/AMDGPU.def"
84    textual header "llvm/BinaryFormat/ELFRelocs/ARM.def"
85    textual header "llvm/BinaryFormat/ELFRelocs/ARC.def"
86    textual header "llvm/BinaryFormat/ELFRelocs/AVR.def"
87    textual header "llvm/BinaryFormat/ELFRelocs/BPF.def"
88    textual header "llvm/BinaryFormat/ELFRelocs/CSKY.def"
89    textual header "llvm/BinaryFormat/ELFRelocs/Hexagon.def"
90    textual header "llvm/BinaryFormat/ELFRelocs/i386.def"
91    textual header "llvm/BinaryFormat/ELFRelocs/Lanai.def"
92    textual header "llvm/BinaryFormat/ELFRelocs/LoongArch.def"
93    textual header "llvm/BinaryFormat/ELFRelocs/M68k.def"
94    textual header "llvm/BinaryFormat/ELFRelocs/Mips.def"
95    textual header "llvm/BinaryFormat/ELFRelocs/MSP430.def"
96    textual header "llvm/BinaryFormat/ELFRelocs/PowerPC64.def"
97    textual header "llvm/BinaryFormat/ELFRelocs/PowerPC.def"
98    textual header "llvm/BinaryFormat/ELFRelocs/RISCV.def"
99    textual header "llvm/BinaryFormat/ELFRelocs/RISCV_nonstandard.def"
100    textual header "llvm/BinaryFormat/ELFRelocs/Sparc.def"
101    textual header "llvm/BinaryFormat/ELFRelocs/SystemZ.def"
102    textual header "llvm/BinaryFormat/ELFRelocs/VE.def"
103    textual header "llvm/BinaryFormat/ELFRelocs/x86_64.def"
104    textual header "llvm/BinaryFormat/ELFRelocs/Xtensa.def"
105    textual header "llvm/BinaryFormat/WasmRelocs.def"
106    textual header "llvm/BinaryFormat/MsgPack.def"
107}
108
109module LLVM_Config {
110  requires cplusplus
111  umbrella "llvm/Config"
112  extern module LLVM_Extern_Config_Def "module.extern.modulemap"
113  module * { export * }
114}
115
116module LLVM_DebugInfo {
117  requires cplusplus
118  module DIContext { header "llvm/DebugInfo/DIContext.h" export * }
119}
120
121module LLVM_DebugInfo_DWARF {
122  requires cplusplus
123
124  umbrella "llvm/DebugInfo/DWARF"
125  module * { export * }
126}
127
128module LLVM_DebugInfo_PDB {
129  requires cplusplus
130
131  umbrella "llvm/DebugInfo/PDB"
132  module * { export * }
133
134  // Separate out this subdirectory; it's an optional component that depends on
135  // a separate library which might not be available.
136  //
137  // FIXME: There should be a better way to specify this.
138  exclude header "llvm/DebugInfo/PDB/DIA/DIADataStream.h"
139  exclude header "llvm/DebugInfo/PDB/DIA/DIAEnumDebugStreams.h"
140  exclude header "llvm/DebugInfo/PDB/DIA/DIAEnumFrameData.h"
141  exclude header "llvm/DebugInfo/PDB/DIA/DIAEnumInjectedSources.h"
142  exclude header "llvm/DebugInfo/PDB/DIA/DIAEnumLineNumbers.h"
143  exclude header "llvm/DebugInfo/PDB/DIA/DIAEnumSectionContribs.h"
144  exclude header "llvm/DebugInfo/PDB/DIA/DIAEnumSourceFiles.h"
145  exclude header "llvm/DebugInfo/PDB/DIA/DIAEnumSymbols.h"
146  exclude header "llvm/DebugInfo/PDB/DIA/DIAEnumTables.h"
147  exclude header "llvm/DebugInfo/PDB/DIA/DIAError.h"
148  exclude header "llvm/DebugInfo/PDB/DIA/DIAFrameData.h"
149  exclude header "llvm/DebugInfo/PDB/DIA/DIAInjectedSource.h"
150  exclude header "llvm/DebugInfo/PDB/DIA/DIALineNumber.h"
151  exclude header "llvm/DebugInfo/PDB/DIA/DIARawSymbol.h"
152  exclude header "llvm/DebugInfo/PDB/DIA/DIASectionContrib.h"
153  exclude header "llvm/DebugInfo/PDB/DIA/DIASession.h"
154  exclude header "llvm/DebugInfo/PDB/DIA/DIASourceFile.h"
155  exclude header "llvm/DebugInfo/PDB/DIA/DIASupport.h"
156  exclude header "llvm/DebugInfo/PDB/DIA/DIATable.h"
157  exclude header "llvm/DebugInfo/PDB/DIA/DIAUtils.h"
158}
159
160module LLVM_DebugInfo_PDB_DIA {
161  requires cplusplus
162
163  umbrella "llvm/DebugInfo/PDB/DIA"
164  module * { export * }
165}
166
167module LLVM_DebugInfo_MSF {
168  requires cplusplus
169
170  umbrella "llvm/DebugInfo/MSF"
171  module * { export * }
172}
173
174module LLVM_DebugInfo_CodeView {
175  requires cplusplus
176
177  umbrella "llvm/DebugInfo/CodeView"
178  module * { export * }
179
180  // These are intended for (repeated) textual inclusion.
181  textual header "llvm/DebugInfo/CodeView/CodeViewRegisters.def"
182  textual header "llvm/DebugInfo/CodeView/CodeViewTypes.def"
183  textual header "llvm/DebugInfo/CodeView/CodeViewSymbols.def"
184}
185
186module LLVM_DWARFLinker {
187  requires cplusplus
188
189  umbrella "llvm/DWARFLinker"
190  module * { export * }
191}
192
193module LLVM_ExecutionEngine {
194  requires cplusplus
195
196  umbrella "llvm/ExecutionEngine"
197  module * { export * }
198
199  // Exclude this; it's an optional component of the ExecutionEngine.
200  exclude header "llvm/ExecutionEngine/OProfileWrapper.h"
201
202  // Exclude these; they're intended to be included into only a single
203  // translation unit (or none) and aren't part of this module.
204  exclude header "llvm/ExecutionEngine/MCJIT.h"
205  exclude header "llvm/ExecutionEngine/Interpreter.h"
206
207  // Exclude headers from LLVM_OrcSupport.
208  exclude header "llvm/ExecutionEngine/Orc/Shared/OrcError.h"
209}
210
211module LLVM_FileCheck {
212  requires cplusplus
213
214  umbrella "llvm/FileCheck"
215  module * { export * }
216}
217
218module LLVM_Frontend_OpenMP {
219  requires cplusplus
220
221  umbrella "llvm/Frontend/OpenMP"
222  module * { export * }
223
224  exclude header "llvm/Frontend/OpenMP/OMPKinds.def"
225}
226
227// Orc utilities that don't depend only on Support (not ExecutionEngine or
228// IR). This is a workaround for ExecutionEngine's broken layering, and will
229// be removed in the future.
230module LLVM_OrcSupport {
231  requires cplusplus
232
233  header "llvm/ExecutionEngine/Orc/Shared/OrcError.h"
234
235  export *
236}
237
238module LLVM_Pass {
239  module Pass {
240    // PassSupport.h and PassAnalysisSupport.h are made available only through
241    // Pass.h.
242    header "llvm/Pass.h"
243    textual header "llvm/PassSupport.h"
244    textual header "llvm/PassAnalysisSupport.h"
245    export *
246  }
247
248  module PassRegistry { header "llvm/PassRegistry.h" export * }
249  module InitializePasses { header "llvm/InitializePasses.h" export * }
250}
251
252module LLVM_IR {
253  requires cplusplus
254
255  umbrella "llvm/IR"
256  module * { export * }
257
258  extern module LLVM_Extern_IR_Attributes_Gen "module.extern.modulemap"
259  extern module LLVM_Extern_IR_Intrinsics_Gen "module.extern.modulemap"
260  extern module LLVM_Extern_IR_Intrinsics_Enum "module.extern.modulemap"
261
262  // These are intended for (repeated) textual inclusion.
263  textual header "llvm/IR/ConstrainedOps.def"
264  textual header "llvm/IR/DebugInfoFlags.def"
265  textual header "llvm/IR/Instruction.def"
266  textual header "llvm/IR/Metadata.def"
267  textual header "llvm/IR/FixedMetadataKinds.def"
268  textual header "llvm/IR/Value.def"
269  textual header "llvm/IR/VPIntrinsics.def"
270  textual header "llvm/IR/RuntimeLibcalls.def"
271}
272
273module LLVM_IRReader {
274  requires cplusplus
275  umbrella "llvm/IRReader"
276  module * { export * }
277}
278
279module LLVM_LineEditor {
280  requires cplusplus
281  umbrella "llvm/LineEditor"
282  module * { export * }
283}
284
285module LLVM_LTO {
286  requires cplusplus
287  umbrella "llvm/LTO"
288  module * { export * }
289}
290
291module LLVM_MC {
292  requires cplusplus
293
294  umbrella "llvm/MC"
295  module * { export * }
296}
297
298module LLVM_Object {
299  requires cplusplus
300  umbrella "llvm/Object"
301  module * { export * }
302}
303
304module LLVM_Option {
305  requires cplusplus
306  umbrella "llvm/Option"
307  module * { export * }
308}
309
310module LLVM_ProfileData {
311  requires cplusplus
312
313  umbrella "llvm/ProfileData"
314  module * { export * }
315
316  textual header "llvm/ProfileData/InstrProfData.inc"
317  textual header "llvm/ProfileData/MemProfData.inc"
318  textual header "llvm/ProfileData/MIBEntryDef.inc"
319}
320
321// FIXME: Mislayered?
322module LLVM_Support_TargetRegistry {
323  requires cplusplus
324  header "llvm/Support/TargetRegistry.h"
325  export *
326}
327
328module LLVM_TableGen {
329  requires cplusplus
330  umbrella "llvm/TableGen"
331  module * { export * }
332}
333
334module LLVM_Transforms {
335  requires cplusplus
336  umbrella "llvm/Transforms"
337
338  module * { export * }
339
340  // Requires DEBUG_TYPE to be defined by including file.
341  exclude header "llvm/Transforms/Utils/InstructionWorklist.h"
342}
343
344extern module LLVM_Extern_Utils_DataTypes "module.extern.modulemap"
345
346// Build the module with the tablegen-generated files needed by the
347// TargetParser module before building the TargetParser module itself.
348module TargetParserGen {
349  module AArch64TargetParserDef {
350    textual header "llvm/TargetParser/AArch64CPUFeatures.inc"
351    textual header "llvm/TargetParser/AArch64FeatPriorities.inc"
352    header "llvm/TargetParser/AArch64TargetParser.h"
353    extern module LLVM_Extern_TargetParser_Gen "module.extern.modulemap"
354    export *
355  }
356  module RISCVTargetParserDef {
357    header "llvm/TargetParser/RISCVTargetParser.h"
358    extern module LLVM_Extern_TargetParser_Gen "module.extern.modulemap"
359    export *
360  }
361}
362
363// A module covering ADT/ and Support/. These are intertwined and
364// codependent, and notionally form a single module.
365module LLVM_Utils {
366  module ADT {
367    requires cplusplus
368
369    umbrella "llvm/ADT"
370    module * { export * }
371  }
372
373  module Demangle {
374    requires cplusplus
375
376    umbrella "llvm/Demangle"
377    module * { export * }
378
379    textual header "llvm/Demangle/ItaniumNodes.def"
380  }
381
382  module Support {
383    requires cplusplus
384
385    umbrella "llvm/Support"
386    module * { export * }
387
388    // Exclude this; it should only be used on Windows.
389    exclude header "llvm/Support/Windows/WindowsSupport.h"
390
391    // Exclude these; they are fundamentally non-modular.
392    exclude header "llvm/Support/PluginLoader.h"
393    exclude header "llvm/Support/Solaris/sys/regset.h"
394    textual header "llvm/Support/TargetOpcodes.def"
395
396  }
397
398  module TargetParser {
399    requires cplusplus
400
401    umbrella "llvm/TargetParser"
402    module * { export * }
403
404    // These are intended for textual inclusion.
405    textual header "llvm/TargetParser/ARMTargetParser.def"
406    textual header "llvm/TargetParser/CSKYTargetParser.def"
407    textual header "llvm/TargetParser/X86TargetParser.def"
408    textual header "llvm/TargetParser/LoongArchTargetParser.def"
409    textual header "llvm/TargetParser/PPCTargetParser.def"
410  }
411
412  // This part of the module is usable from both C and C++ code.
413  module ConvertUTF {
414    header "llvm/Support/ConvertUTF.h"
415    export *
416  }
417}
418
419// This is used for a $src == $build compilation. Otherwise we use
420// LLVM_Support_DataTypes_Build, defined in a module map that is
421// copied into the build area.
422module LLVM_Support_DataTypes_Src {
423  header "llvm/Support/DataTypes.h"
424  export *
425}
426
427module LLVM_WindowsManifest {
428  requires cplusplus
429  umbrella "llvm/WindowsManifest"
430  module * { export * }
431}
432
433module LLVM_SandboxIR {
434  requires cplusplus
435
436  umbrella "llvm/SandboxIR"
437  module * { export * }
438
439  textual header "llvm/SandboxIR/Values.def"
440}
441