diff options
author | Clifford Wolf <clifford@clifford.at> | 2019-08-22 10:24:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-22 10:24:42 +0200 |
commit | 34a7c0209d23e8905009c4c122f850be6dd3ac05 (patch) | |
tree | e31e510677449df802edce200ccb85bae5060ad0 /frontends/ast/simplify.cc | |
parent | 841903582f5f063fa1f8de7fbfaed7ac7eca373a (diff) | |
parent | a6776ee35ee5404ca7d5b63fd2daccc46354112c (diff) | |
download | yosys-34a7c0209d23e8905009c4c122f850be6dd3ac05.tar.gz yosys-34a7c0209d23e8905009c4c122f850be6dd3ac05.tar.bz2 yosys-34a7c0209d23e8905009c4c122f850be6dd3ac05.zip |
Merge pull request #1316 from YosysHQ/eddie/fix_mem2reg
mem2reg to preserve user attributes and src
Diffstat (limited to 'frontends/ast/simplify.cc')
-rw-r--r-- | frontends/ast/simplify.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/frontends/ast/simplify.cc b/frontends/ast/simplify.cc index 54b9efaad..8493aa513 100644 --- a/frontends/ast/simplify.cc +++ b/frontends/ast/simplify.cc @@ -150,6 +150,10 @@ bool AstNode::simplify(bool const_fold, bool at_zero, bool in_lvalue, int stage, reg->str = stringf("%s[%d]", node->str.c_str(), i); reg->is_reg = true; reg->is_signed = node->is_signed; + for (auto &it : node->attributes) + reg->attributes.emplace(it.first, it.second->clone()); + reg->filename = node->filename; + reg->linenum = node->linenum; children.push_back(reg); while (reg->simplify(true, false, false, 1, -1, false, false)) { } } |