Index: CMakeLists.txt =================================================================== --- CMakeLists.txt +++ CMakeLists.txt @@ -928,6 +928,7 @@ PATTERN "*.td" PATTERN "*.inc" PATTERN "LICENSE.TXT" + PATTERN "module.modulemap" PATTERN ".svn" EXCLUDE ) @@ -945,6 +946,12 @@ PATTERN ".svn" EXCLUDE ) + install(FILES include/llvm/module.install.modulemap + DESTINATION include/llvm + COMPONENT llvm-headers + RENAME "module.extern.modulemap" + ) + # Installing the headers needs to depend on generating any public # tablegen'd headers. add_custom_target(llvm-headers DEPENDS intrinsics_gen) Index: include/llvm/module.extern.modulemap =================================================================== --- /dev/null +++ include/llvm/module.extern.modulemap @@ -0,0 +1,4 @@ +module LLVM_Extern_Config_Def {} +module LLVM_Extern_IR_Attributes_Gen {} +module LLVM_Extern_IR_Intrinsics_Gen {} +module LLVM_Extern_Utils_DataTypes {} Index: include/llvm/module.install.modulemap =================================================================== --- /dev/null +++ include/llvm/module.install.modulemap @@ -0,0 +1,21 @@ + +module LLVM_Extern_Config_Def { + textual header "Config/AsmParsers.def" + textual header "Config/AsmPrinters.def" + textual header "Config/Disassemblers.def" + textual header "Config/Targets.def" + export * +} + +module LLVM_Extern_IR_Attributes_Gen { + textual header "IR/Attributes.gen" +} + +module LLVM_Extern_IR_Intrinsics_Gen { + textual header "IR/Intrinsics.gen" +} + +module LLVM_Extern_Utils_DataTypes { + header "Support/DataTypes.h" + export * +} Index: include/llvm/module.modulemap =================================================================== --- include/llvm/module.modulemap +++ include/llvm/module.modulemap @@ -38,7 +38,12 @@ } module LLVM_Bitcode { requires cplusplus umbrella "Bitcode" module * { export * } } -module LLVM_Config { requires cplusplus umbrella "Config" module * { export * } } +module LLVM_Config { + requires cplusplus + umbrella "Config" + extern module LLVM_Extern_Config_Def "module.extern.modulemap" + module * { export * } +} module LLVM_DebugInfo { requires cplusplus @@ -145,7 +150,11 @@ // Attributes.h module IR_Argument { header "IR/Argument.h" export * } - module IR_Attributes { header "IR/Attributes.h" export * } + module IR_Attributes { + header "IR/Attributes.h" + extern module LLVM_Extern_IR_Attributes_Gen "module.extern.modulemap" + export * + } module IR_CallSite { header "IR/CallSite.h" export * } module IR_ConstantFolder { header "IR/ConstantFolder.h" export * } module IR_NoFolder { header "IR/NoFolder.h" export * } @@ -167,7 +176,11 @@ module IR_Verifier { header "IR/Verifier.h" export * } module IR_InstIterator { header "IR/InstIterator.h" export * } module IR_InstVisitor { header "IR/InstVisitor.h" export * } - module IR_Intrinsics { header "IR/Intrinsics.h" export * } + module IR_Intrinsics { + header "IR/Intrinsics.h" + extern module LLVM_Extern_IR_Intricsics_Gen "module.extern.modulemap" + export * + } module IR_IntrinsicInst { header "IR/IntrinsicInst.h" export * } module IR_PatternMatch { header "IR/PatternMatch.h" export * } module IR_Statepoint { header "IR/Statepoint.h" export * } @@ -233,6 +246,8 @@ module * { export * } } +extern module LLVM_Extern_Utils_DataTypes "module.extern.modulemap" + // A module covering ADT/ and Support/. These are intertwined and // codependent, and notionally form a single module. module LLVM_Utils {