本文整理汇总了C++中OffsetRangeVec::cend方法的典型用法代码示例。如果您正苦于以下问题:C++ OffsetRangeVec::cend方法的具体用法?C++ OffsetRangeVec::cend怎么用?C++ OffsetRangeVec::cend使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OffsetRangeVec
的用法示例。
在下文中一共展示了OffsetRangeVec::cend方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addRanges
int PCFilter::addRanges(const Unit* unit, const OffsetRangeVec& offsets) {
int counter = 0;
for (auto range = offsets.cbegin(); range != offsets.cend(); ++range) {
for (PC pc = unit->at(range->m_base); pc < unit->at(range->m_past);
pc += instrLen((Opcode*)pc)) {
addPC(pc);
counter++;
}
}
return counter;
}
示例2: addRanges
// Adds a range of PCs to the filter given a collection of offset ranges.
// Omit PCs which have opcodes that don't pass the given opcode filter.
void PCFilter::addRanges(const Unit* unit, const OffsetRangeVec& offsets,
OpcodeFilter isOpcodeAllowed) {
for (auto range = offsets.cbegin(); range != offsets.cend(); ++range) {
TRACE(3, "\toffsets [%d, %d)\n", range->m_base, range->m_past);
for (PC pc = unit->at(range->m_base); pc < unit->at(range->m_past);
pc += instrLen(pc)) {
if (isOpcodeAllowed(*pc)) {
TRACE(3, "\t\tpc %p\n", pc);
addPC(pc);
} else {
TRACE(3, "\t\tpc %p -- skipping (offset %d)\n", pc, unit->offsetOf(pc));
}
}
}
}
示例3: removeRanges
// Removes a range of PCs to the filter given a collection of offset ranges.
// Omit PCs which have opcodes that don't pass the given opcode filter.
void PCFilter::removeRanges(const Unit* unit, const OffsetRangeVec& offsets,
OpcodeFilter isOpcodeAllowed) {
for (auto range = offsets.cbegin(); range != offsets.cend(); ++range) {
TRACE(3, "\toffsets [%d, %d) (remove)\n", range->m_base, range->m_past);
for (PC pc = unit->at(range->m_base); pc < unit->at(range->m_past);
pc += instrLen((Op*) pc)) {
if (isOpcodeAllowed(*reinterpret_cast<const Op*>(pc))) {
TRACE(3, "\t\tpc %p (remove)\n", pc);
removePC(pc);
} else {
TRACE(3, "\t\tpc %p -- skipping (offset %d) (remove)\n", pc,
unit->offsetOf(pc));
}
}
}
}