Skip to content

Commit 23765a0

Browse files
committed
Delete unused functions
1 parent 0749c51 commit 23765a0

2 files changed

Lines changed: 0 additions & 24 deletions

File tree

cpp2rust/converter/converter_lib.cpp

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -712,26 +712,4 @@ std::vector<clang::Stmt *> GetSwitchCaseBody(clang::CompoundStmt *body,
712712
return out;
713713
}
714714

715-
static bool SwitchCaseHasFallthrough(clang::Stmt *stmt) {
716-
if (stmt) {
717-
if (clang::isa<clang::BreakStmt>(stmt) ||
718-
clang::isa<clang::ReturnStmt>(stmt)) {
719-
return false;
720-
}
721-
}
722-
return true;
723-
}
724-
725-
bool SwitchHasFallthrough(clang::SwitchStmt *stmt) {
726-
if (auto *body = clang::dyn_cast<clang::CompoundStmt>(stmt->getBody())) {
727-
for (auto top_level_case : GetTopLevelSwitchCases(stmt)) {
728-
auto arm = GetSwitchCaseBody(body, top_level_case);
729-
if (arm.empty() || SwitchCaseHasFallthrough(arm.back())) {
730-
return true;
731-
}
732-
}
733-
}
734-
return false;
735-
}
736-
737715
} // namespace cpp2rust

cpp2rust/converter/converter_lib.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,4 @@ bool SwitchCaseContainsDefault(clang::SwitchCase *c);
162162
std::vector<clang::Stmt *> GetSwitchCaseBody(clang::CompoundStmt *body,
163163
clang::SwitchCase *head);
164164

165-
bool SwitchHasFallthrough(clang::SwitchStmt *stmt);
166-
167165
} // namespace cpp2rust

0 commit comments

Comments
 (0)