本文整理汇总了C++中StatementList::end方法的典型用法代码示例。如果您正苦于以下问题:C++ StatementList::end方法的具体用法?C++ StatementList::end怎么用?C++ StatementList::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StatementList
的用法示例。
在下文中一共展示了StatementList::end方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: makeIsect
void StatementList::makeIsect(StatementList &a, LocationSet &b)
{
if (this == &a) { // *this = *this isect b
for (auto it = a.begin(); it != a.end();) {
assert((*it)->isAssignment());
Assignment *as = static_cast<Assignment *>(*it);
if (!b.contains(as->getLeft())) {
it = m_list.erase(it);
}
else {
it++;
}
}
}
else { // normal assignment
clear();
for (Statement *stmt : a) {
assert(stmt->isAssignment());
Assignment *as = static_cast<Assignment *>(stmt);
if (b.contains(as->getLeft())) {
append(as);
}
}
}
}
示例2: removeRedundantBlocks
void removeRedundantBlocks(BlockPtr b) {
StatementList& children = b->getChildren();
for (size_t i = 0; i < children.size(); ++i) {
if (REN_DYNAMIC_CAST_PTR(ib, Block, children[i])) {
removeRedundantBlocks(ib);
StatementList sl = ib->getChildren();
children.erase(children.begin() + i);
children.insert(children.begin() + i, sl.begin(), sl.end());
--i;
}
}
}
示例3: append
void StatementList::append(const StatementList &sl)
{
if (&sl == this) {
const size_t oldSize = m_list.size();
auto it = m_list.begin();
for (size_t i = 0; i < oldSize; i++) {
m_list.push_back(*it++);
}
}
else {
m_list.insert(end(), sl.begin(), sl.end());
}
}
示例4: miniDebugger
void MiniDebugger::miniDebugger(UserProc *proc, const char *description)
{
OStream q_cout(stdout);
QTextStream q_cin(stdin);
q_cout << "decompiling " << proc->getName() << ": " << description << "\n";
QString stopAt;
if (stopAt.isEmpty() || !proc->getName().compare(stopAt)) {
// This is a mini command line debugger. Feel free to expand it.
for (const Statement *stmt : watches) {
stmt->print(q_cout);
q_cout << "\n";
}
q_cout << " <press enter to continue> \n";
QString line;
while (true) {
line.clear();
q_cin >> line;
if (line.startsWith("print")) {
proc->print(q_cout);
}
else if (line.startsWith("fprint")) {
QFile tgt("out.proc");
if (tgt.open(QFile::WriteOnly)) {
OStream of(&tgt);
proc->print(of);
}
}
else if (line.startsWith("run ")) {
QStringList parts = line.trimmed().split(" ", QString::SkipEmptyParts);
if (parts.size() > 1) {
stopAt = parts[1];
}
break;
}
else if (line.startsWith("watch ")) {
QStringList parts = line.trimmed().split(" ", QString::SkipEmptyParts);
if (parts.size() > 1) {
int n = parts[1].toInt();
StatementList stmts;
proc->getStatements(stmts);
StatementList::iterator it;
for (it = stmts.begin(); it != stmts.end(); ++it) {
if ((*it)->getNumber() == n) {
watches.insert(*it);
q_cout << "watching " << *it << "\n";
}
}
}
}
else {
break;
}
}
}
}