Rename method

This commit is contained in:
de4dot 2011-12-15 10:01:46 +01:00
parent c73459f1be
commit a3c9221410
3 changed files with 10 additions and 10 deletions

View File

@ -298,7 +298,7 @@ namespace de4dot.blocks {
ScopeBlock getScopeBlock(BaseBlock bb) {
BlockState current = stateStack.Peek();
if (current.scopeBlock.isOurBlockBase(bb))
if (current.scopeBlock.isOurBaseBlock(bb))
return current.scopeBlock;
return (ScopeBlock)current.scopeBlock.toChild(bb);
}

View File

@ -96,14 +96,14 @@ namespace de4dot.blocks {
bool isOneSourceInAnotherScopeBlock(Block block) {
foreach (var source in block.Sources) {
if (!scopeBlock.isOurBlockBase(source))
if (!scopeBlock.isOurBaseBlock(source))
return true;
}
return false;
}
void scanBaseBlock(BaseBlock bb, int stackStart) {
if (blockInfos.ContainsKey(bb) || !scopeBlock.isOurBlockBase(bb))
if (blockInfos.ContainsKey(bb) || !scopeBlock.isOurBaseBlock(bb))
return;
var blockInfo = new BlockInfo(bb, stackStart);
@ -134,7 +134,7 @@ namespace de4dot.blocks {
}
void addToNewList(BaseBlock bb) {
if (inNewList.ContainsKey(bb) || !scopeBlock.isOurBlockBase(bb))
if (inNewList.ContainsKey(bb) || !scopeBlock.isOurBaseBlock(bb))
return;
inNewList[bb] = true;
@ -145,7 +145,7 @@ namespace de4dot.blocks {
}
else {
foreach (var source in block.Sources) {
if (scopeBlock.isOurBlockBase(source)) {
if (scopeBlock.isOurBaseBlock(source)) {
addToNewList(source); // Make sure it's before this block
break;
}

View File

@ -118,7 +118,7 @@ namespace de4dot.blocks {
continue; // Not dead
if (block == baseBlocks[0])
continue; // It's the start of this block fence so must be present
if (!isOurBlockBase(block))
if (!isOurBaseBlock(block))
continue; // Some other ScopeBlock owns it, eg. first instr of an exception handler
// It's a dead block we can delete!
@ -133,7 +133,7 @@ namespace de4dot.blocks {
}
}
public bool isOurBlockBase(BaseBlock bb) {
public bool isOurBaseBlock(BaseBlock bb) {
return bb != null && bb.Parent == this;
}
@ -145,7 +145,7 @@ namespace de4dot.blocks {
for (int i = 0; i < blocks.Count; i++) {
var block = blocks[i];
var target = block.getOnlyTarget();
if (!isOurBlockBase(target))
if (!isOurBaseBlock(target))
continue; // Only merge blocks we own!
if (!block.canMerge(target))
continue; // Can't merge them!
@ -171,14 +171,14 @@ namespace de4dot.blocks {
// If bb is in baseBlocks (a direct child), return bb. If bb is a BaseBlock in a
// ScopeBlock that is a direct child, then return that ScopeBlock. Else return null.
public BaseBlock toChild(BaseBlock bb) {
if (isOurBlockBase(bb))
if (isOurBaseBlock(bb))
return bb;
for (bb = bb.Parent; bb != null; bb = bb.Parent) {
var sb = bb as ScopeBlock;
if (sb == null)
throw new ApplicationException("Parent is not a ScopeBlock");
if (isOurBlockBase(sb))
if (isOurBaseBlock(sb))
return sb;
}