Skip to content

Commit 1588e2a

Browse files
committed
[WIP]
1 parent 5e17369 commit 1588e2a

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

build_system/bench.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ pub(crate) fn benchmark(dirs: &Dirs, compiler: &Compiler) {
7373
bench_runs,
7474
Some(&clean_cmd),
7575
&[
76-
("cargo build", &llvm_build_cmd),
76+
//("cargo build", &llvm_build_cmd),
7777
("cargo-clif build", &clif_build_cmd),
7878
("cargo-clif build --release", &clif_build_opt_cmd),
7979
],
@@ -88,6 +88,8 @@ pub(crate) fn benchmark(dirs: &Dirs, compiler: &Compiler) {
8888
gha_step_summary.write_all(b"\n").unwrap();
8989
}
9090

91+
return;
92+
9193
eprintln!("[BENCH RUN] ebobby/simple-raytracer");
9294

9395
let bench_run_markdown = dirs.build_dir.join("bench_run.md");
@@ -103,7 +105,7 @@ pub(crate) fn benchmark(dirs: &Dirs, compiler: &Compiler) {
103105
bench_runs,
104106
None,
105107
&[
106-
("", raytracer_cg_llvm.to_str().unwrap()),
108+
//("", raytracer_cg_llvm.to_str().unwrap()),
107109
("", raytracer_cg_clif.to_str().unwrap()),
108110
("", raytracer_cg_clif_opt.to_str().unwrap()),
109111
],

src/abi/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ pub(crate) fn import_function<'tcx>(
9595
) -> FuncId {
9696
let name = tcx.symbol_name(inst).name;
9797
let sig = get_function_sig(tcx, module.target_config().default_call_conv, inst);
98-
match module.declare_function(name, Linkage::Import, &sig) {
98+
match module.declare_function(name.strip_prefix("\u{1}").unwrap_or(name), Linkage::Import, &sig)
99+
{
99100
Ok(func_id) => func_id,
100101
Err(ModuleError::IncompatibleDeclaration(_)) => tcx.dcx().fatal(format!(
101102
"attempt to declare `{name}` as function, but it was already declared as static"

src/constant.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ fn data_id_for_static(
286286
};
287287

288288
let data_id = match module.declare_data(
289-
symbol_name,
289+
symbol_name.strip_prefix("\u{1}").unwrap_or(symbol_name),
290290
linkage,
291291
false,
292292
attrs.flags.contains(CodegenFnAttrFlags::THREAD_LOCAL),
@@ -334,7 +334,7 @@ fn data_id_for_static(
334334
};
335335

336336
let data_id = match module.declare_data(
337-
symbol_name,
337+
symbol_name.strip_prefix("\u{1}").unwrap_or(symbol_name),
338338
linkage,
339339
definition_writable,
340340
attrs.flags.contains(CodegenFnAttrFlags::THREAD_LOCAL),

src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ extern crate rustc_fs_util;
2727
extern crate rustc_hir;
2828
extern crate rustc_incremental;
2929
extern crate rustc_index;
30+
extern crate rustc_macros;
3031
extern crate rustc_metadata;
32+
extern crate rustc_query_system;
3133
extern crate rustc_session;
3234
extern crate rustc_span;
3335
extern crate rustc_symbol_mangling;
@@ -47,6 +49,7 @@ use cranelift_codegen::isa::TargetIsa;
4749
use cranelift_codegen::settings::{self, Configurable};
4850
use rustc_codegen_ssa::traits::CodegenBackend;
4951
use rustc_codegen_ssa::{CodegenResults, TargetConfig};
52+
use rustc_macros::HashStable;
5053
use rustc_middle::dep_graph::{WorkProduct, WorkProductId};
5154
use rustc_session::Session;
5255
use rustc_session::config::OutputFilenames;
@@ -125,6 +128,7 @@ impl<F: Fn() -> String> Drop for PrintOnPanic<F> {
125128

126129
/// The codegen context holds any information shared between the codegen of individual functions
127130
/// inside a single codegen unit with the exception of the Cranelift [`Module`](cranelift_module::Module).
131+
#[derive(Copy, Clone, HashStable)]
128132
struct CodegenCx {
129133
should_write_ir: bool,
130134
//debug_context: Option<DebugContext>,

0 commit comments

Comments
 (0)