Skip to content

Commit

Permalink
Update 3.1-frontend.md
Browse files Browse the repository at this point in the history
  • Loading branch information
hxuhack authored Jul 10, 2024
1 parent 1b1ed94 commit 0fd986e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/3.1-frontend.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,10 @@ To support project-level program analysis, we want the analysis tool to be integ
```
cargo toolname -more_arguments
```
Cargo will automatically search the binaries named cargo-toolname from the paths.
Cargo will automatically search the binaries named cargo-toolname from the paths. The following figure demonstrates the whole process before reaching our analysis program.
![Workflow of how cargo dispatches the analysis command to rap.][figure/cargoflow.png]
Note that we cannot directly invoke rap in the first round but through cargo check because we need cargo to manage the project-level compilation and append detailed compilation options for launching rustc. However, we want to hook rustc execution and execute rap instead for analysis. Therefore, we set [RUSTC_WRAPPER](https://doc.rust-lang.org/cargo/reference/environment-variables.html) with the value of cargo-rap. In this way, cargo check will actually run `cargo-rap rustc appended_options`. We then dispath the execution to rap with appended options.

## Register Analysis Callbacks


0 comments on commit 0fd986e

Please sign in to comment.