Some "const" cleanups in SigMap

This commit is contained in:
Clifford Wolf 2014-07-19 15:32:39 +02:00
parent 26f982ac0b
commit 1c288adcc0
1 changed files with 4 additions and 4 deletions

View File

@ -407,12 +407,12 @@ struct SigMap
} }
// internal helper function // internal helper function
void map_bit(RTLIL::SigChunk &c) void map_bit(RTLIL::SigChunk &c) const
{ {
assert(c.width == 1); assert(c.width == 1);
bitDef_t bit(c.wire, c.offset); bitDef_t bit(c.wire, c.offset);
if (c.wire && bits.count(bit) > 0) if (c.wire && bits.count(bit) > 0)
c = bits[bit]->chunk; c = bits.at(bit)->chunk;
} }
void add(RTLIL::SigSpec from, RTLIL::SigSpec to) void add(RTLIL::SigSpec from, RTLIL::SigSpec to)
@ -459,7 +459,7 @@ struct SigMap
unregister_bit(c); unregister_bit(c);
} }
void apply(RTLIL::SigSpec &sig) void apply(RTLIL::SigSpec &sig) const
{ {
sig.expand(); sig.expand();
for (auto &c : sig.chunks) for (auto &c : sig.chunks)
@ -467,7 +467,7 @@ struct SigMap
sig.optimize(); sig.optimize();
} }
RTLIL::SigSpec operator()(RTLIL::SigSpec sig) RTLIL::SigSpec operator()(RTLIL::SigSpec sig) const
{ {
apply(sig); apply(sig);
return sig; return sig;