当前位置: 首页>>代码示例>>C++>>正文


C++ AggValueSlot::asRValue方法代码示例

本文整理汇总了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());
}
开发者ID:8l,项目名称:emscripten-fastcomp-clang,代码行数:30,代码来源:CGAtomic.cpp

示例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);
  }
}
开发者ID:5432935,项目名称:crossbridge,代码行数:28,代码来源:CGExprAgg.cpp

示例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);
}
开发者ID:Henauxg,项目名称:minix,代码行数:14,代码来源:CGAtomic.cpp


注:本文中的AggValueSlot::asRValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。