--- a/src/yapf/yapf_costrail.hpp Wed Jun 27 22:26:27 2007 +0000
+++ b/src/yapf/yapf_costrail.hpp Wed Jun 27 22:29:57 2007 +0000
@@ -55,6 +55,7 @@
protected:
int m_max_cost;
CBlobT<int> m_sig_look_ahead_costs;
+ bool m_disable_cache;
public:
bool m_stopped_on_first_two_way_signal;
@@ -64,6 +65,7 @@
CYapfCostRailT()
: m_max_cost(0)
+ , m_disable_cache(false)
, m_stopped_on_first_two_way_signal(false)
{
// pre-compute look-ahead penalties into array
@@ -468,7 +470,8 @@
FORCEINLINE bool CanUseGlobalCache(Node& n) const
{
- return (n.m_parent != NULL)
+ return !m_disable_cache
+ && (n.m_parent != NULL)
&& (n.m_parent->m_num_signals_passed >= m_sig_look_ahead_costs.Size());
}
@@ -481,6 +484,10 @@
}
}
+ void DisableCache(bool disable)
+ {
+ m_disable_cache = disable;
+ }
};