Module use declarations (II)
Review: http://llvm-reviews.chandlerc.com/D1546. I have picked up this patch form Lawrence (http://llvm-reviews.chandlerc.com/D1063) and did a few changes. From the original change description (updated as appropriate): This patch adds a check that ensures that modules only use modules they have so declared. To this end, it adds a statement on intended module use to the module.map grammar: use module-id A module can then only use headers from other modules if it 'uses' them. This enforcement is off by default, but may be turned on with the new option -fmodules-decluse. When enforcing the module semantics, we also need to consider a source file part of a module. This is achieved with a compiler option -fmodule-name=<module-id>. The compiler at present only applies restrictions to the module directly being built. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191283 91177308-0d34-0410-b5e6-96231b3b80d8
Showing
- docs/Modules.rst 38 additions, 1 deletiondocs/Modules.rst
- include/clang/Basic/DiagnosticLexKinds.td 5 additions, 3 deletionsinclude/clang/Basic/DiagnosticLexKinds.td
- include/clang/Basic/LangOptions.def 1 addition, 0 deletionsinclude/clang/Basic/LangOptions.def
- include/clang/Basic/Module.h 6 additions, 0 deletionsinclude/clang/Basic/Module.h
- include/clang/Driver/Options.td 5 additions, 0 deletionsinclude/clang/Driver/Options.td
- include/clang/Lex/ModuleMap.h 16 additions, 0 deletionsinclude/clang/Lex/ModuleMap.h
- include/clang/Lex/Preprocessor.h 25 additions, 0 deletionsinclude/clang/Lex/Preprocessor.h
- lib/Basic/Module.cpp 14 additions, 0 deletionslib/Basic/Module.cpp
- lib/Driver/Tools.cpp 7 additions, 0 deletionslib/Driver/Tools.cpp
- lib/Frontend/CompilerInvocation.cpp 1 addition, 0 deletionslib/Frontend/CompilerInvocation.cpp
- lib/Lex/HeaderSearch.cpp 1 addition, 0 deletionslib/Lex/HeaderSearch.cpp
- lib/Lex/ModuleMap.cpp 63 additions, 1 deletionlib/Lex/ModuleMap.cpp
- lib/Lex/PPDirectives.cpp 84 additions, 23 deletionslib/Lex/PPDirectives.cpp
- lib/Sema/Sema.cpp 1 addition, 0 deletionslib/Sema/Sema.cpp
- lib/Serialization/ASTReader.cpp 4 additions, 0 deletionslib/Serialization/ASTReader.cpp
- lib/Serialization/ASTWriter.cpp 4 additions, 0 deletionslib/Serialization/ASTWriter.cpp
- test/Modules/Inputs/declare-use/a.h 4 additions, 0 deletionstest/Modules/Inputs/declare-use/a.h
- test/Modules/Inputs/declare-use/b.h 4 additions, 0 deletionstest/Modules/Inputs/declare-use/b.h
- test/Modules/Inputs/declare-use/c.h 6 additions, 0 deletionstest/Modules/Inputs/declare-use/c.h
- test/Modules/Inputs/declare-use/d.h 6 additions, 0 deletionstest/Modules/Inputs/declare-use/d.h
Loading
Please register or sign in to comment