Skip to content

Commit 4f7ffcc

Browse files
[MCCAS] Fix uninitialzied variables in CASID file output
Fix uninitalized variables in IRGen options. Those options are initialized with `|=` so it is important to initialize them to false.
1 parent ddfb26b commit 4f7ffcc

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

include/swift/AST/IRGenOptions.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ class IRGenOptions {
306306

307307
/// Whether we're generating IR for the JIT.
308308
unsigned UseJIT : 1;
309-
309+
310310
/// Whether we should run LLVM optimizations after IRGen.
311311
unsigned DisableLLVMOptzns : 1;
312312

@@ -377,7 +377,7 @@ class IRGenOptions {
377377
/// Force public linkage for private symbols. Used only by the LLDB
378378
/// expression evaluator.
379379
unsigned ForcePublicLinkage : 1;
380-
380+
381381
/// Force lazy initialization of class metadata
382382
/// Used on Windows to avoid cross-module references.
383383
unsigned LazyInitializeClassMetadata : 1;
@@ -439,7 +439,7 @@ class IRGenOptions {
439439
/// Whether to disable shadow copies for local variables on the stack. This is
440440
/// only used for testing.
441441
unsigned DisableDebuggerShadowCopies : 1;
442-
442+
443443
/// Whether to disable using mangled names for accessing concrete type metadata.
444444
unsigned DisableConcreteTypeMetadataMangledNameAccessors : 1;
445445

@@ -524,7 +524,7 @@ class IRGenOptions {
524524
};
525525

526526
TypeInfoDumpFilter TypeInfoFilter;
527-
527+
528528
/// Pull in runtime compatibility shim libraries by autolinking.
529529
std::optional<llvm::VersionTuple> AutolinkRuntimeCompatibilityLibraryVersion;
530530
std::optional<llvm::VersionTuple>
@@ -543,13 +543,13 @@ class IRGenOptions {
543543
llvm::CallingConv::ID PlatformCCallingConvention;
544544

545545
/// Use CAS based object format as the output.
546-
bool UseCASBackend;
546+
bool UseCASBackend = false;
547547

548548
/// The output mode for the CAS Backend.
549549
llvm::CASBackendMode CASObjMode;
550550

551551
/// Emit a .casid file next to the object file if CAS Backend is used.
552-
bool EmitCASIDFile;
552+
bool EmitCASIDFile = false;
553553

554554
/// Paths to the pass plugins registered via -load-pass-plugin.
555555
std::vector<std::string> LLVMPassPlugins;

include/swift/Frontend/FrontendOptions.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,6 @@ class FrontendOptions {
137137
/// The module for which we should verify all of the generic signatures.
138138
std::string VerifyGenericSignaturesInModule;
139139

140-
/// Emit a .casid file next to the object file if CAS Backend is used.
141-
bool EmitCASIDFile = false;
142-
143140
/// CacheReplay PrefixMap.
144141
std::vector<std::string> CacheReplayPrefixMap;
145142

@@ -389,7 +386,7 @@ class FrontendOptions {
389386
/// are errors. The resulting serialized AST may include errors types and
390387
/// skip nodes entirely, depending on the errors involved.
391388
bool AllowModuleWithCompilerErrors = false;
392-
389+
393390
/// Whether or not the compiler must be strict in ensuring that implicit downstream
394391
/// module dependency build tasks must inherit the parent compiler invocation's context,
395392
/// such as `-Xcc` flags, etc.
@@ -519,7 +516,7 @@ class FrontendOptions {
519516

520517
/// Whether we're configured to track system intermodule dependencies.
521518
bool shouldTrackSystemDependencies() const;
522-
519+
523520
/// Whether we are configured with -typecheck or -typecheck-module-from-interface actuin
524521
bool isTypeCheckAction() const;
525522

@@ -535,7 +532,7 @@ class FrontendOptions {
535532
///
536533
/// \sa SymbolGraphASTWalker
537534
std::string SymbolGraphOutputDir;
538-
535+
539536
/// Whether to emit doc comment information in symbol graphs for symbols
540537
/// which are inherited through classes or default implementations.
541538
bool SkipInheritedDocs = false;

0 commit comments

Comments
 (0)