本文整理汇总了C++中AstInterface::CreateFunctionCall方法的典型用法代码示例。如果您正苦于以下问题:C++ AstInterface::CreateFunctionCall方法的具体用法?C++ AstInterface::CreateFunctionCall怎么用?C++ AstInterface::CreateFunctionCall使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AstInterface
的用法示例。
在下文中一共展示了AstInterface::CreateFunctionCall方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
AstNodePtr SymbolicFunction :: CodeGen( AstInterface &_fa) const
{
AstInterface::AstNodeList l;
for (const_iterator i = args.begin(); i != args.end(); ++i) {
SymbolicVal cur = *i;
AstNodePtr curast = cur.CodeGen(_fa);
l.push_back(curast);
}
if (t == AstInterface::OP_NONE) {
return _fa.CreateFunctionCall( op, l);
}
else if (t == AstInterface::OP_ARRAY_ACCESS) {
AstNodePtr arr = l.front();
l.pop_front();
return _fa.CreateArrayAccess(arr, l);
}
else if (t == AstInterface::OP_ASSIGN && l.size() == 2) {
return _fa.CreateAssignment(l.front(), l.back());
}
else if (l.size() == 2)
return _fa.CreateBinaryOP( t, l.front(), l.back());
else {
assert(l.size() == 1);
return _fa.CreateUnaryOP( t, l.front());
}
}
示例2: CodeGen
AstNodePtr SymbolicSelect:: CodeGen( AstInterface &fa ) const
{
int size = 0;
AstInterface::AstNodeList list;
for (OpdIterator iter = GetOpdIterator(); !iter.ReachEnd(); iter.Advance()) {
AstNodePtr p = Term2Val(iter.Current()).CodeGen(fa);
list.push_back(p);
++size;
}
assert( size > 1);
std::string func = (opt< 0)? "min" : "max";
return fa.CreateFunctionCall(func, list);
}
示例3:
AstNodePtr ArrayUseAccessFunction::
CreateArrayAccess( AstInterface& fa, const AstNodePtr& arr,
AstInterface::AstNodeList& index)
{
if (prev != 0)
return prev->CreateArrayAccess(fa, arr, index);
if (index.size() > 1) {
AstInterface::AstNodeList tmp = index;
tmp.push_front(arr);
return fa.CreateFunctionCall(funcname, tmp);
}
else
return fa.CreateArrayAccess(arr, index);
}
示例4:
AstNodePtr ArrayUseAccessFunction::
CreateArrayAccess( AstInterface& fa, const AstNodePtr& arr,
const AstNodeList& index)
{
AstNodePtr r;
if (prev != 0)
r = prev->CreateArrayAccess(fa, arr, index);
if (r == AST_NULL) {
AstNodeList nindex;
nindex.push_back(arr.get_ptr());
for (AstNodeList::const_iterator p = index.begin(); p != index.end(); ++p)
nindex.push_back(*p);
r = fa.CreateFunctionCall(funcname,nindex.begin(), nindex.end()) ;
}
return r;
}