summaryrefslogtreecommitdiffstats
path: root/microbe/optimizer.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-29 16:05:55 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-29 16:05:55 +0000
commit87a016680e3677da3993f333561e79eb0cead7d5 (patch)
treecbda2b4df8b8ee0d8d1617e6c75bec1e3ee0ccba /microbe/optimizer.cpp
parent6ce3d1ad09c1096b5ed3db334e02859e45d5c32b (diff)
downloadktechlab-87a016680e3677da3993f333561e79eb0cead7d5.tar.gz
ktechlab-87a016680e3677da3993f333561e79eb0cead7d5.zip
TQt4 port ktechlab
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/ktechlab@1238801 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'microbe/optimizer.cpp')
-rw-r--r--microbe/optimizer.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/microbe/optimizer.cpp b/microbe/optimizer.cpp
index 33b0bcd..7b8d059 100644
--- a/microbe/optimizer.cpp
+++ b/microbe/optimizer.cpp
@@ -18,10 +18,10 @@
using namespace std;
-QString binary( uchar val )
+TQString binary( uchar val )
{
- QString bin = QString::number( val, 2 );
- QString pad;
+ TQString bin = TQString::number( val, 2 );
+ TQString pad;
pad.fill( '0', 8-bin.length() );
return pad + bin;
}
@@ -143,7 +143,7 @@ bool Optimizer::pruneInstructions()
//BEGIN remove labels without any reference to them
// First: build up a list of labels which are referenced
- QStringList referencedLabels;
+ TQStringList referencedLabels;
for ( it = m_pCode->begin(); it != end; ++it )
{
if ( Instr_goto * ins = dynamic_cast<Instr_goto*>(*it) )
@@ -155,12 +155,12 @@ bool Optimizer::pruneInstructions()
// Now remove labels from instructions that aren't in the referencedLabels list
for ( it = m_pCode->begin(); it != end; ++it )
{
- QStringList labels = (*it)->labels();
+ TQStringList labels = (*it)->labels();
- QStringList::iterator labelsEnd = labels.end();
- for ( QStringList::iterator labelsIt = labels.begin(); labelsIt != labelsEnd; )
+ TQStringList::iterator labelsEnd = labels.end();
+ for ( TQStringList::iterator labelsIt = labels.begin(); labelsIt != labelsEnd; )
{
- if ( !referencedLabels.contains( *labelsIt ) )
+ if ( !referencedLabels.tqcontains( *labelsIt ) )
{
labelsIt = labels.erase( labelsIt );
removed = true;
@@ -386,8 +386,8 @@ bool Optimizer::optimizeInstructions()
{
// If we are testing STATUS, then we assume that the bits changed
// are only those that are marked as independent.
- uchar bitmask = ( i == 1 ) ? behaviour.reg( Register::STATUS ).indep : 0xff;
- if ( !canRemove( *it, (i == 0) ? regSet : Register::STATUS, bitmask ) )
+ uchar bittqmask = ( i == 1 ) ? behaviour.reg( Register::STATUS ).indep : 0xff;
+ if ( !canRemove( *it, (i == 0) ? regSet : Register::STATUS, bittqmask ) )
{
ok = false;
break;
@@ -409,7 +409,7 @@ bool Optimizer::optimizeInstructions()
}
-bool Optimizer::redirectGotos( Instruction * current, const QString & label )
+bool Optimizer::redirectGotos( Instruction * current, const TQString & label )
{
if ( current->isUsed() )
return false;
@@ -479,7 +479,7 @@ bool Optimizer::canRemove( Instruction * ins, const Register & reg, uchar bitMas
// The bits that are depended upon in the future for this register
uchar depends = generateRegisterDepends( ins, reg );
- // Only interested in those bits allowed by the bit mask
+ // Only interested in those bits allowed by the bit tqmask
depends &= bitMask;
RegisterState inputState = ins->inputState().reg( reg );