[clang] [NFC][RootSignatures] Conform to new std::optional calling conventions (PR #136747)
Ashley Coleman via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 23 14:58:28 PDT 2025
================
@@ -26,22 +26,14 @@ RootSignatureParser::RootSignatureParser(SmallVector<RootElement> &Elements,
bool RootSignatureParser::parse() {
// Iterate as many RootElements as possible
- while (tryConsumeExpectedToken(TokenKind::kw_DescriptorTable)) {
- // Dispatch onto parser method.
- // We guard against the unreachable here as we just ensured that CurToken
- // will be one of the kinds in the while condition
- switch (CurToken.TokKind) {
- case TokenKind::kw_DescriptorTable:
- if (parseDescriptorTable())
+ do {
+ if (tryConsumeExpectedToken(TokenKind::kw_DescriptorTable)) {
+ auto Table = parseDescriptorTable();
+ if (!Table.has_value())
return true;
- break;
- default:
- llvm_unreachable("Switch for consumed token was not provided");
+ Elements.push_back(*Table);
----------------
V-FEXrt wrote:
what does this line map to in the old code? I'm not seeing it anywhere
https://github.com/llvm/llvm-project/pull/136747
More information about the cfe-commits
mailing list