diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-04-09 20:32:21 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-09 20:32:21 +0000 |
commit | 9c97c8588321a106512affb2935b8ec1f836804f (patch) | |
tree | cb6779373f416112b0e771d4edb0fbab1aa12b4b /gcc/rust/backend | |
parent | 85bd4cef64e1be492d1c62eb05d77a6cea1a8d21 (diff) | |
parent | acb0062081056340722e01447d1e266d357e6a17 (diff) | |
download | gcc-9c97c8588321a106512affb2935b8ec1f836804f.zip gcc-9c97c8588321a106512affb2935b8ec1f836804f.tar.gz gcc-9c97c8588321a106512affb2935b8ec1f836804f.tar.bz2 |
Merge #357
357: Create liveness analysis for dead code detection r=philberty a=thomasyonug
This is the very beginning work for dead code detection. #330
1. create a new test for this feature.
2. handle an extremely simple case.
After compiling the rust1, and feed "testsuite/rust.test/xfail_compile/unused.rs" to it.
``` rust
fn bar() { // {dg-warning "function is never used: `bar`"}
foo();
}
fn foo() { // {dg-warning "function is never used: `foo`"}
bar();
}
fn f() {
}
fn main() {
f();
}
```
we will get some warnings.
``` bash
../gccrs/gcc/testsuite/rust.test/xfail_compile/unused.rs:2:1: warning: function is never used: `[bar]`
2 | fn bar() { // {dg-warning "function is never used: `bar`"}
| ^
../gccrs/gcc/testsuite/rust.test/xfail_compile/unused.rs:6:1: warning: function is never used: `[foo]`
6 | fn foo() { // {dg-warning "function is never used: `foo`"}
| ^
```
Co-authored-by: Thomas Young <wenzhang5800@gmail.com>
Diffstat (limited to 'gcc/rust/backend')
0 files changed, 0 insertions, 0 deletions