common: Use NPNR_ASSERT_FALSE for unreachable case

This commit is contained in:
Rowan Goemans 2024-09-23 16:14:40 +02:00
parent 9c97b8736e
commit 3eeb0e2877
2 changed files with 5 additions and 6 deletions

View File

@ -30,7 +30,6 @@
#include "archdefs.h" #include "archdefs.h"
#include "hashlib.h" #include "hashlib.h"
#include "indexed_store.h" #include "indexed_store.h"
#include "log.h"
#include "nextpnr_base_types.h" #include "nextpnr_base_types.h"
#include "nextpnr_namespaces.h" #include "nextpnr_namespaces.h"
#include "property.h" #include "property.h"
@ -201,7 +200,7 @@ enum PortType
case PORT_INOUT: case PORT_INOUT:
return "PORT_INOUT"; return "PORT_INOUT";
default: default:
log_error("Impossible PortType"); NPNR_ASSERT_FALSE("Impossible PortType");
} }
} }
@ -250,7 +249,7 @@ enum TimingPortClass
case TMG_IGNORE: case TMG_IGNORE:
return "TMG_IGNORE"; return "TMG_IGNORE";
default: default:
log_error("Impossible TimingPortClass"); NPNR_ASSERT_FALSE("Impossible TimingPortClass");
} }
} }
@ -268,7 +267,7 @@ enum ClockEdge
case FALLING_EDGE: case FALLING_EDGE:
return "FALLING_EDGE"; return "FALLING_EDGE";
default: default:
log_error("Impossible ClockEdge"); NPNR_ASSERT_FALSE("Impossible ClockEdge");
} }
} }
@ -438,7 +437,7 @@ struct CriticalPath
case Type::HOLD: case Type::HOLD:
return "hold"; return "hold";
default: default:
log_error("Impossible Segment::Type"); NPNR_ASSERT_FALSE("Impossible Segment::Type");
} }
} }

View File

@ -1318,7 +1318,7 @@ const std::string TimingAnalyser::arcType_to_str(CellArc::ArcType typ)
case TimingAnalyser::CellArc::ENDPOINT: case TimingAnalyser::CellArc::ENDPOINT:
return "ENDPOINT"; return "ENDPOINT";
default: default:
log_error("Impossible CellArc::ArcType\n"); NPNR_ASSERT_FALSE("Impossible CellArc::ArcType\n");
} }
} }