3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-08-10 21:20:53 +00:00

ast: remove null_check as dead code

This commit is contained in:
Emil J. Tywoniak 2025-08-08 12:32:43 +02:00
parent 5e8986be4f
commit 32792815eb
2 changed files with 0 additions and 13 deletions

View file

@ -259,7 +259,6 @@ namespace AST
// simplify() creates a simpler AST by unrolling for-loops, expanding generate blocks, etc.
// it also sets the id2ast pointers so that identifier lookups are fast in genRTLIL()
bool simplify(bool const_fold, int stage, int width_hint, bool sign_hint);
void null_check();
void replace_result_wire_name_in_function(const std::string &from, const std::string &to);
std::unique_ptr<AstNode> readmem(bool is_readmemh, std::string mem_filename, AstNode *memory, int start_addr, int finish_addr, bool unconditional_init);
void expand_genblock(const std::string &prefix);

View file

@ -888,16 +888,6 @@ static void check_auto_nosync(AstNode *node)
check_auto_nosync(child.get());
}
void AstNode::null_check()
{
for (auto& child : children) {
// if (!child)
// VALGRIND_PRINTF_BACKTRACE("null child");
log_assert((bool) child);
child->null_check();
}
}
// convert the AST into a simpler AST that has all parameters substituted by their
// values, unrolled for-loops, expanded generate blocks, etc. when this function
// is done with an AST it can be converted into RTLIL using genRTLIL().
@ -906,7 +896,6 @@ void AstNode::null_check()
// nodes that link to a different node using names and lexical scoping.
bool AstNode::simplify(bool const_fold, int stage, int width_hint, bool sign_hint)
{
// null_check();
static int recursion_counter = 0;
static bool deep_recursion_warning = false;
@ -4367,7 +4356,6 @@ apply_newNode:
// dumpAst(stderr, "- ");
// newNode->dumpAst(stderr, "+ ");
log_assert(newNode != nullptr);
// newNode->null_check();
newNode->location.begin.filename = location.begin.filename;
newNode->location = location;
newNode->cloneInto(*this);