diff options
| author | Eddie Hung <eddie@fpgeh.com> | 2020-02-29 08:15:24 -0800 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-02-29 08:15:24 -0800 | 
| commit | 69c2d3848a3fb51887452cc52877db9d95965f11 (patch) | |
| tree | a026c71d1cbf84c332262704c16c385d974d708f | |
| parent | b741954461ec403401730774e4197f836d8d209b (diff) | |
| parent | de3e5fcdc6a3775231b303b89c2bbf551aeaaf42 (diff) | |
| download | yosys-69c2d3848a3fb51887452cc52877db9d95965f11.tar.gz yosys-69c2d3848a3fb51887452cc52877db9d95965f11.tar.bz2 yosys-69c2d3848a3fb51887452cc52877db9d95965f11.zip | |
Merge pull request #1727 from YosysHQ/eddie/fix_write_smt2
ystests: fix write_smt2_write_smt2_cyclic_dependency_fail
| -rw-r--r-- | passes/opt/opt_clean.cc | 22 | 
1 files changed, 11 insertions, 11 deletions
| diff --git a/passes/opt/opt_clean.cc b/passes/opt/opt_clean.cc index f5bb40050..cac265a52 100644 --- a/passes/opt/opt_clean.cc +++ b/passes/opt/opt_clean.cc @@ -51,18 +51,18 @@ struct keep_cache_t  		if (cache.count(module))  			return cache.at(module); -		bool found_keep = false; -		if (module->get_bool_attribute(ID::keep)) -			found_keep = true; -		else -			for (auto cell : module->cells()) -				if (query(cell, true /* ignore_specify */)) { -					found_keep = true; -					break; -				} -		cache[module] = found_keep; +		cache[module] = true; +		if (!module->get_bool_attribute(ID::keep)) { +		    bool found_keep = false; +		    for (auto cell : module->cells()) +			if (query(cell, true /* ignore_specify */)) { +			    found_keep = true; +			    break; +			} +		    cache[module] = found_keep; +		} -		return found_keep; +		return cache[module];  	}  	bool query(Cell *cell, bool ignore_specify = false) | 
