diff options
author | Clifford Wolf <clifford@clifford.at> | 2018-07-20 19:22:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-20 19:22:59 +0200 |
commit | 323f6f6f6006eadcaec180f2cc1556f1f3303be3 (patch) | |
tree | 5fa7d4a1b89185e008072bdbd51cbbcd05688280 /frontends/ast/ast.cc | |
parent | 1de07eeee22499760d18e00ba32edf64564aa25e (diff) | |
parent | 68b5d0c3b11588946982939c00fd6febe198e13f (diff) | |
download | yosys-323f6f6f6006eadcaec180f2cc1556f1f3303be3.tar.gz yosys-323f6f6f6006eadcaec180f2cc1556f1f3303be3.tar.bz2 yosys-323f6f6f6006eadcaec180f2cc1556f1f3303be3.zip |
Merge pull request #586 from hzeller/more-sourcepos-logging
Convert more log_error() to log_file_error() where possible.
Diffstat (limited to 'frontends/ast/ast.cc')
-rw-r--r-- | frontends/ast/ast.cc | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/frontends/ast/ast.cc b/frontends/ast/ast.cc index 999202b47..54ce6a05d 100644 --- a/frontends/ast/ast.cc +++ b/frontends/ast/ast.cc @@ -171,8 +171,8 @@ bool AstNode::get_bool_attribute(RTLIL::IdString id) AstNode *attr = attributes.at(id); if (attr->type != AST_CONSTANT) - log_error("Attribute `%s' with non-constant value at %s:%d!\n", - id.c_str(), attr->filename.c_str(), attr->linenum); + log_file_error(attr->filename, attr->linenum, "Attribute `%s' with non-constant value!\n", + id.c_str()); return attr->integer != 0; } @@ -955,8 +955,8 @@ static AstModule* process_module(AstNode *ast, bool defer) for (auto &attr : ast->attributes) { if (attr.second->type != AST_CONSTANT) - log_error("Attribute `%s' with non-constant value at %s:%d!\n", - attr.first.c_str(), ast->filename.c_str(), ast->linenum); + log_file_error(ast->filename, ast->linenum, "Attribute `%s' with non-constant value!\n", + attr.first.c_str()); current_module->attributes[attr.first] = attr.second->asAttrConst(); } for (size_t i = 0; i < ast->children.size(); i++) { @@ -1044,8 +1044,8 @@ void AST::process(RTLIL::Design *design, AstNode *ast, bool dump_ast1, bool dump if (design->has((*it)->str)) { RTLIL::Module *existing_mod = design->module((*it)->str); if (!nooverwrite && !overwrite && !existing_mod->get_bool_attribute("\\blackbox")) { - log_error("Re-definition of module `%s' at %s:%d!\n", - (*it)->str.c_str(), (*it)->filename.c_str(), (*it)->linenum); + log_file_error((*it)->filename, (*it)->linenum, "Re-definition of module `%s'!\n", + (*it)->str.c_str()); } else if (nooverwrite) { log("Ignoring re-definition of module `%s' at %s:%d.\n", (*it)->str.c_str(), (*it)->filename.c_str(), (*it)->linenum); @@ -1197,4 +1197,3 @@ void AST::use_internal_line_num() } YOSYS_NAMESPACE_END - |