Remove CFG-based check for missing value-returns.
This check is redundant; we now determine this at function finalization time (http://review.skia.org/379056) and error out before this check can be reached. Change-Id: I1706adb90435b430883d7d1ab44cb5dc98fccd8c Bug: skia:11377 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/379836 Auto-Submit: John Stiles <johnstiles@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
This commit is contained in:
parent
532138cea7
commit
0404933136
@ -1389,14 +1389,6 @@ bool Compiler::scanCFG(FunctionDefinition& f, ProgramUsage* usage) {
|
|||||||
} while (optimizationContext.fUpdated);
|
} while (optimizationContext.fUpdated);
|
||||||
SkASSERT(!optimizationContext.fNeedsRescan);
|
SkASSERT(!optimizationContext.fNeedsRescan);
|
||||||
|
|
||||||
// check for missing return
|
|
||||||
if (f.declaration().returnType() != *fContext->fTypes.fVoid) {
|
|
||||||
if (cfg.fBlocks[cfg.fExit].fIsReachable) {
|
|
||||||
this->error(f.fOffset, String("function '" + String(f.declaration().name()) +
|
|
||||||
"' can exit without returning a value"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return madeChanges;
|
return madeChanges;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user