[NFC] Add Incremental Info Bits to ModuleDecl

This commit is contained in:
Robert Widmann
2020-09-24 18:54:17 -06:00
parent 7566e9f561
commit f1f5961e0f
3 changed files with 12 additions and 2 deletions

View File

@@ -578,7 +578,7 @@ protected:
HasAnyUnavailableValues : 1 HasAnyUnavailableValues : 1
); );
SWIFT_INLINE_BITFIELD(ModuleDecl, TypeDecl, 1+1+1+1+1+1+1+1+1, SWIFT_INLINE_BITFIELD(ModuleDecl, TypeDecl, 1+1+1+1+1+1+1+1+1+1,
/// If the module was or is being compiled with `-enable-testing`. /// If the module was or is being compiled with `-enable-testing`.
TestingEnabled : 1, TestingEnabled : 1,
@@ -607,7 +607,10 @@ protected:
IsNonSwiftModule : 1, IsNonSwiftModule : 1,
/// Whether this module is the main module. /// Whether this module is the main module.
IsMainModule : 1 IsMainModule : 1,
/// Whether this module has incremental dependency information available.
HasIncrementalInfo : 1
); );
SWIFT_INLINE_BITFIELD(PrecedenceGroupDecl, Decl, 1+2, SWIFT_INLINE_BITFIELD(PrecedenceGroupDecl, Decl, 1+2,

View File

@@ -517,6 +517,12 @@ public:
Bits.ModuleDecl.RawResilienceStrategy = unsigned(strategy); Bits.ModuleDecl.RawResilienceStrategy = unsigned(strategy);
} }
/// Returns true if this module was or is being compiled for testing.
bool hasIncrementalInfo() const { return Bits.ModuleDecl.HasIncrementalInfo; }
void setHasIncrementalInfo(bool enabled = true) {
Bits.ModuleDecl.HasIncrementalInfo = enabled;
}
/// \returns true if this module is a system module; note that the StdLib is /// \returns true if this module is a system module; note that the StdLib is
/// considered a system module. /// considered a system module.
bool isSystemModule() const { bool isSystemModule() const {

View File

@@ -484,6 +484,7 @@ ModuleDecl::ModuleDecl(Identifier name, ASTContext &ctx,
Bits.ModuleDecl.IsSystemModule = 0; Bits.ModuleDecl.IsSystemModule = 0;
Bits.ModuleDecl.IsNonSwiftModule = 0; Bits.ModuleDecl.IsNonSwiftModule = 0;
Bits.ModuleDecl.IsMainModule = 0; Bits.ModuleDecl.IsMainModule = 0;
Bits.ModuleDecl.HasIncrementalInfo = 0;
} }
ArrayRef<ImplicitImport> ModuleDecl::getImplicitImports() const { ArrayRef<ImplicitImport> ModuleDecl::getImplicitImports() const {