Skip to content

Commit 5512310

Browse files
committed
Reorder SwitchArm fields
1 parent fe80c92 commit 5512310

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

cpp2rust/converter/converter_lib.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -929,9 +929,9 @@ std::vector<SwitchArm> AnalyzeSwitchArms(clang::CompoundStmt *body) {
929929
}
930930

931931
if (auto *sc = clang::dyn_cast<clang::SwitchCase>(inner)) {
932-
arms.push_back({sc,
932+
arms.push_back({{GetLastStmtOfSwitchCase(sc)},
933933
label,
934-
{GetLastStmtOfSwitchCase(sc)},
934+
sc,
935935
CaseChainHasDefault(sc),
936936
/*has_fallthrough=*/false});
937937
} else if (!arms.empty()) {

cpp2rust/converter/converter_lib.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,9 @@ bool ContainsVAArgExpr(const clang::Stmt *stmt);
184184
clang::Expr *NormalizeToBool(clang::Expr *expr, clang::ASTContext &ctx);
185185

186186
struct SwitchArm {
187-
clang::SwitchCase *head;
188-
llvm::StringRef label;
189187
std::vector<clang::Stmt *> body;
188+
llvm::StringRef label;
189+
clang::SwitchCase *head;
190190
bool is_default_case;
191191
bool has_fallthrough;
192192
};

0 commit comments

Comments
 (0)