Skip to content

Commit

Permalink
Merge pull request Artisan-Lab#73 from Unparalleled-Calvin/main
Browse files Browse the repository at this point in the history
Upgrade to nightly-2024-10-12
  • Loading branch information
hxuhack authored Nov 14, 2024
2 parents 056ea08 + c1c08e6 commit cf991e5
Show file tree
Hide file tree
Showing 28 changed files with 403 additions and 132 deletions.
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ esac

# Set the library path to be added
#LIBRARY_PATH="$HOME/.rustup/toolchains/nightly-2023-10-05-x86_64-unknown-linux-gnu/lib"
toolchain_date="nightly-2024-06-30"
toolchain_date="nightly-2024-10-12"
toolchain_file="rust-toolchain.toml"
if [ ! -f "$toolchain_file" ]; then
printf "%bError: %s does not exist.%b\n" "${RED}" "$toolchain_file" "${NC}"
Expand Down
5 changes: 3 additions & 2 deletions rap/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions rap/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ wait-timeout = "0.2.0"
rustc-demangle = "0.1.21"
colorful = "0.2.1"
regex = "1.11.1"
once_cell = "1.20.1"
walkdir = "2"
cargo_metadata = "0.18"

Expand Down
3 changes: 1 addition & 2 deletions rap/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[toolchain]
# The default version of the rustc compiler
#channel = "nightly-2023-10-05-x86_64-unknown-linux-gnu"
channel = "nightly-2024-06-30"
channel = "nightly-2024-10-12"
components = ["rustc-dev", "rust-src", "llvm-tools-preview"]
5 changes: 0 additions & 5 deletions rap/rust-toolchain.toml.bak

This file was deleted.

1 change: 1 addition & 0 deletions rap/src/analysis.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pub mod core;
pub mod opt;
pub mod rcanary;
pub mod safedrop;
pub mod senryx;
Expand Down
1 change: 0 additions & 1 deletion rap/src/analysis/core.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
pub mod alias;
pub mod call_graph;
pub mod control_flow;
pub mod dataflow;
pub mod heap_item;
4 changes: 3 additions & 1 deletion rap/src/analysis/core/alias/mop/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ impl<'tcx> MopGraph<'tcx> {
}
}
}
Rvalue::Ref(_, _, ref p) | Rvalue::AddressOf(_, ref p) => {
Rvalue::Ref(_, _, ref p) => {
let rv_local = p.local.as_usize();
if values[lv_local].may_drop && values[rv_local].may_drop {
let rv = *p;
Expand Down Expand Up @@ -354,6 +354,7 @@ impl<'tcx> MopGraph<'tcx> {
}
cur_bb.calls.push(terminator.clone());
}
TerminatorKind::TailCall { .. } => todo!(),
TerminatorKind::Assert {
cond: _,
expected: _,
Expand Down Expand Up @@ -396,6 +397,7 @@ impl<'tcx> MopGraph<'tcx> {
line_spans: _,
ref unwind,
targets,
asm_macro: _,
} => {
for target in targets {
cur_bb.add_next(target.as_usize());
Expand Down
5 changes: 1 addition & 4 deletions rap/src/analysis/core/call_graph/call_graph_visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ impl<'b, 'tcx> CallGraphVisitor<'b, 'tcx> {
if let FnDef(callee_def_id, callee_substs) = constant.const_.ty().kind() {
let param_env = self.tcx.param_env(self.def_id);
if let Ok(Some(instance)) =
Instance::resolve(self.tcx, param_env, *callee_def_id, callee_substs)
Instance::try_resolve(self.tcx, param_env, *callee_def_id, callee_substs)
{
let mut is_virtual = false;
// Try to analysis the specific type of callee.
Expand Down Expand Up @@ -114,9 +114,6 @@ impl<'b, 'tcx> CallGraphVisitor<'b, 'tcx> {
None
}
}
InstanceKind::CoroutineKindShim {
coroutine_def_id, ..
} => Some(coroutine_def_id),
};
if let Some(instance_def_id) = instance_def_id {
self.add_to_call_graph(instance_def_id, Some(is_virtual));
Expand Down
1 change: 0 additions & 1 deletion rap/src/analysis/core/control_flow.rs

This file was deleted.

14 changes: 9 additions & 5 deletions rap/src/analysis/core/dataflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ impl<'tcx> DataFlow<'tcx> {
}

pub fn start(&mut self) {
self.build_graphs();
if self.debug {
self.draw_graphs();
}
}

pub fn build_graphs(&mut self) {
for local_def_id in self.tcx.iter_local_def_id() {
let hir_map = self.tcx.hir();
if hir_map.maybe_body_owned_by(local_def_id).is_some() {
Expand All @@ -36,9 +43,6 @@ impl<'tcx> DataFlow<'tcx> {
self.graphs.insert(def_id, graph);
}
}
if self.debug {
self.draw_graphs();
}
}

fn build_graph(&self, def_id: DefId) -> Graph {
Expand All @@ -47,10 +51,10 @@ impl<'tcx> DataFlow<'tcx> {
let basic_blocks = &body.basic_blocks;
for basic_block_data in basic_blocks.iter() {
for statement in basic_block_data.statements.iter() {
graph.add_statm_to_graph(&statement.kind);
graph.add_statm_to_graph(&statement);
}
if let Some(terminator) = &basic_block_data.terminator {
graph.add_terminator_to_graph(&terminator.kind);
graph.add_terminator_to_graph(&terminator);
}
}
graph
Expand Down
Loading

0 comments on commit cf991e5

Please sign in to comment.