Skip to content

Commit c6f5995

Browse files
committed
[definite-init] Convert always true bool return value to void.
Just a small cleanup.
1 parent 9afa479 commit c6f5995

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/SILOptimizer/Mandatory/DefiniteInitialization.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2818,7 +2818,7 @@ bool LifetimeChecker::isInitializedAtUse(const DIMemoryUse &Use,
28182818
// Top Level Driver
28192819
//===----------------------------------------------------------------------===//
28202820

2821-
static bool processMemoryObject(MarkUninitializedInst *I) {
2821+
static void processMemoryObject(MarkUninitializedInst *I) {
28222822
LLVM_DEBUG(llvm::dbgs() << "*** Definite Init looking at: " << *I << "\n");
28232823
DIMemoryObjectInfo MemInfo(I);
28242824

@@ -2830,7 +2830,6 @@ static bool processMemoryObject(MarkUninitializedInst *I) {
28302830
/*TreatAddressToPointerAsInout*/ true);
28312831

28322832
LifetimeChecker(MemInfo, UseInfo).doIt();
2833-
return true;
28342833
}
28352834

28362835
/// Check that all memory objects that require initialization before use are
@@ -2846,11 +2845,14 @@ static bool checkDefiniteInitialization(SILFunction &Fn) {
28462845
SILInstruction *Inst = &*I;
28472846

28482847
auto *MUI = dyn_cast<MarkUninitializedInst>(Inst);
2849-
if (!MUI || !processMemoryObject(MUI)) {
2848+
if (!MUI) {
28502849
++I;
28512850
continue;
28522851
}
28532852

2853+
// Then process the memory object.
2854+
processMemoryObject(MUI);
2855+
28542856
// Move off of the MUI only after we have processed memory objects. The
28552857
// lifetime checker may rewrite instructions, so it is important to not
28562858
// move onto the next element until after it runs.

0 commit comments

Comments
 (0)