Currently the LLVM module.modulemap files are not installed along side the headers. This is because these module maps only work during in-tree builds where some of the headers are in the build directory. Once those generated headers are installed with the in-tree headers the module maps no longer work.
This patch adds a new map called module.modulemap.install which correctly handles the LLVM headers in their install configuration. The changes needed to support that are:
- Build llvm/Support/DataTypes.h as a separate module instead of as part of LLVM_Utils. This is required to avoid a cyclic dependency between the LLVM_C and LLVM_Utils modules.
- Add the generated Config/*.def headers to the LLVM_Config module.
- Handle the IR/Attributes.gen and IR/Intrinsics.gen headers so that the LLVM_IR umbrella is complete.
Unfortunately I don't think there is a way to modify the existing module.modulemap file so that it works with both in-tree and installed headers. @rsmith is there a better way to handle this?