diff options
| author | Sirraide <aeternalmail@gmail.com> | 2025-09-02 18:37:19 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-02 16:37:19 +0000 |
| commit | e4a1b5f36e71c8c382bdd531867c5f6eb3f7deac (patch) | |
| tree | 5ed6131d9d0abadc4e4726509c3c01cdf264600d /lldb/test/API/python_api/sbstructureddata/TestStructuredDataAPI.py | |
| parent | 83f390859e186d22af8aa32135d7993079ed4666 (diff) | |
[Clang] [C2y] Implement N3355 ‘Named Loops’ (#152870)
This implements support for [named
loops](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3355.htm) for
C2y.
When parsing a `LabelStmt`, we create the `LabeDecl` early before we parse
the substatement; this label is then passed down to `ParseWhileStatement()`
and friends, which then store it in the loop’s (or switch statement’s) `Scope`;
when we encounter a `break/continue` statement, we perform a lookup for
the label (and error if it doesn’t exist), and then walk the scope stack and
check if there is a scope whose preceding label is the target label, which
identifies the jump target.
The feature is only supported in C2y mode, though a cc1-only option
exists for testing (`-fnamed-loops`), which is mostly intended to try
and make sure that we don’t have to refactor this entire implementation
when/if we start supporting it in C++.
---------
Co-authored-by: Balazs Benics <benicsbalazs@gmail.com>
Diffstat (limited to 'lldb/test/API/python_api/sbstructureddata/TestStructuredDataAPI.py')
0 files changed, 0 insertions, 0 deletions
