Rollup merge of #142588 - ZuseZ4:generic-ctx-imprv, r=oli-obk

Generic ctx imprv

Cleanup work for my gpu pr

r? `@oli-obk`
This commit is contained in:
Jacob Pratt
2025-06-17 23:19:36 +02:00
committed by GitHub
3 changed files with 6 additions and 9 deletions

View File

@@ -679,11 +679,8 @@ impl<'ll, CX: Borrow<SCx<'ll>>> GenericCx<'ll, CX> {
llvm::LLVMMetadataAsValue(self.llcx(), metadata)
}
// FIXME(autodiff): We should split `ConstCodegenMethods` to pull the reusable parts
// onto a trait that is also implemented for GenericCx.
pub(crate) fn get_const_i64(&self, n: u64) -> &'ll Value {
let ty = unsafe { llvm::LLVMInt64TypeInContext(self.llcx()) };
unsafe { llvm::LLVMConstInt(ty, n, llvm::False) }
pub(crate) fn get_const_int(&self, ty: &'ll Type, val: u64) -> &'ll Value {
unsafe { llvm::LLVMConstInt(ty, val, llvm::False) }
}
pub(crate) fn get_function(&self, name: &str) -> Option<&'ll Value> {