diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-10-28 22:18:19 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-10-28 22:18:19 +0000 |
commit | a3feee2ad64b6604bcb35c27a35307bf470accd1 (patch) | |
tree | ddad19dc3de6eb67785751a907c8cfc504a217f7 /clang/lib/Serialization/ASTWriter.cpp | |
parent | d1cac0af6bef8496955bf2222e285c0ee46ded74 (diff) | |
download | bcm5719-llvm-a3feee2ad64b6604bcb35c27a35307bf470accd1.tar.gz bcm5719-llvm-a3feee2ad64b6604bcb35c27a35307bf470accd1.zip |
Allow a new syntax in a module requires-declaration:
requires ! feature
The purpose of this is to allow (for instance) the module map for /usr/include
to exclude <tgmath.h> and <complex.h> when building in C++ (these headers are
instead provided by the C++ standard library in this case, and the glibc C
<tgmath.h> header would otherwise try to include <complex.h>, resulting in a
module cycle).
llvm-svn: 193549
Diffstat (limited to 'clang/lib/Serialization/ASTWriter.cpp')
-rw-r--r-- | clang/lib/Serialization/ASTWriter.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp index 3d14512540f..10957a2560c 100644 --- a/clang/lib/Serialization/ASTWriter.cpp +++ b/clang/lib/Serialization/ASTWriter.cpp @@ -2278,7 +2278,8 @@ void ASTWriter::WriteSubmodules(Module *WritingModule) { Abbrev = new BitCodeAbbrev(); Abbrev->Add(BitCodeAbbrevOp(SUBMODULE_REQUIRES)); - Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob)); // Feature + Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // State + Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob)); // Feature unsigned RequiresAbbrev = Stream.EmitAbbrev(Abbrev); Abbrev = new BitCodeAbbrev(); @@ -2342,12 +2343,12 @@ void ASTWriter::WriteSubmodules(Module *WritingModule) { Stream.EmitRecordWithBlob(DefinitionAbbrev, Record, Mod->Name); // Emit the requirements. - for (unsigned I = 0, N = Mod->Requires.size(); I != N; ++I) { + for (unsigned I = 0, N = Mod->Requirements.size(); I != N; ++I) { Record.clear(); Record.push_back(SUBMODULE_REQUIRES); + Record.push_back(Mod->Requirements[I].second); Stream.EmitRecordWithBlob(RequiresAbbrev, Record, - Mod->Requires[I].data(), - Mod->Requires[I].size()); + Mod->Requirements[I].first); } // Emit the umbrella header, if there is one. |