mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Add module trace information for strict memory safety
Extend the module trace format with a field indicating whether a given module, or any module it depends on, was compiled with strict memory safety enabled. This separate output from the compiler can be used as part of an audit to determine what parts of Swift programs are built with strict memory safety checking enabled.
This commit is contained in:
@@ -415,8 +415,11 @@ private:
|
||||
/// Whether this module is built with -package-cmo.
|
||||
unsigned SerializePackageEnabled : 1;
|
||||
|
||||
/// Whether this module enabled strict memory safety.
|
||||
unsigned StrictMemorySafety : 1;
|
||||
|
||||
// Explicitly pad out to the next word boundary.
|
||||
unsigned : 3;
|
||||
unsigned : 2;
|
||||
} Bits = {};
|
||||
static_assert(sizeof(ModuleBits) <= 8, "The bit set should be small");
|
||||
|
||||
@@ -667,6 +670,8 @@ public:
|
||||
|
||||
bool isConcurrencyChecked() const { return Bits.IsConcurrencyChecked; }
|
||||
|
||||
bool strictMemorySafety() const { return Bits.StrictMemorySafety; }
|
||||
|
||||
/// How should \p dependency be loaded for a transitive import via \c this?
|
||||
///
|
||||
/// If \p importNonPublicDependencies, more transitive dependencies
|
||||
|
||||
Reference in New Issue
Block a user