================ @@ -224,9 +225,26 @@ static LValueOrRValue emitSuspendExpression(CodeGenFunction &CGF, CGCoroData &Co AwaitKind Kind, AggValueSlot aggSlot, bool ignoreResult, bool forLValue) { auto *E = S.getCommonExpr(); + auto &Builder = CGF.Builder; - auto CommonBinder = - CodeGenFunction::OpaqueValueMappingData::bind(CGF, S.getOpaqueValue(), E); + // S.getOperandOpaqueValue() may be null, in this case it maps to nothing. + std::optional<CodeGenFunction::OpaqueValueMapping> OperandMapping = std::nullopt; + auto CallOV = S.getOperandOpaqueValue(); + if (CallOV) { + OperandMapping.emplace(CGF, CallOV); + LValue LV = CGF.getOrCreateOpaqueLValueMapping(CallOV); + llvm::Value *Value = LV.getPointer(CGF); + // for (auto *U : Value->users()) { + // if (auto *Call = cast<llvm::CallBase>(U)) { + // Call->dump(); + // } + // } ---------------- yuxuanchen1997 wrote:
Is there a better way to get the `CallInst`? https://github.com/llvm/llvm-project/pull/94693 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits