本文整理汇总了C++中AggValueSlot::asRValue方法的典型用法代码示例。如果您正苦于以下问题:C++ AggValueSlot::asRValue方法的具体用法?C++ AggValueSlot::asRValue怎么用?C++ AggValueSlot::asRValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AggValueSlot
的用法示例。
在下文中一共展示了AggValueSlot::asRValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: convertTempToRValue
RValue AtomicInfo::convertTempToRValue(llvm::Value *addr,
AggValueSlot resultSlot) const {
if (EvaluationKind == TEK_Aggregate) {
// Nothing to do if the result is ignored.
if (resultSlot.isIgnored()) return resultSlot.asRValue();
assert(resultSlot.getAddr() == addr || hasPadding());
// In these cases, we should have emitted directly into the result slot.
if (!hasPadding() || resultSlot.isValueOfAtomic())
return resultSlot.asRValue();
// Otherwise, fall into the common path.
}
// Drill into the padding structure if we have one.
if (hasPadding())
addr = CGF.Builder.CreateStructGEP(addr, 0);
// If we're emitting to an aggregate, copy into the result slot.
if (EvaluationKind == TEK_Aggregate) {
CGF.EmitAggregateCopy(resultSlot.getAddr(), addr, getValueType(),
resultSlot.isVolatile());
return resultSlot.asRValue();
}
// Otherwise, just convert the temporary to an r-value using the
// normal conversion routine.
return CGF.convertTempToRValue(addr, getValueType());
}
示例2: VisitBinAssign
void AggExprEmitter::VisitBinAssign(const BinaryOperator *E) {
// For an assignment to work, the value on the right has
// to be compatible with the value on the left.
assert(CGF.getContext().hasSameUnqualifiedType(E->getLHS()->getType(),
E->getRHS()->getType())
&& "Invalid assignment");
// FIXME: __block variables need the RHS evaluated first!
LValue LHS = CGF.EmitLValue(E->getLHS());
// We have to special case property setters, otherwise we must have
// a simple lvalue (no aggregates inside vectors, bitfields).
if (LHS.isPropertyRef()) {
AggValueSlot Slot = EnsureSlot(E->getRHS()->getType());
CGF.EmitAggExpr(E->getRHS(), Slot);
CGF.EmitStoreThroughPropertyRefLValue(Slot.asRValue(), LHS);
} else {
bool GCollection = false;
if (CGF.getContext().getLangOptions().getGCMode())
GCollection = TypeRequiresGCollection(E->getLHS()->getType());
// Codegen the RHS so that it stores directly into the LHS.
AggValueSlot LHSSlot = AggValueSlot::forLValue(LHS, true,
GCollection);
CGF.EmitAggExpr(E->getRHS(), LHSSlot, false);
EmitFinalDestCopy(E, LHS, true);
}
}
示例3: convertTempToRValue
RValue AtomicInfo::convertTempToRValue(llvm::Value *addr,
AggValueSlot resultSlot,
SourceLocation loc) const {
if (EvaluationKind == TEK_Aggregate)
return resultSlot.asRValue();
// Drill into the padding structure if we have one.
if (hasPadding())
addr = CGF.Builder.CreateStructGEP(addr, 0);
// Otherwise, just convert the temporary to an r-value using the
// normal conversion routine.
return CGF.convertTempToRValue(addr, getValueType(), loc);
}