r210726 - [modules] Add first-draft module maps for Clang. These don't cover everything

Richard Smith richard at metafoo.co.uk
Thu Jun 12 15:25:17 PDT 2014


On Wed, Jun 11, 2014 at 6:06 PM, Alp Toker <alp at nuanti.com> wrote:

>
> On 12/06/2014 03:32, Richard Smith wrote:
>
>> Author: rsmith
>> Date: Wed Jun 11 19:32:32 2014
>> New Revision: 210726
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=210726&view=rev
>> Log:
>> [modules] Add first-draft module maps for Clang. These don't cover
>> everything
>> yet, but they're enough for a clean bootstrap (with a few local patches
>> that
>> are yet to be committed).
>>
>
> Surely it would have made more sense to commit the local patches first?


Takumi Nakamara wanted to experiment with enabling modules; this patch is a
prerequisite for that. The other patches are not (a non-asserts build can
bootstrap right now, but an asserts build notices some problems with the
internal state...).

The local patches need cleanup and unit testing, but they're my current
priority.


> Added:
>>      cfe/trunk/include/clang-c/module.modulemap
>>      cfe/trunk/include/clang/module.modulemap
>>
>> Added: cfe/trunk/include/clang-c/module.modulemap
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/
>> clang-c/module.modulemap?rev=210726&view=auto
>> ============================================================
>> ==================
>> --- cfe/trunk/include/clang-c/module.modulemap (added)
>> +++ cfe/trunk/include/clang-c/module.modulemap Wed Jun 11 19:32:32 2014
>> @@ -0,0 +1,5 @@
>> +module Clang_C {
>> +  requires cplusplus
>> +  umbrella "."
>> +  module * { export * }
>> +}
>>
>> Added: cfe/trunk/include/clang/module.modulemap
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/
>> clang/module.modulemap?rev=210726&view=auto
>> ============================================================
>> ==================
>> --- cfe/trunk/include/clang/module.modulemap (added)
>> +++ cfe/trunk/include/clang/module.modulemap Wed Jun 11 19:32:32 2014
>> @@ -0,0 +1,109 @@
>> +module Clang_Analysis {
>> +  requires cplusplus
>> +  umbrella "Analysis"
>> +
>> +  // This file is intended for repeated textual inclusion.
>> +  exclude header "Analysis/Analyses/ThreadSafetyOps.def"
>> +
>> +  module * { export * }
>> +}
>> +
>> +module Clang_AST {
>> +  requires cplusplus
>> +  umbrella "AST"
>> +
>> +  // These files are intended for repeated textual inclusion.
>> +  exclude header "AST/BuiltinTypes.def"
>> +  exclude header "AST/TypeLocNodes.def"
>> +  exclude header "AST/TypeNodes.def"
>> +
>> +  module * { export * }
>> +}
>> +
>> +module Clang_ASTMatchers { requires cplusplus umbrella "ASTMatchers"
>> module * { export * } }
>> +
>> +module Clang_Basic {
>> +  requires cplusplus
>> +  umbrella "Basic"
>> +
>> +  // These files are intended for repeated textual inclusion.
>> +  exclude header "Basic/BuiltinsAArch64.def"
>> +  exclude header "Basic/BuiltinsARM64.def"
>> +  exclude header "Basic/BuiltinsARM.def"
>> +  exclude header "Basic/Builtins.def"
>> +  exclude header "Basic/BuiltinsHexagon.def"
>> +  exclude header "Basic/BuiltinsMips.def"
>> +  exclude header "Basic/BuiltinsNEON.def"
>> +  exclude header "Basic/BuiltinsNVPTX.def"
>> +  exclude header "Basic/BuiltinsPPC.def"
>> +  exclude header "Basic/BuiltinsX86.def"
>> +  exclude header "Basic/BuiltinsXCore.def"
>> +  exclude header "Basic/DiagnosticOptions.def"
>> +  exclude header "Basic/LangOptions.def"
>> +  exclude header "Basic/OpenCLExtensions.def"
>> +  exclude header "Basic/OpenMPKinds.def"
>> +  exclude header "Basic/OperatorKinds.def"
>> +  exclude header "Basic/Sanitizers.def"
>> +  exclude header "Basic/TokenKinds.def"
>>
>
> Isn't there a regex syntax for exclude?
>
> It doesn't seem reasonable to expect everyone to maintain this list by
> hand when we already provide a pattern by which they can be trivially
> detected (the .def suffix).


Ultimately, the module map should be generated by the build system, which
should largely remove this concern. (I'm not opposed to having some kind of
pattern syntax here, but the module map syntax is sufficiently unstable
that I don't think it's a priority.)

 +
>> +  // This file is one big layering violation.
>> +  exclude header "Basic/AllDiagnostics.h"
>> +
>> +  // This file includes a header from Lex.
>> +  exclude header "Basic/PlistSupport.h"
>> +
>> +  // FIXME: This is logically a part of Basic, but has been put in the
>> wrong place.
>> +  header "StaticAnalyzer/Core/AnalyzerOptions.h"
>>
>
> I'll give a hand and look into these three cases if you take care of my
> post-commit ;-)


