Emit getelementptr inbounds nuw for pointer::add()

This commit is contained in:
Nikita Popov
2025-02-19 11:06:11 +01:00
parent 5e9d8a7d55
commit 31cc4c074d
7 changed files with 55 additions and 15 deletions

View File

@@ -332,6 +332,14 @@ pub trait BuilderMethods<'a, 'tcx>:
ptr: Self::Value,
indices: &[Self::Value],
) -> Self::Value;
fn inbounds_nuw_gep(
&mut self,
ty: Self::Type,
ptr: Self::Value,
indices: &[Self::Value],
) -> Self::Value {
self.inbounds_gep(ty, ptr, indices)
}
fn ptradd(&mut self, ptr: Self::Value, offset: Self::Value) -> Self::Value {
self.gep(self.cx().type_i8(), ptr, &[offset])
}