Skip to content

Commit f1f5961

Browse files
committed
[NFC] Add Incremental Info Bits to ModuleDecl
1 parent 7566e9f commit f1f5961

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

include/swift/AST/Decl.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ class alignas(1 << DeclAlignInBits) Decl {
578578
HasAnyUnavailableValues : 1
579579
);
580580

581-
SWIFT_INLINE_BITFIELD(ModuleDecl, TypeDecl, 1+1+1+1+1+1+1+1+1,
581+
SWIFT_INLINE_BITFIELD(ModuleDecl, TypeDecl, 1+1+1+1+1+1+1+1+1+1,
582582
/// If the module was or is being compiled with `-enable-testing`.
583583
TestingEnabled : 1,
584584

@@ -607,7 +607,10 @@ class alignas(1 << DeclAlignInBits) Decl {
607607
IsNonSwiftModule : 1,
608608

609609
/// Whether this module is the main module.
610-
IsMainModule : 1
610+
IsMainModule : 1,
611+
612+
/// Whether this module has incremental dependency information available.
613+
HasIncrementalInfo : 1
611614
);
612615

613616
SWIFT_INLINE_BITFIELD(PrecedenceGroupDecl, Decl, 1+2,

include/swift/AST/Module.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,12 @@ class ModuleDecl : public DeclContext, public TypeDecl {
517517
Bits.ModuleDecl.RawResilienceStrategy = unsigned(strategy);
518518
}
519519

520+
/// Returns true if this module was or is being compiled for testing.
521+
bool hasIncrementalInfo() const { return Bits.ModuleDecl.HasIncrementalInfo; }
522+
void setHasIncrementalInfo(bool enabled = true) {
523+
Bits.ModuleDecl.HasIncrementalInfo = enabled;
524+
}
525+
520526
/// \returns true if this module is a system module; note that the StdLib is
521527
/// considered a system module.
522528
bool isSystemModule() const {

lib/AST/Module.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,7 @@ ModuleDecl::ModuleDecl(Identifier name, ASTContext &ctx,
484484
Bits.ModuleDecl.IsSystemModule = 0;
485485
Bits.ModuleDecl.IsNonSwiftModule = 0;
486486
Bits.ModuleDecl.IsMainModule = 0;
487+
Bits.ModuleDecl.HasIncrementalInfo = 0;
487488
}
488489

489490
ArrayRef<ImplicitImport> ModuleDecl::getImplicitImports() const {

0 commit comments

Comments
 (0)