]> granicus.if.org Git - clang/commitdiff
[modules] Slightly expand module semantics documentation.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 24 Jul 2014 03:42:38 +0000 (03:42 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 24 Jul 2014 03:42:38 +0000 (03:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213838 91177308-0d34-0410-b5e6-96231b3b80d8

docs/Modules.rst

index ce1e717bc2a0583e36c9678b459dc668651e87c6..112ad4f0393659f05e83eea94d43b03d647258d0 100644 (file)
@@ -208,7 +208,7 @@ Modules are modeled as if each submodule were a separate translation unit, and a
 
 .. note::
 
-  This behavior is currently only approximated when building a module. Entities within a submodule that has already been built are visible when building later submodules in that module. This can lead to fragile modules that depend on the build order used for the submodules of the module, and should not be relied upon.
+  This behavior is currently only approximated when building a module with submodules. Entities within a submodule that has already been built are visible when building later submodules in that module. This can lead to fragile modules that depend on the build order used for the submodules of the module, and should not be relied upon. This behavior is subject to change.
 
 As an example, in C, this implies that if two structs are defined in different submodules with the same name, those two types are distinct types (but may be *compatible* types if their definitions match. In C++, two structs defined with the same name in different submodules are the *same* type, and must be equivalent under C++'s One Definition Rule.
 
@@ -216,6 +216,8 @@ As an example, in C, this implies that if two structs are defined in different s
 
   Clang currently only performs minimal checking for violations of the One Definition Rule.
 
+If any submodule of a module is imported into any part of a program, the entire top-level module is considered to be part of the program. As a consequence of this, Clang may diagnose conflicts between an entity declared in an unimported submodule and an entity declared in the current translation unit, and Clang may inline or devirtualize based on knowledge from unimported submodules.
+
 Macros
 ------