llvm::ConstantInt::get(Int32Ty, Offset)));
}
case Builtin::BI__builtin_return_address: {
- Value *Depth = EmitScalarExpr(E->getArg(0));
- Depth = Builder.CreateIntCast(Depth, Int32Ty, false);
+ Value *Depth =
+ CGM.EmitConstantExpr(E->getArg(0), getContext().UnsignedIntTy, this);
Value *F = CGM.getIntrinsic(Intrinsic::returnaddress);
return RValue::get(Builder.CreateCall(F, Depth));
}
case Builtin::BI__builtin_frame_address: {
- Value *Depth = EmitScalarExpr(E->getArg(0));
- Depth = Builder.CreateIntCast(Depth, Int32Ty, false);
+ Value *Depth =
+ CGM.EmitConstantExpr(E->getArg(0), getContext().UnsignedIntTy, this);
Value *F = CGM.getIntrinsic(Intrinsic::frameaddress);
return RValue::get(Builder.CreateCall(F, Depth));
}
// TRAPV: add i8 {{.*}}, 1
// CATCH_UB: add i8 {{.*}}, 1
++PR9350;
+
+ // PR24256: don't instrument __builtin_frame_address.
+ __builtin_frame_address(0 + 0);
+ // DEFAULT: call i8* @llvm.frameaddress(i32 0)
+ // WRAPV: call i8* @llvm.frameaddress(i32 0)
+ // TRAPV: call i8* @llvm.frameaddress(i32 0)
+ // CATCH_UB: call i8* @llvm.frameaddress(i32 0)
}