]> granicus.if.org Git - clang/commit
Introduce module file extensions to piggy-back data onto module files.
authorDouglas Gregor <dgregor@apple.com>
Tue, 3 Nov 2015 18:33:07 +0000 (18:33 +0000)
committerDouglas Gregor <dgregor@apple.com>
Tue, 3 Nov 2015 18:33:07 +0000 (18:33 +0000)
commit07f81283a4208b64690286eb1b72f0681f38bcd0
tree041d169eb17ccbf90569a410b4077126252cc2ed
parent603885ad10e8987f92249edf02037c230bbedd18
Introduce module file extensions to piggy-back data onto module files.

Introduce the notion of a module file extension, which introduces
additional information into a module file at the time it is built that
can then be queried when the module file is read. Module file
extensions are identified by a block name (which must be unique to the
extension) and can write any bitstream records into their own
extension block within the module file. When a module file is loaded,
any extension blocks are matched up with module file extension
readers, that are per-module-file and are given access to the input
bitstream.

Note that module file extensions can only be introduced by
programmatic clients that have access to the CompilerInvocation. There
is only one such extension at the moment, which is used for testing
the module file extension harness. As a future direction, one could
imagine allowing the plugin mechanism to introduce new module file
extensions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251955 91177308-0d34-0410-b5e6-96231b3b80d8
28 files changed:
include/clang/Basic/DiagnosticDriverKinds.td
include/clang/Basic/DiagnosticFrontendKinds.td
include/clang/Basic/DiagnosticGroups.td
include/clang/Basic/DiagnosticSerializationKinds.td
include/clang/Driver/CC1Options.td
include/clang/Frontend/CompilerInstance.h
include/clang/Frontend/FrontendOptions.h
include/clang/Serialization/ASTBitCodes.h
include/clang/Serialization/ASTReader.h
include/clang/Serialization/ASTWriter.h
include/clang/Serialization/Module.h
include/clang/Serialization/ModuleFileExtension.h [new file with mode: 0644]
lib/Frontend/ASTUnit.cpp
lib/Frontend/CMakeLists.txt
lib/Frontend/ChainedIncludesSource.cpp
lib/Frontend/CompilerInstance.cpp
lib/Frontend/CompilerInvocation.cpp
lib/Frontend/FrontendActions.cpp
lib/Frontend/TestModuleFileExtension.cpp [new file with mode: 0644]
lib/Frontend/TestModuleFileExtension.h [new file with mode: 0644]
lib/Serialization/ASTReader.cpp
lib/Serialization/ASTWriter.cpp
lib/Serialization/CMakeLists.txt
lib/Serialization/GeneratePCH.cpp
lib/Serialization/ModuleFileExtension.cpp [new file with mode: 0644]
test/Modules/Inputs/ExtensionTestA.h [new file with mode: 0644]
test/Modules/Inputs/module.map
test/Modules/extensions.c [new file with mode: 0644]