本文整理汇总了C++中Blocks::back方法的典型用法代码示例。如果您正苦于以下问题:C++ Blocks::back方法的具体用法?C++ Blocks::back怎么用?C++ Blocks::back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Blocks
的用法示例。
在下文中一共展示了Blocks::back方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addBranchBlock
static bool addBranchBlock(Blocks &blocks, Block &block,
const Instruction &branchDestination,
Block *&branchBlock, BlockEdgeType type) {
/* Prepare to follow one branch of the path.
Returns true if this is a completely new path we haven't handled yet.
branchBlock will be filled with the block for the branch. */
bool needAdd = false;
// See if we have already handled this branch. If not, create a new block for it.
branchBlock = const_cast<Block *>(branchDestination.block);
if (!branchBlock) {
blocks.push_back(Block(branchDestination.address));
branchBlock = &blocks.back();
needAdd = true;
}
// Link the branch with its parent
branchBlock->parents.push_back(&block);
block.children.push_back(branchBlock);
block.childrenTypes.push_back(type);
return needAdd;
}
示例2: constructBlocks
void constructBlocks(Blocks &blocks, Instructions &instructions) {
/* Create the first block containing the very first instruction in this script.
* Then follow the complete code flow from this instruction onwards. */
assert(blocks.empty());
if (instructions.empty())
return;
blocks.push_back(Block(instructions.front().address));
constructBlocks(blocks, blocks.back(), instructions.front());
}