Skip to content

Conversation

resistor
Copy link
Collaborator

For context, CheriotRTOS is a custom RTOS co-designed for the CHERIoT
CHERI-enabled RISCV32E platform. It uses a custom ABI and linkage model,
necesitating representing it in the target triple.

Copy link

github-actions bot commented Aug 26, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

For context, CheriotRTOS is a custom RTOS co-designed for the CHERIoT
CHERI-enabled RISCV32E platform. It uses a custom ABI and linkage model,
necesitating representing it in the target triple.
@resistor
Copy link
Collaborator Author

@jrtc27 @arichardson for visibility

.StartsWith("serenity", Triple::Serenity)
.StartsWith("vulkan", Triple::Vulkan)
.Default(Triple::UnknownOS);
.StartsWith("darwin", Triple::Darwin)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it would make sense to have a separate NFC PR to clang-format Triple.cpp?

LLVM is quite inconsistent with switch statements though... The clang-format coding style requires a newline, but there are lots of short switch statements that use the one-line style. And then some of them are manually aligned and others aren't...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❯ git grep -E '^\s*case\s+.+((return.*;)|(break;))$' lib | wc -l
6733
❯ git grep -E '^\s*case\s+.:$' lib | wc -l 
1102

It looks like the short case on a line is actually more common than the longer form, so maybe there should be a RFC to update the clang-format style to something like this

AllowShortCaseLabelsOnASingleLine: true
AlignConsecutiveShortCaseStatements:
  Enabled: true
  AcrossEmptyLines: true
  AcrossComments: true
  AlignCaseColons: false

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants