summaryrefslogtreecommitdiff
path: root/include/clang/Basic/DiagnosticLexKinds.td
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2017-06-02 01:55:39 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2017-06-02 01:55:39 +0000
commit146ecad762cb83f8e00d8027188b622c6a8ce15d (patch)
tree17b1d69656572e2a842ac2dcd9ef6dc525b1e290 /include/clang/Basic/DiagnosticLexKinds.td
parentd4d74154ebb7baf50ad9b9d08c714a961afa59d8 (diff)
downloadclang-146ecad762cb83f8e00d8027188b622c6a8ce15d.tar.gz
Support lazy stat'ing of files referenced by module maps.
This patch adds support for a `header` declaration in a module map to specify certain `stat` information (currently, size and mtime) about that header file. This has two purposes: - It removes the need to eagerly `stat` every file referenced by a module map. Instead, we track a list of unresolved header files with each size / mtime (actually, for simplicity, we track submodules with such headers), and when attempting to look up a header file based on a `FileEntry`, we check if there are any unresolved header directives with that `FileEntry`'s size / mtime and perform deferred `stat`s if so. - It permits a preprocessed module to be compiled without the original files being present on disk. The only reason we used to need those files was to get the `stat` information in order to do header -> module lookups when using the module. If we're provided with the `stat` information in the preprocessed module, we can avoid requiring the files to exist. Unlike most `header` directives, if a `header` directive with `stat` information has no corresponding on-disk file the enclosing module is *not* marked unavailable (so that behavior is consistent regardless of whether we've resolved a header directive, and so that preprocessed modules don't get marked unavailable). We could actually do this for all `header` directives: the only reason we mark the module unavailable if headers are missing is to give a diagnostic slightly earlier (rather than waiting until we actually try to build the module / load and validate its .pcm file). Differential Revision: https://reviews.llvm.org/D33703 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304515 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/DiagnosticLexKinds.td')
-rw-r--r--include/clang/Basic/DiagnosticLexKinds.td6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/clang/Basic/DiagnosticLexKinds.td b/include/clang/Basic/DiagnosticLexKinds.td
index b393ce5f15..447f069456 100644
--- a/include/clang/Basic/DiagnosticLexKinds.td
+++ b/include/clang/Basic/DiagnosticLexKinds.td
@@ -664,6 +664,12 @@ def warn_mmap_mismatched_top_level_private : Warning<
InGroup<PrivateModule>;
def note_mmap_rename_top_level_private_as_submodule : Note<
"make '%0' a submodule of '%1' to ensure it can be found by name">;
+def err_mmap_duplicate_header_attribute : Error<
+ "header attribute '%0' specified multiple times">;
+def err_mmap_invalid_header_attribute_value : Error<
+ "expected integer literal as value for header attribute '%0'">;
+def err_mmap_expected_header_attribute : Error<
+ "expected a header attribute name ('size' or 'mtime')">;
def warn_auto_module_import : Warning<
"treating #%select{include|import|include_next|__include_macros}0 as an "