本文整理汇总了C++中IRBuilder::CreateExtractValue方法的典型用法代码示例。如果您正苦于以下问题:C++ IRBuilder::CreateExtractValue方法的具体用法?C++ IRBuilder::CreateExtractValue怎么用?C++ IRBuilder::CreateExtractValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IRBuilder
的用法示例。
在下文中一共展示了IRBuilder::CreateExtractValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createCmpXchgInstFun
static void createCmpXchgInstFun(IRBuilder<> &Builder, Value *Addr,
Value *Loaded, Value *NewVal,
AtomicOrdering MemOpOrder,
Value *&Success, Value *&NewLoaded) {
Value* Pair = Builder.CreateAtomicCmpXchg(
Addr, Loaded, NewVal, MemOpOrder,
AtomicCmpXchgInst::getStrongestFailureOrdering(MemOpOrder));
Success = Builder.CreateExtractValue(Pair, 1, "success");
NewLoaded = Builder.CreateExtractValue(Pair, 0, "newloaded");
}
示例2: if
Value*
code_emitter::convert_complex_return_value (Value *result)
{
/* The result is complex, whose representation
differs between archs, and we need to transform
it into another arch-dependent
representation. */
if (sizeof(gpointer) == 4)
{
Value *local = complex_copy_var;
Value *local_ptr = builder->CreateBitCast(local, PointerType::getUnqual(Type::Int64Ty));
builder->CreateStore(result, local_ptr);
result = builder->CreateLoad(local);
}
else if (sizeof(gpointer) == 8)
result = builder->CreateExtractValue(result, 0);
else
g_assert_not_reached();
return result;
}