Commit Graph

6 Commits

Author SHA1 Message Date
Alessandro Di Federico 143c315196 Merge revng-c into revng 2024-11-21 10:50:55 +01:00
Alessandro Di Federico 2e4f4d09b9 Remaining FunctionTags have been moved to revng 2024-11-04 15:09:56 +01:00
Alessandro Di Federico 36e2faad3d Introduce -Wunreachable-code-break 2024-10-31 17:19:55 +01:00
Andrea Gussoni a6e96dcb93 FallThroughScope: remove SwitchBreak type
A `SwitchBreak` node should not have a specific associated
`FallThroughScopeType`, since its semantics represent the fact of a
`case` of the `switch` with no associated statements, and thus can be
represented with the `FallThrough` behavior.
2024-05-07 14:17:05 +02:00
Alessandro Di Federico 0c212b66d9 Relicense to MIT 2024-02-29 17:03:36 +01:00
Andrea Gussoni ca422bafd2 PromoteCallNoReturn: introduce beautify pass
We introduce the PromoteCallNoReturn beautification pass. Its goal is to
restructure sequence of statements, in order to have `call`s to
`noreturn` functions as _inlined_ in the middle of the statement
sequence, and leave _non local control flow statements_ at the end of
that scope. E.g., we prefer:
```
if (cond)
  call noreturnfunc();
return;
```
to
```
if (!cond)
  return;
call noreturnfunc();
```

In order to do this, contextually, we restructure the routine computing
the `fallthrough` property, in order to be able to differentiate between
the _non local control flow statements_, a call to a `noreturn`
function, or a generic mix of the two (useful when combining results
from the two situations above).

The new analysis is also used in the `promoteNoFallThrough` promotion
pass.
2023-11-28 16:19:08 +01:00