Skip to content

Commit dcefdcd

Browse files
committed
Rename rustc_trans to rustc_codegen_llvm
1 parent 67f54e6 commit dcefdcd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+106
-105
lines changed

src/Cargo.lock

+28-28
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/doc/rustc-ux-guidelines.md

+1-1

src/libcore/intrinsics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
//! rustc compiler intrinsics.
1212
//!
13-
//! The corresponding definitions are in librustc_trans/intrinsic.rs.
13+
//! The corresponding definitions are in librustc_codegen_llvm/intrinsic.rs.
1414
//!
1515
//! # Volatiles
1616
//!

src/librustc/Cargo.toml

+5-5
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,21 @@ syntax_pos = { path = "../libsyntax_pos" }
3232
# rlib/dylib pair but all crates.io crates tend to just be rlibs. This means
3333
# we've got a problem for dependency graphs that look like:
3434
#
35-
# foo - rustc_trans
36-
# / \
37-
# rustc ---- rustc_driver
35+
# foo - rustc_codegen_llvm
36+
# / \
37+
# rustc ----- rustc_driver
3838
# \ /
3939
# foo - rustc_metadata
4040
#
41-
# Here the crate `foo` is linked into the `rustc_trans` and the
41+
# Here the crate `foo` is linked into the `rustc_codegen_llvm` and the
4242
# `rustc_metadata` dylibs, meaning we've got duplicate copies! When we then
4343
# go to link `rustc_driver` the compiler notices this and gives us a compiler
4444
# error.
4545
#
4646
# To work around this problem we just add these crates.io dependencies to the
4747
# `rustc` crate which is a shared dependency above. That way the crate `foo`
4848
# shows up in the dylib for the `rustc` crate, deduplicating it and allowing
49-
# crates like `rustc_trans` to use `foo` *through* the `rustc` crate.
49+
# crates like `rustc_codegen_llvm` to use `foo` *through* the `rustc` crate.
5050
#
5151
# tl;dr; this is not needed to get `rustc` to compile, but if you remove it then
5252
# later crate stop compiling. If you can remove this and everything

src/librustc/README.md

+18-18

src/librustc/util/common.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ pub fn profq_msg(msg: ProfileQueriesMsg) {
8484
// Do nothing.
8585
//
8686
// FIXME(matthewhammer): Multi-threaded translation phase triggers the panic below.
87-
// From backtrace: rustc_trans::back::write::spawn_work::{{closure}}.
87+
// From backtrace: rustc_codegen_llvm::back::write::spawn_work::{{closure}}.
8888
//
8989
// panic!("no channel on which to send profq_msg: {:?}", msg)
9090
}

src/librustc_trans/Cargo.toml renamed to src/librustc_codegen_llvm/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[package]
22
authors = ["The Rust Project Developers"]
3-
name = "rustc_trans"
3+
name = "rustc_codegen_llvm"
44
version = "0.0.0"
55

66
[lib]
7-
name = "rustc_trans"
7+
name = "rustc_codegen_llvm"
88
path = "lib.rs"
99
crate-type = ["dylib"]
1010
test = false
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/librustc_trans/intrinsic.rs renamed to src/librustc_codegen_llvm/intrinsic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ fn get_simple_intrinsic(ccx: &CrateContext, name: &str) -> Option<ValueRef> {
8585

8686
/// Remember to add all intrinsics here, in librustc_typeck/check/mod.rs,
8787
/// and in libcore/intrinsics.rs; if you need access to any llvm intrinsics,
88-
/// add them to librustc_trans/trans/context.rs
88+
/// add them to librustc_codegen_llvm/trans/context.rs
8989
pub fn trans_intrinsic_call<'a, 'tcx>(bcx: &Builder<'a, 'tcx>,
9090
callee_ty: Ty<'tcx>,
9191
fn_ty: &FnType,

src/librustc_trans/lib.rs renamed to src/librustc_codegen_llvm/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ pub struct CrateInfo {
329329
used_crates_dynamic: Vec<(CrateNum, LibSource)>,
330330
}
331331

332-
__build_diagnostic_array! { librustc_trans, DIAGNOSTICS }
332+
__build_diagnostic_array! { librustc_codegen_llvm, DIAGNOSTICS }
333333

334334
pub fn provide_local(providers: &mut Providers) {
335335
back::symbol_names::provide(providers);

src/librustc_trans/llvm_util.rs renamed to src/librustc_codegen_llvm/llvm_util.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ pub fn print(req: PrintRequest, sess: &Session) {
126126
match req {
127127
PrintRequest::TargetCPUs => llvm::LLVMRustPrintTargetCPUs(tm),
128128
PrintRequest::TargetFeatures => llvm::LLVMRustPrintTargetFeatures(tm),
129-
_ => bug!("rustc_trans can't handle print request: {:?}", req),
129+
_ => bug!("rustc_codegen_llvm can't handle print request: {:?}", req),
130130
}
131131
}
132132
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/librustc_driver/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ rustc_plugin = { path = "../librustc_plugin" }
3030
rustc_privacy = { path = "../librustc_privacy" }
3131
rustc_resolve = { path = "../librustc_resolve" }
3232
rustc_save_analysis = { path = "../librustc_save_analysis" }
33-
rustc_trans = { path = "../librustc_trans", optional = true }
33+
rustc_codegen_llvm = { path = "../librustc_codegen_llvm", optional = true }
3434
rustc_trans_utils = { path = "../librustc_trans_utils" }
3535
rustc_typeck = { path = "../librustc_typeck" }
3636
serialize = { path = "../libserialize" }
@@ -41,4 +41,4 @@ syntax_pos = { path = "../libsyntax_pos" }
4141
ar = "0.3.0"
4242

4343
[features]
44-
llvm = ["rustc_trans"]
44+
llvm = ["rustc_codegen_llvm"]

src/librustc_driver/lib.rs

+22-20
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ extern crate rustc_mir;
4848
extern crate rustc_resolve;
4949
extern crate rustc_save_analysis;
5050
#[cfg(feature="llvm")]
51-
extern crate rustc_trans;
51+
extern crate rustc_codegen_llvm;
5252
extern crate rustc_trans_utils;
5353
extern crate rustc_typeck;
5454
extern crate serialize;
@@ -156,10 +156,10 @@ pub fn run<F>(run_compiler: F) -> isize
156156
#[cfg(not(feature="llvm"))]
157157
pub use rustc_trans_utils::trans_crate::MetadataOnlyTransCrate as DefaultTransCrate;
158158
#[cfg(feature="llvm")]
159-
pub use rustc_trans::LlvmTransCrate as DefaultTransCrate;
159+
pub use rustc_codegen_llvm::LlvmTransCrate as DefaultTransCrate;
160160

161161
#[cfg(not(feature="llvm"))]
162-
mod rustc_trans {
162+
mod rustc_codegen_llvm {
163163
use syntax_pos::symbol::Symbol;
164164
use rustc::session::Session;
165165
use rustc::session::config::PrintRequest;
@@ -205,7 +205,7 @@ pub fn run_compiler<'a>(args: &[String],
205205
let (sopts, cfg) = config::build_session_options_and_crate_config(&matches);
206206

207207
if sopts.debugging_opts.debug_llvm {
208-
rustc_trans::enable_llvm_debug();
208+
rustc_codegen_llvm::enable_llvm_debug();
209209
}
210210

211211
let descriptions = diagnostics_registry();
@@ -231,7 +231,7 @@ pub fn run_compiler<'a>(args: &[String],
231231
let mut sess = session::build_session_with_codemap(
232232
sopts, input_file_path, descriptions, codemap, emitter_dest,
233233
);
234-
rustc_trans::init(&sess);
234+
rustc_codegen_llvm::init(&sess);
235235
rustc_lint::register_builtins(&mut sess.lint_store.borrow_mut(), Some(&sess));
236236

237237
let mut cfg = config::build_configuration(&sess, cfg);
@@ -263,7 +263,9 @@ pub fn run_compiler<'a>(args: &[String],
263263
Some(sess))
264264
}
265265
Some("llvm") => {
266-
let cstore = Rc::new(CStore::new(rustc_trans::LlvmTransCrate::metadata_loader()));
266+
let cstore = Rc::new(
267+
CStore::new(rustc_codegen_llvm::LlvmTransCrate::metadata_loader())
268+
);
267269

268270
do_or_return!(callbacks.late_callback(&matches,
269271
&sess,
@@ -272,13 +274,13 @@ pub fn run_compiler<'a>(args: &[String],
272274
&odir,
273275
&ofile), Some(sess));
274276

275-
(driver::compile_input::<rustc_trans::LlvmTransCrate>(&sess,
276-
&cstore,
277-
&input,
278-
&odir,
279-
&ofile,
280-
Some(plugins),
281-
&control),
277+
(driver::compile_input::<rustc_codegen_llvm::LlvmTransCrate>(&sess,
278+
&cstore,
279+
&input,
280+
&odir,
281+
&ofile,
282+
Some(plugins),
283+
&control),
282284
Some(sess))
283285
}
284286
Some(trans_name) => sess.fatal(&format!("Invalid trans {}", trans_name)),
@@ -546,7 +548,7 @@ impl<'a> CompilerCalls<'a> for RustcDefaultCalls {
546548
let mut sess = build_session(sopts.clone(),
547549
None,
548550
descriptions.clone());
549-
rustc_trans::init(&sess);
551+
rustc_codegen_llvm::init(&sess);
550552
rustc_lint::register_builtins(&mut sess.lint_store.borrow_mut(), Some(&sess));
551553
let mut cfg = config::build_configuration(&sess, cfg.clone());
552554
target_features::add_configuration(&mut cfg, &sess);
@@ -806,20 +808,20 @@ impl RustcDefaultCalls {
806808
}
807809
PrintRequest::RelocationModels => {
808810
println!("Available relocation models:");
809-
for &(name, _) in rustc_trans::back::write::RELOC_MODEL_ARGS.iter() {
811+
for &(name, _) in rustc_codegen_llvm::back::write::RELOC_MODEL_ARGS.iter() {
810812
println!(" {}", name);
811813
}
812814
println!("");
813815
}
814816
PrintRequest::CodeModels => {
815817
println!("Available code models:");
816-
for &(name, _) in rustc_trans::back::write::CODE_GEN_MODEL_ARGS.iter(){
818+
for &(name, _) in rustc_codegen_llvm::back::write::CODE_GEN_MODEL_ARGS.iter(){
817819
println!(" {}", name);
818820
}
819821
println!("");
820822
}
821823
PrintRequest::TargetCPUs | PrintRequest::TargetFeatures => {
822-
rustc_trans::print(*req, sess);
824+
rustc_codegen_llvm::print(*req, sess);
823825
}
824826
PrintRequest::NativeStaticLibs => {
825827
println!("Native static libs can be printed only during linking");
@@ -861,7 +863,7 @@ pub fn version(binary: &str, matches: &getopts::Matches) {
861863
println!("commit-date: {}", unw(commit_date_str()));
862864
println!("host: {}", config::host_triple());
863865
println!("release: {}", unw(release_str()));
864-
rustc_trans::print_version();
866+
rustc_codegen_llvm::print_version();
865867
}
866868
}
867869

@@ -1158,7 +1160,7 @@ pub fn handle_options(args: &[String]) -> Option<getopts::Matches> {
11581160
}
11591161

11601162
if cg_flags.contains(&"passes=list".to_string()) {
1161-
rustc_trans::print_passes();
1163+
rustc_codegen_llvm::print_passes();
11621164
return None;
11631165
}
11641166

@@ -1287,7 +1289,7 @@ pub fn diagnostics_registry() -> errors::registry::Registry {
12871289
all_errors.extend_from_slice(&rustc_resolve::DIAGNOSTICS);
12881290
all_errors.extend_from_slice(&rustc_privacy::DIAGNOSTICS);
12891291
#[cfg(feature="llvm")]
1290-
all_errors.extend_from_slice(&rustc_trans::DIAGNOSTICS);
1292+
all_errors.extend_from_slice(&rustc_codegen_llvm::DIAGNOSTICS);
12911293
all_errors.extend_from_slice(&rustc_const_eval::DIAGNOSTICS);
12921294
all_errors.extend_from_slice(&rustc_metadata::DIAGNOSTICS);
12931295
all_errors.extend_from_slice(&rustc_passes::DIAGNOSTICS);

src/librustc_driver/target_features.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
use syntax::ast;
1212
use rustc::session::Session;
1313
use syntax::symbol::Symbol;
14-
use rustc_trans;
1514

1615
/// Add `target_feature = "..."` cfgs for a variety of platform
1716
/// specific features (SSE, NEON etc.).
@@ -21,7 +20,7 @@ use rustc_trans;
2120
pub fn add_configuration(cfg: &mut ast::CrateConfig, sess: &Session) {
2221
let tf = Symbol::intern("target_feature");
2322

24-
for feat in rustc_trans::target_features(sess) {
23+
for feat in ::rustc_codegen_llvm::target_features(sess) {
2524
cfg.insert((tf, Some(feat)));
2625
}
2726

0 commit comments

Comments
 (0)