3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-24 01:25:33 +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:
Xiretza 2020-05-04 21:12:30 +02:00
parent a299e606f8
commit 695150b037
No known key found for this signature in database
GPG key ID: E51A6C6A1EB378ED
5 changed files with 23 additions and 6 deletions

View file

@ -2346,16 +2346,22 @@ struct CxxrtlBackend : public Backend {
case 6:
worker.max_opt_level = true;
worker.run_proc_flatten = true;
YS_FALLTHROUGH
case 5:
worker.run_opt_clean_purge = true;
YS_FALLTHROUGH
case 4:
worker.localize_public = true;
YS_FALLTHROUGH
case 3:
worker.elide_public = true;
YS_FALLTHROUGH
case 2:
worker.localize_internal = true;
YS_FALLTHROUGH
case 1:
worker.elide_internal = true;
YS_FALLTHROUGH
case 0:
break;
default:

View file

@ -343,7 +343,7 @@ struct FirrtlWorker
switch (dir) {
case FD_INOUT:
log_warning("Instance port connection %s.%s is INOUT; treating as OUT\n", cell_type.c_str(), log_signal(it->second));
/* FALLTHRU */
YS_FALLTHROUGH
case FD_OUT:
sourceExpr = firstName;
sinkExpr = secondExpr;
@ -351,7 +351,7 @@ struct FirrtlWorker
break;
case FD_NODIRECTION:
log_warning("Instance port connection %s.%s is NODIRECTION; treating as IN\n", cell_type.c_str(), log_signal(it->second));
/* FALLTHRU */
YS_FALLTHROUGH
case FD_IN:
sourceExpr = secondExpr;
sinkExpr = firstName;