Sure thing, thank you!


>  +
>> +  module * { export * }
>> +}
>> +
>> +module Clang_CodeGen { requires cplusplus umbrella "CodeGen" module * {
>> export * } }
>> +module Clang_Config { requires cplusplus umbrella "Config" module * {
>> export * } }
>>
>
> Why are you exporting the internal, non-installed config.h header files?
> Ditto for the module.modulemap in LLVM
>

The modules are for building LLVM and Clang themselves, not (just) for
external consumers of the libraries.


> Please see http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-June/
> 073707.html
>
> Alp.
>
>
>  +
>> +module Clang_Driver {
>> +  requires cplusplus
>> +  umbrella "Driver"
>> +
>> +  // This file is intended for repeated textual inclusion.
>> +  exclude header "Driver/Types.def"
>> +
>> +  module * { export * }
>> +}
>> +
>> +module Clang_Edit { requires cplusplus umbrella "Edit" module * { export
>> * } }
>> +module Clang_Format { requires cplusplus umbrella "Format" module * {
>> export * } }
>> +
>> +module Clang_Frontend {
>> +  requires cplusplus
>> +  umbrella "Frontend"
>> +
>> +  // These files are intended for repeated textual inclusion.
>> +  exclude header "Frontend/CodeGenOptions.def"
>> +  exclude header "Frontend/LangStandards.def"
>> +
>> +  module * { export * }
>> +}
>> +
>> +module Clang_FrontendTool { requires cplusplus umbrella "FrontendTool"
>> module * { export * } }
>> +module Clang_Index { requires cplusplus umbrella "Index" module * {
>> export * } }
>> +module Clang_Lex { requires cplusplus umbrella "Lex" module * { export *
>> } }
>> +module Clang_Parse { requires cplusplus umbrella "Parse" module * {
>> export * } }
>> +module Clang_Rewrite { requires cplusplus umbrella "Rewrite" module * {
>> export * } }
>> +module Clang_Sema { requires cplusplus umbrella "Sema" module * { export
>> * } }
>> +module Clang_Serialization { requires cplusplus umbrella "Serialization"
>> module * { export * } }
>> +
>> +module Clang_StaticAnalyzer {
>> +  requires cplusplus
>> +  umbrella "StaticAnalyzer"
>> +
>> +  // This file is intended for repeated textual inclusion.
>> +  exclude header "StaticAnalyzer/Core/Analyses.def"
>> +
>> +  // FIXME: This is logically a part of Basic, but has been put in the
>> wrong place.
>> +  exclude header "StaticAnalyzer/Core/AnalyzerOptions.h"
>> +
>> +  module * { export * }
>> +}
>> +
>> +module Clang_Tooling { requires cplusplus umbrella "Tooling" module * {
>> export * } }
>>
>>
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>>
>
> --
> http://www.nuanti.com
> the browser experts
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140612/e186a233/attachment.html>


More information about the cfe-commits mailing list