================ @@ -1663,6 +1667,20 @@ Value *ScalarExprEmitter::EmitScalarConversion(Value *Src, QualType SrcType, llvm::Type *DstTy = ConvertType(DstType); + // Determine whether an overflow behavior of 'trap' has been specified for + // either the destination or the source types. If so, we can elide sanitizer + // capability checks as this overflow behavior kind is also capable of + // emitting traps without runtime sanitizer support. + // Also skip instrumentation if either source or destination has 'wrap' + // behavior - the user has explicitly indicated they accept wrapping + // semantics. Use non-canonical types to preserve OBT annotations. + const auto *DstOBT = NoncanonicalDstType->getAs<OverflowBehaviorType>(); + const auto *SrcOBT = NoncanonicalSrcType->getAs<OverflowBehaviorType>(); ---------------- mizvekov wrote:
I was thinking this could have been a left over from before obt was part of the canonical type. Anyway, using the canonical type seems to be the right approach here. https://github.com/llvm/llvm-project/pull/188340 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
