mirror of
https://github.com/YosysHQ/yosys
synced 2025-09-11 04:01:28 +00:00
libparse/filterlib: mark LibertyParser::error() as weak
When FILTERLIB is defined (attempts to compile libparse more or less standalone,) mark the `LibertyParser::error()` as weak so utilities using libparse as a library can override its behavior (the default behavior being exit(1)). As the code is quite performance-critical, I've elected to not modify it to raise an exception or have a callback or similar and simply allow for a link-time replacement.
This commit is contained in:
parent
cec48c6abd
commit
ae8c4e2ea6
1 changed files with 3 additions and 0 deletions
|
@ -676,12 +676,15 @@ void LibertyParser::error(const std::string &str) const
|
|||
|
||||
#else
|
||||
|
||||
YS_ATTRIBUTE(weak)
|
||||
void LibertyParser::error() const
|
||||
{
|
||||
fprintf(stderr, "Syntax error in liberty file on line %d.\n", line);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
YS_ATTRIBUTE(weak)
|
||||
void LibertyParser::error(const std::string &str) const
|
||||
{
|
||||
std::stringstream ss;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue