Skip to content

Commit 6a6bc90

Browse files
jorge-ortegaLegNeato
authored andcommitted
refactor(nvvm): Remove cust_raw as a codegen dependency.
Codegen only needs `nvvm`, which itself take cust_raw as a dependency. It currently depends on `cust_raw` so that it can import libdevice bytecode from nvvm_sys. With this change, `nvvm` now exports libdevice bytecode from `cust_raw::nvvm_sys`, and removes `cust_raw` as a codegen dependency.
1 parent 7280134 commit 6a6bc90

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

crates/nvvm/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ use std::{
1010

1111
use cust_raw::nvvm_sys;
1212

13+
pub use cust_raw::nvvm_sys::LIBDEVICE_BITCODE;
14+
1315
/// Get the major and minor NVVM IR version.
1416
pub fn ir_version() -> (i32, i32) {
1517
unsafe {

crates/rustc_codegen_nvvm/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ readme = "../../README.md"
1515
crate-type = ["dylib"]
1616

1717
[dependencies]
18-
cust_raw = { path = "../cust_raw" }
1918
nvvm = { version = "0.1", path = "../nvvm" }
2019
rustc-demangle = "0.1.24"
2120
libc = "0.2.169"

crates/rustc_codegen_nvvm/src/nvvm.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use crate::common::AsCCharPtr;
66
use crate::context::CodegenArgs;
77
use crate::llvm::*;
88
use crate::lto::ThinBuffer;
9-
use cust_raw::nvvm_sys;
109
use nvvm::*;
1110
use rustc_codegen_ssa::traits::ThinBufferMethods;
1211
use rustc_session::{Session, config::DebugInfo};
@@ -105,7 +104,7 @@ pub fn codegen_bitcode_modules(
105104
let buf = ThinBuffer::new(module);
106105

107106
prog.add_module(buf.data(), "merged".to_string())?;
108-
prog.add_lazy_module(nvvm_sys::LIBDEVICE_BITCODE, "libdevice".to_string())?;
107+
prog.add_lazy_module(LIBDEVICE_BITCODE, "libdevice".to_string())?;
109108
prog.add_lazy_module(LIBINTRINSICS, "libintrinsics".to_string())?;
110109

111110
// for now, while the codegen is young, we always run verification on the program.

0 commit comments

Comments
 (0)