Skip to content

Minorstylefixes #11433

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions src/librustc/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ use syntax::attr::AttrMetaMethods;
use syntax::crateid::CrateId;

#[deriving(Clone, Eq)]
pub enum output_type {
output_type_none,
output_type_bitcode,
output_type_assembly,
output_type_llvm_assembly,
output_type_object,
output_type_exe,
pub enum OutputType {
OutputTypeNone,
OutputTypeBitcode,
OutputTypeAssembly,
OutputTypeLlvmAssembly,
OutputTypeObject,
OutputTypeExe,
}

pub fn llvm_err(sess: Session, msg: ~str) -> ! {
Expand Down Expand Up @@ -86,10 +86,10 @@ pub fn WriteOutputFile(
pub mod write {

use back::lto;
use back::link::{WriteOutputFile, output_type};
use back::link::{output_type_assembly, output_type_bitcode};
use back::link::{output_type_exe, output_type_llvm_assembly};
use back::link::{output_type_object};
use back::link::{WriteOutputFile, OutputType};
use back::link::{OutputTypeAssembly, OutputTypeBitcode};
use back::link::{OutputTypeExe, OutputTypeLlvmAssembly};
use back::link::{OutputTypeObject};
use driver::driver::CrateTranslation;
use driver::session::Session;
use driver::session;
Expand All @@ -107,7 +107,7 @@ pub mod write {

pub fn run_passes(sess: Session,
trans: &CrateTranslation,
output_type: output_type,
output_type: OutputType,
output: &Path) {
let llmod = trans.module;
let llcx = trans.context;
Expand Down Expand Up @@ -225,20 +225,20 @@ pub mod write {

time(sess.time_passes(), "codegen passes", (), |()| {
match output_type {
output_type_none => {}
output_type_bitcode => {
OutputTypeNone => {}
OutputTypeBitcode => {
output.with_c_str(|buf| {
llvm::LLVMWriteBitcodeToFile(llmod, buf);
})
}
output_type_llvm_assembly => {
OutputTypeLlvmAssembly => {
output.with_c_str(|output| {
with_codegen(tm, llmod, |cpm| {
llvm::LLVMRustPrintModule(cpm, llmod, output);
})
})
}
output_type_assembly => {
OutputTypeAssembly => {
with_codegen(tm, llmod, |cpm| {
WriteOutputFile(sess, tm, cpm, llmod, output,
lib::llvm::AssemblyFile);
Expand All @@ -248,7 +248,7 @@ pub mod write {
// could be invoked specially with output_type_assembly,
// so in this case we still want the metadata object
// file.
if sess.opts.output_type != output_type_assembly {
if sess.opts.output_type != OutputTypeAssembly {
with_codegen(tm, trans.metadata_module, |cpm| {
let out = output.with_extension("metadata.o");
WriteOutputFile(sess, tm, cpm,
Expand All @@ -257,7 +257,7 @@ pub mod write {
})
}
}
output_type_exe | output_type_object => {
OutputTypeExe | OutputTypeObject => {
with_codegen(tm, llmod, |cpm| {
WriteOutputFile(sess, tm, cpm, llmod, output,
lib::llvm::ObjectFile);
Expand Down
28 changes: 14 additions & 14 deletions src/librustc/driver/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ pub fn phase_5_run_llvm_passes(sess: Session,
outputs: &OutputFilenames) {

if sess.no_integrated_as() {
let output_type = link::output_type_assembly;
let output_type = link::OutputTypeAssembly;
let asm_filename = outputs.obj_filename.with_extension("s");

time(sess.time_passes(), "LLVM passes", (), |_|
Expand Down Expand Up @@ -424,7 +424,7 @@ pub fn stop_after_phase_2(sess: Session) -> bool {
}

pub fn stop_after_phase_5(sess: Session) -> bool {
if sess.opts.output_type != link::output_type_exe {
if sess.opts.output_type != link::OutputTypeExe {
debug!("not building executable, returning early from compile_input");
return true;
}
Expand Down Expand Up @@ -765,17 +765,17 @@ pub fn build_session_options(binary: ~str,

let output_type =
if parse_only || no_trans {
link::output_type_none
link::OutputTypeNone
} else if matches.opt_present("S") &&
matches.opt_present("emit-llvm") {
link::output_type_llvm_assembly
link::OutputTypeLlvmAssembly
} else if matches.opt_present("S") {
link::output_type_assembly
link::OutputTypeAssembly
} else if matches.opt_present("c") {
link::output_type_object
link::OutputTypeObject
} else if matches.opt_present("emit-llvm") {
link::output_type_bitcode
} else { link::output_type_exe };
link::OutputTypeBitcode
} else { link::OutputTypeExe };
let sysroot_opt = matches.opt_str("sysroot").map(|m| @Path::new(m));
let target = matches.opt_str("target").unwrap_or(host_triple());
let target_cpu = matches.opt_str("target-cpu").unwrap_or(~"generic");
Expand Down Expand Up @@ -1039,15 +1039,15 @@ pub fn build_output_filenames(input: &input,
let obj_path;
let out_path;
let sopts = sess.opts;
let stop_after_codegen = sopts.output_type != link::output_type_exe;
let stop_after_codegen = sopts.output_type != link::OutputTypeExe;

let obj_suffix = match sopts.output_type {
link::output_type_none => ~"none",
link::output_type_bitcode => ~"bc",
link::output_type_assembly => ~"s",
link::output_type_llvm_assembly => ~"ll",
link::OutputTypeNone => ~"none",
link::OutputTypeBitcode => ~"bc",
link::OutputTypeAssembly => ~"s",
link::OutputTypeLlvmAssembly => ~"ll",
// Object and exe output both use the '.o' extension here
link::output_type_object | link::output_type_exe => ~"o"
link::OutputTypeObject | link::OutputTypeExe => ~"o"
};

match *ofile {
Expand Down
14 changes: 7 additions & 7 deletions src/librustc/driver/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ pub struct options {
llvm_args: ~[~str],
debuginfo: bool,
extra_debuginfo: bool,
lint_opts: ~[(lint::lint, lint::level)],
lint_opts: ~[(lint::Lint, lint::level)],
save_temps: bool,
output_type: back::link::output_type,
output_type: back::link::OutputType,
// This is mutable for rustpkg, which updates search paths based on the
// parsed code.
addl_lib_search_paths: @RefCell<HashSet<Path>>,
Expand Down Expand Up @@ -214,7 +214,7 @@ pub struct Session_ {
building_library: Cell<bool>,
working_dir: Path,
lints: RefCell<HashMap<ast::NodeId,
~[(lint::lint, codemap::Span, ~str)]>>,
~[(lint::Lint, codemap::Span, ~str)]>>,
node_id: Cell<ast::NodeId>,
outputs: @RefCell<~[OutputStyle]>,
}
Expand Down Expand Up @@ -268,7 +268,7 @@ impl Session_ {
self.span_diagnostic.handler().unimpl(msg)
}
pub fn add_lint(&self,
lint: lint::lint,
lint: lint::Lint,
id: ast::NodeId,
sp: Span,
msg: ~str) {
Expand Down Expand Up @@ -385,7 +385,7 @@ pub fn basic_options() -> @options {
extra_debuginfo: false,
lint_opts: ~[],
save_temps: false,
output_type: link::output_type_exe,
output_type: link::OutputTypeExe,
addl_lib_search_paths: @RefCell::new(HashSet::new()),
ar: None,
linker: None,
Expand Down Expand Up @@ -443,12 +443,12 @@ pub fn collect_outputs(session: &Session,
Some(n) if "staticlib" == n => Some(OutputStaticlib),
Some(n) if "bin" == n => Some(OutputExecutable),
Some(_) => {
session.add_lint(lint::unknown_crate_type, ast::CRATE_NODE_ID,
session.add_lint(lint::UnknownCrateType, ast::CRATE_NODE_ID,
a.span, ~"invalid `crate_type` value");
None
}
_ => {
session.add_lint(lint::unknown_crate_type, ast::CRATE_NODE_ID,
session.add_lint(lint::UnknownCrateType, ast::CRATE_NODE_ID,
a.span, ~"`crate_type` requires a value");
None
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/front/feature_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ pub fn check_crate(sess: Session, crate: &ast::Crate) {
directive not necessary");
}
None => {
sess.add_lint(lint::unknown_features,
sess.add_lint(lint::UnknownFeatures,
ast::CRATE_NODE_ID,
mi.span,
~"unknown feature");
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/middle/dead.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use middle::ty;
use middle::typeck;
use middle::privacy;
use middle::lint::dead_code;
use middle::lint::DeadCode;

use std::hashmap::HashSet;
use syntax::ast;
Expand Down Expand Up @@ -328,7 +328,7 @@ impl DeadVisitor {

fn warn_dead_code(&mut self, id: ast::NodeId,
span: codemap::Span, ident: &ast::Ident) {
self.tcx.sess.add_lint(dead_code, id, span,
self.tcx.sess.add_lint(DeadCode, id, span,
format!("code is never used: `{}`",
token::ident_to_str(ident)));
}
Expand Down
Loading