本文整理汇总了C++中IRBuilder::CreateICmpSGT方法的典型用法代码示例。如果您正苦于以下问题:C++ IRBuilder::CreateICmpSGT方法的具体用法?C++ IRBuilder::CreateICmpSGT怎么用?C++ IRBuilder::CreateICmpSGT使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IRBuilder
的用法示例。
在下文中一共展示了IRBuilder::CreateICmpSGT方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getValue
Value* GreaterThanExpression::getValue() {
assert(leftExpression != NULL);
assert(rightExpression != NULL);
assert(leftExpression->getType() == rightExpression->getType());
IRBuilder<>* builder = codegen::getBuilder();
int c;
if(leftExpression->getType() != COLEXPRESSION) {
c = leftExpression->getType();
} else {
c = convertDTtoET(leftExpression->getDataType());
}
switch(c) {
case LONGVALUEEXPRESSION:
return builder->CreateICmpSGT(leftExpression->getValue(), rightExpression->getValue());
case DOUBLEVALUEEXPRESSION:
return builder->CreateFCmpOGT(leftExpression->getValue(), rightExpression->getValue());
case STRINGVALUEEXPRESSION:
case DATEVALUEEXPRESSION:
return codegen::stringCmp(leftExpression->getValue(), rightExpression->getValue(), GREATERTHANEXPRESSION);
default:
cout << "Unknown expression type!" << endl;
exit(-1);
}
return NULL;
}
示例2: codeGen
Value* Op::codeGen(CodeGenContext &context) {
cout << "Creating Op " << op <<endl;
IRBuilder<> *builder = context.currentBuilder();
Value *tape_1;
Value *lshValue = lhs.codeGen(context);
Value *rshValue = rhs.codeGen(context);
switch(op) {
case T_PLUS:
tape_1 = builder->CreateAdd(lshValue,
rshValue, "addtmp");
break;
case T_MINUS:
tape_1 = builder->CreateSub(lshValue,
rshValue, "subtmp");
break;
case T_DIV:
tape_1 = builder->CreateUDiv(lshValue,
rshValue, "divtmp");
break;
case T_MUL:
tape_1 = builder->CreateMul(lshValue,
rshValue, "multmp");
break;
case T_LT:
tape_1 = builder->CreateICmpSLT(lshValue,
rshValue, "lttmp");
break;
case T_GT:
tape_1 = builder->CreateICmpSGT(lshValue,
rshValue, "gttmp");
break;
}
return tape_1;
}
示例3: emitCond
static Value* emitCond(IRBuilder<>& builder, Value* arg) {
return builder.CreateICmpSGT(arg, builder.getInt64(0));
}