本文整理汇总了C++中Stmt::hasBarrier方法的典型用法代码示例。如果您正苦于以下问题:C++ Stmt::hasBarrier方法的具体用法?C++ Stmt::hasBarrier怎么用?C++ Stmt::hasBarrier使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stmt
的用法示例。
在下文中一共展示了Stmt::hasBarrier方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: VisitRawCompoundStmt
/// Identify each WCR iterating the body of CompoundStmt.
void TransformWCR::VisitRawCompoundStmt(CompoundStmt *S,
StmtVector &Body,
StmtVector &WCR) {
CompoundStmt::body_iterator I, E;
for (I = S->body_begin(), E = S->body_end(); I != E; ++I) {
Stmt *stmt = *I;
if (stmt->hasBarrier()) {
MergeBodyAndWCR(Body, WCR);
WCR.clear();
Body.push_back(VisitStmt(stmt));
} else {
if (DeclStmt *DS = dyn_cast<DeclStmt>(stmt)) {
// If there is a Decl that does not have an init expr,
// it is code-motioned to the Body.
VisitRawDeclStmt(DS, Body, WCR);
continue;
} else if (CompoundStmt *CS = dyn_cast<CompoundStmt>(stmt)) {
// StmtList is divided into multiple stmts.
if (CS->isStmtList()) {
VisitRawCompoundStmt(CS, Body, WCR);
ASTCtx.Deallocate((void *)CS);
continue;
}
}
// Most stmts are inserted into the WCR.
WCR.push_back(stmt);
}
}
}