mirror of
https://github.com/YosysHQ/yosys
synced 2025-08-10 13:10:51 +00:00
Add YS_FALLTHROUGH macro to mark case fall-through
C++17 introduced [[fallthrough]], GCC and clang had their own vendored attributes before that. MSVC doesn't seem to have such a warning at all.
This commit is contained in:
parent
a299e606f8
commit
695150b037
5 changed files with 23 additions and 6 deletions
|
@ -923,7 +923,7 @@ void AstNode::detectSignWidthWorker(int &width_hint, bool &sign_hint, bool *foun
|
|||
}
|
||||
break;
|
||||
}
|
||||
/* fall through */
|
||||
YS_FALLTHROUGH
|
||||
|
||||
// everything should have been handled above -> print error if not.
|
||||
default:
|
||||
|
@ -1019,7 +1019,7 @@ RTLIL::SigSpec AstNode::genRTLIL(int width_hint, bool sign_hint)
|
|||
if (GetSize(children) >= 1 && children[0]->type == AST_CONSTANT) {
|
||||
current_module->parameter_default_values[str] = children[0]->asParaConst();
|
||||
}
|
||||
/* fall through */
|
||||
YS_FALLTHROUGH
|
||||
case AST_LOCALPARAM:
|
||||
if (flag_pwires)
|
||||
{
|
||||
|
@ -1807,7 +1807,8 @@ RTLIL::SigSpec AstNode::genRTLIL(int width_hint, bool sign_hint)
|
|||
is_signed = sign_hint;
|
||||
return SigSpec(wire);
|
||||
}
|
||||
} /* fall through */
|
||||
}
|
||||
YS_FALLTHROUGH
|
||||
|
||||
// everything should have been handled above -> print error if not.
|
||||
default:
|
||||
|
|
|
@ -91,7 +91,7 @@ std::string AstNode::process_format_str(const std::string &sformat, int next_arg
|
|||
case 'D':
|
||||
if (got_len)
|
||||
goto unsupported_format;
|
||||
/* fall through */
|
||||
YS_FALLTHROUGH
|
||||
case 'x':
|
||||
case 'X':
|
||||
if (next_arg >= GetSize(children))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue