本文整理汇总了C++中ExpressionPtr::toString方法的典型用法代码示例。如果您正苦于以下问题:C++ ExpressionPtr::toString方法的具体用法?C++ ExpressionPtr::toString怎么用?C++ ExpressionPtr::toString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ExpressionPtr
的用法示例。
在下文中一共展示了ExpressionPtr::toString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateStruct
/*
* Changes the type of the field of a struct
*/
void updateStruct(const ExpressionPtr& structure, TypePtr& type, const ExpressionPtr& identifier) {
NodeManager& mgr = structure->getNodeManager();
IRBuilder builder(mgr);
TypePtr baseType = structure->getType();
RefTypePtr refTy = baseType.isa<RefTypePtr>();
StructTypePtr kst = refTy ? refTy->getElementType().as<StructTypePtr>() : structure->getType().as<StructTypePtr>();
std::string name = identifier->toString();
NamedTypePtr oldType = kst->getNamedTypeEntryOf(name);
NamedTypePtr newType = builder.namedType(name, refTy ? builder.refType(type) : type);
TypePtr newStructType = transform::replaceAll(mgr, baseType, oldType, newType).as<TypePtr>();
type = newStructType;
}
示例2: getDNF
ExpressionPtr getDNF() const
{
// Multiple passes are sometimes required.
ExpressionPtr result = getDNFImpl();
int safety = 0;
while (!result->isDNF())
{
std::cout << "Pass " << ": " << result->toString() << std::endl;
result = result->getDNFImpl();
if (safety++ > 100)
{
throw std::runtime_error("Maximum number of DNF passes exceeded.");
}
}
return result;
}
示例3: test
void test(ExpressionPtr expr)
{
std::cout << "Before DNF: " << expr->toString() << std::endl;
std::cout << "After DNF : " << expr->getDNF()->toString() << std::endl << std::endl;
}