Removed lints

This commit is contained in:
Artur K
2012-03-10 22:46:15 +01:00
parent eb6c1ac939
commit 3bcbb7a2cf
35 changed files with 301 additions and 472 deletions

View File

@@ -105,7 +105,7 @@ bool Idiom18::match(iICODE picode)
/* not supported yet */
type = 0;
}
else if (m_icodes[1]->ll()->dst.regi < INDEX_BX_SI) /* register */
else if ( m_icodes[1]->ll()->dst.isReg() ) /* register */
{
if ((m_icodes[1]->ll()->dst.regi == rSI) && (m_func->flg & SI_REGVAR))
type = 1;
@@ -131,7 +131,7 @@ bool Idiom18::match(iICODE picode)
if (m_icodes[0]->ll()->match(iMOV) && (m_icodes[0]->ll()->src.regi == m_icodes[1]->ll()->dst.regi))
{
regi = m_icodes[0]->ll()->dst.regi;
if ((regi > 0) && (regi < INDEX_BX_SI))
if ( m_icodes[0]->ll()->dst.isReg() )
{
if ( m_icodes[2]->ll()->match(iCMP) && (m_icodes[2]->ll()->dst.regi == regi) &&
m_icodes[3]->ll()->conditionalJump() )
@@ -143,7 +143,7 @@ bool Idiom18::match(iICODE picode)
if (m_icodes[0]->ll()->match(iMOV) && (m_icodes[0]->ll()->src.off == m_icodes[1]->ll()->dst.off))
{
regi = m_icodes[0]->ll()->dst.regi;
if ((regi > 0) && (regi < INDEX_BX_SI))
if ( m_icodes[0]->ll()->dst.isReg() )
{
if ( m_icodes[2]->ll()->match(iCMP) && (m_icodes[2]->ll()->dst.regi == regi) &&
m_icodes[3]->ll()->conditionalJump() )
@@ -194,7 +194,7 @@ bool Idiom19::match(iICODE picode)
m_is_dec = m_icodes[0]->ll()->match(iDEC);
if (m_icodes[0]->ll()->dst.regi == 0) /* global variable */
/* not supported yet */ ;
else if (m_icodes[0]->ll()->dst.regi < INDEX_BX_SI) /* register */
else if ( m_icodes[0]->ll()->dst.isReg() ) /* register */
{
// if (((picode->ll()->dst.regi == rSI) && (pproc->flg & SI_REGVAR)) ||
// ((picode->ll()->dst.regi == rDI) && (pproc->flg & DI_REGVAR)))
@@ -248,23 +248,24 @@ bool Idiom20::match(iICODE picode)
m_is_dec = m_icodes[0]->ll()->match(iDEC);
LLOperand &ll_dest(m_icodes[0]->ll()->dst);
/* Get variable */
if (m_icodes[0]->ll()->dst.regi == 0) /* global variable */
if (ll_dest.regi == 0) /* global variable */
{
/* not supported yet */ ;
}
else if (m_icodes[0]->ll()->dst.regi < INDEX_BX_SI) /* register */
else if ( ll_dest.isReg() ) /* register */
{
if ((m_icodes[0]->ll()->dst.regi == rSI) && (m_func->flg & SI_REGVAR))
if ((ll_dest.regi == rSI) && (m_func->flg & SI_REGVAR))
type = 1;
else if ((m_icodes[0]->ll()->dst.regi == rDI) && (m_func->flg & DI_REGVAR))
else if ((ll_dest.regi == rDI) && (m_func->flg & DI_REGVAR))
type = 1;
}
else if (m_icodes[0]->ll()->dst.off) /* local variable */
else if (ll_dest.off) /* local variable */
type = 2;
else /* indexed */
{
printf("idiom20 : Unsupported type\n");
printf("idiom20 : Unsupported type [indexed]\n");
/* not supported yet */ ;
}
@@ -272,10 +273,10 @@ bool Idiom20::match(iICODE picode)
if (type == 1) /* register variable */
{
if (m_icodes[1]->ll()->match(iMOV) &&
(m_icodes[1]->ll()->src.regi == m_icodes[0]->ll()->dst.regi))
(m_icodes[1]->ll()->src.regi == ll_dest.regi))
{
regi = m_icodes[1]->ll()->dst.regi;
if ((regi > 0) && (regi < INDEX_BX_SI))
if ( m_icodes[1]->ll()->dst.isReg() )
{
if (m_icodes[2]->ll()->match(iCMP,(eReg)regi) &&
m_icodes[3]->ll()->conditionalJump())
@@ -286,10 +287,10 @@ bool Idiom20::match(iICODE picode)
else if (type == 2) /* local */
{
if ( m_icodes[0]->ll()->match(iMOV) &&
(m_icodes[1]->ll()->src.off == m_icodes[0]->ll()->dst.off))
(m_icodes[1]->ll()->src.off == ll_dest.off))
{
regi = m_icodes[1]->ll()->dst.regi;
if ((regi > 0) && (regi < INDEX_BX_SI))
if ( m_icodes[1]->ll()->dst.isReg() )
{
if (m_icodes[2]->ll()->match(iCMP,(eReg)regi) &&
m_icodes[3]->ll()->conditionalJump())

View File

@@ -140,7 +140,7 @@ int Idiom4::action()
{
if( ! m_icodes.empty()) // if not an empty RET[F] N
{
for(size_t idx=0; idx<m_icodes.size()-1; ++idx) // invalidate all but the RET
for(size_t idx=0; idx<m_icodes.size()-1; ++idx) // don't invalidate last entry
m_icodes[idx]->invalidate();
}
if(m_param_count)

View File

@@ -123,14 +123,8 @@ bool Idiom1::match(iICODE picode)
}
int Idiom1::action()
{
#ifdef _lint
for (auto ik=m_icodes.begin(); ik!=m_icodes.end(); ++ik)
{
iICODE ic(*ik);
#else
for(iICODE ic : m_icodes)
{
#endif
ic->invalidate();
}
m_func->flg |= PROC_HLL;

View File

@@ -57,7 +57,6 @@ int Idiom8::action()
****************************************************************************/
bool Idiom15::match(iICODE pIcode)
{
uint8_t regi;
if(distance(pIcode,m_end)<2)
@@ -72,7 +71,6 @@ bool Idiom15::match(iICODE pIcode)
pIcode->ll()->match(iSHL,(eReg)regi,I) and
(pIcode->ll()->src.op() == 1) )
{
m_icodes.push_back(pIcode++);
}
return m_icodes.size()>1;