mirror of
https://github.com/YosysHQ/yosys
synced 2025-07-29 15:37:59 +00:00
YosysJS stuff
This commit is contained in:
parent
08c0fe164f
commit
e0e6d130cd
7 changed files with 156 additions and 16 deletions
|
@ -48,6 +48,7 @@ bool log_error_stderr = false;
|
|||
bool log_cmd_error_throw = false;
|
||||
bool log_quiet_warnings = false;
|
||||
int log_verbose_level;
|
||||
string log_last_error;
|
||||
|
||||
vector<int> header_count;
|
||||
pool<RTLIL::IdString> log_id_cache;
|
||||
|
@ -173,6 +174,10 @@ void logv_warning(const char *format, va_list ap)
|
|||
|
||||
void logv_error(const char *format, va_list ap)
|
||||
{
|
||||
#ifdef EMSCRIPTEN
|
||||
auto backup_log_files = log_files;
|
||||
#endif
|
||||
|
||||
if (log_errfile != NULL)
|
||||
log_files.push_back(log_errfile);
|
||||
|
||||
|
@ -181,10 +186,16 @@ void logv_error(const char *format, va_list ap)
|
|||
if (f == stdout)
|
||||
f = stderr;
|
||||
|
||||
log("ERROR: ");
|
||||
logv(format, ap);
|
||||
log_last_error = vstringf(format, ap);
|
||||
log("ERROR: %s", log_last_error.c_str());
|
||||
log_flush();
|
||||
|
||||
#ifdef EMSCRIPTEN
|
||||
log_files = backup_log_files;
|
||||
throw 0;
|
||||
#else
|
||||
exit(1);
|
||||
#endif
|
||||
}
|
||||
|
||||
void log(const char *format, ...)
|
||||
|
@ -224,8 +235,8 @@ void log_cmd_error(const char *format, ...)
|
|||
va_start(ap, format);
|
||||
|
||||
if (log_cmd_error_throw) {
|
||||
log("ERROR: ");
|
||||
logv(format, ap);
|
||||
log_last_error = vstringf(format, ap);
|
||||
log("ERROR: %s", log_last_error.c_str());
|
||||
log_flush();
|
||||
throw log_cmd_error_exception();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue