mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
when emitting the epilog 'return 0' for top level code, mark it as autogenerated,
fixing <rdar://problem/19664185> Pointless "always evaluates to true" warning in while true loops at the top level Also, merge test/SILPasses/diagnose_unreachable_two_while_loops.swift into SILPasses/unreachable_code.swift. Swift SVN r27696
This commit is contained in:
@@ -812,9 +812,10 @@ public:
|
||||
if (sgm.TopLevelSGF) {
|
||||
// Write out the epilog.
|
||||
auto moduleLoc = RegularLocation::getModuleLocation();
|
||||
auto returnInfo
|
||||
= sgm.TopLevelSGF->emitEpilogBB(moduleLoc);
|
||||
moduleLoc.markAutoGenerated();
|
||||
auto returnInfo = sgm.TopLevelSGF->emitEpilogBB(moduleLoc);
|
||||
auto returnLoc = returnInfo.second;
|
||||
returnLoc.markAutoGenerated();
|
||||
|
||||
// Signal a normal return to the OS by returning 0.
|
||||
auto &B = sgm.TopLevelSGF->B;
|
||||
|
||||
Reference in New Issue
Block a user