本文整理汇总了C++中Statements::size方法的典型用法代码示例。如果您正苦于以下问题:C++ Statements::size方法的具体用法?C++ Statements::size怎么用?C++ Statements::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Statements
的用法示例。
在下文中一共展示了Statements::size方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: backward_statements
inline void backward_statements(P& problem, O& OUT, I& IN, OS& OUT_S, IS& IN_S, Statements& statements, mtac::basic_block_p& B, bool& changes){
if(statements.size() > 0){
log::emit<Dev>("Data-Flow") << "OUT_S[" << (statements.size() - 1) << "] before transfer " << OUT_S[statements[statements.size() - 1]] << log::endl;
assign(OUT_S[statements.back()], OUT[B], changes);
log::emit<Dev>("Data-Flow") << "OUT_S[" << (statements.size() - 1) << "] after transfer " << OUT_S[statements[statements.size() - 1]] << log::endl;
for(unsigned i = statements.size() - 1; i > 0; --i){
auto& statement = statements[i];
log::emit<Dev>("Data-Flow") << "IN_S[" << i << "] before transfer " << IN_S[statement] << log::endl;
assign(IN_S[statement], problem.transfer(B, statement, OUT_S[statement]), changes);
log::emit<Dev>("Data-Flow") << "IN_S[" << i << "] after transfer " << IN_S[statement] << log::endl;
log::emit<Dev>("Data-Flow") << "OUT_S[" << (i - 1) << "] before transfer " << OUT_S[statements[i - 1]] << log::endl;
OUT_S[statements[i-1]] = IN_S[statement];
log::emit<Dev>("Data-Flow") << "OUT_S[" << (i - 1) << "] after transfer " << OUT_S[statements[i - 1]] << log::endl;
}
log::emit<Dev>("Data-Flow") << "IN_S[" << 0 << "] before transfer " << IN_S[statements[0]] << log::endl;
assign(IN_S[statements[0]], problem.transfer(B, statements[0], OUT_S[statements[0]]), changes);
log::emit<Dev>("Data-Flow") << "IN_S[" << 0 << "] after transfer " << IN_S[statements[0]] << log::endl;
assign(IN[B], IN_S[statements.front()], changes);
} else {
//If the basic block is empty, the IN values are the OUT values
assign(IN[B], OUT[B], changes);
}
}
示例2: wrapInCompoundStmt
CompoundStmt* wrapInCompoundStmt(clang::ASTContext& C) const {
assert(!isSingleStmt() && "Must be more than 1");
llvm::ArrayRef<Stmt*> stmts
= llvm::makeArrayRef(m_Stmts.data(), m_Stmts.size());
clang::SourceLocation noLoc;
return new (C) clang::CompoundStmt(C, stmts, noLoc, noLoc);
}
示例3: forward_statements
inline void forward_statements(P& problem, O& OUT, I& IN, OS& OUT_S, IS& IN_S, Statements& statements, mtac::basic_block_p& B, bool& changes){
if(statements.size() > 0){
IN_S[statements.front()] = IN[B];
for(unsigned i = 0; i < statements.size(); ++i){
auto& statement = statements[i];
assign(OUT_S[statement], problem.transfer(B, statement, IN_S[statement]), changes);
//The entry value of the next statement are the exit values of the current statement
if(i != statements.size() - 1){
IN_S[statements[i+1]] = OUT_S[statement];
}
}
assign(OUT[B], OUT_S[statements.back()], changes);
} else {
//If the basic block is empty, the OUT values are the IN values
assign(OUT[B], IN[B], changes);
}
}
示例4: Fix
void Fix(CompoundStmt* CS) {
if (!CS->size())
return;
typedef llvm::SmallVector<Stmt*, 32> Statements;
Statements Stmts;
Stmts.append(CS->body_begin(), CS->body_end());
for (Statements::iterator I = Stmts.begin(); I != Stmts.end(); ++I) {
if (!TraverseStmt(*I) && !m_HandledDecls.count(m_FoundDRE->getDecl())) {
Sema::DeclGroupPtrTy VDPtrTy
= m_Sema->ConvertDeclToDeclGroup(m_FoundDRE->getDecl());
StmtResult DS = m_Sema->ActOnDeclStmt(VDPtrTy,
m_FoundDRE->getLocStart(),
m_FoundDRE->getLocEnd());
assert(!DS.isInvalid() && "Invalid DeclStmt.");
I = Stmts.insert(I, DS.take());
m_HandledDecls.insert(m_FoundDRE->getDecl());
}
}
CS->setStmts(m_Sema->getASTContext(), Stmts.data(), Stmts.size());
}
示例5: isSingleStmt
bool isSingleStmt() const { return m_Stmts.size() == 1; }