Skip to content
This repository has been archived by the owner on Aug 22, 2024. It is now read-only.

Commit

Permalink
Use def_id_as_qualified_name_str for call graphs (#1197)
Browse files Browse the repository at this point in the history
  • Loading branch information
hermanventer authored Jan 8, 2023
1 parent 8c12e4d commit 1acf5f7
Show file tree
Hide file tree
Showing 31 changed files with 325 additions and 124 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion annotations/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

name = "mirai-annotations"
version = "1.12.0"
authors = ["Herman Venter <hermanv@fb.com>"]
authors = ["Herman Venter <herman_venter@msn.com>"]
description = "Macros that provide source code annotations for MIRAI"
repository = "https://github.com/facebookexperimental/MIRAI"
readme = "README.md"
Expand Down
Binary file modified binaries/summary_store.tar
Binary file not shown.
4 changes: 2 additions & 2 deletions checker/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]

name = "mirai"
version = "1.1.3"
authors = ["Herman Venter <hermanv@fb.com>"]
version = "1.1.4"
authors = ["Herman Venter <herman_venter@msn.com>"]
description = "A static analysis tool for Rust, based on Abstract Interpretation of MIR"
repository = "https://github.com/facebookexperimental/MIRAI"
readme = "../README.md"
Expand Down
2 changes: 1 addition & 1 deletion checker/src/call_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1440,7 +1440,7 @@ impl CallSiteOutput {
Entry::Vacant(v) => {
v.insert(index);
let tcx = call_graph.tcx;
let name = crate::utils::summary_key_str(tcx, callable).to_string();
let name = crate::utils::def_id_as_qualified_name_str(tcx, callable).to_string();
let local = !call_graph.non_local_defs.contains(&callable);
let span = tcx.def_span(callable);
let source_map = tcx.sess.source_map();
Expand Down
8 changes: 4 additions & 4 deletions checker/tests/call_graph/fnptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,25 +69,25 @@ commit;
],
"callables": [
{
"name": "fnptr.fn1",
"name": "/fnptr/fn1(u32,&fn(u32) -> u32)->u32",
"file_index": 0,
"first_line": 9,
"local": true
},
{
"name": "fnptr.fn2",
"name": "/fnptr/fn2(u32)->u32",
"file_index": 0,
"first_line": 12,
"local": true
},
{
"name": "fnptr.fn3",
"name": "/fnptr/fn3(u32)->u32",
"file_index": 0,
"first_line": 15,
"local": true
},
{
"name": "fnptr.main",
"name": "/fnptr/main()->()",
"file_index": 0,
"first_line": 18,
"local": true
Expand Down
8 changes: 4 additions & 4 deletions checker/tests/call_graph/fnptr_clean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,25 +74,25 @@ commit;
],
"callables": [
{
"name": "fnptr_clean.fn1",
"name": "/fnptr_clean/fn1(u32,&fn(u32) -> u32)->u32",
"file_index": 0,
"first_line": 14,
"local": true
},
{
"name": "fnptr_clean.fn2",
"name": "/fnptr_clean/fn2(u32)->u32",
"file_index": 0,
"first_line": 17,
"local": true
},
{
"name": "fnptr_clean.fn3",
"name": "/fnptr_clean/fn3(u32)->u32",
"file_index": 0,
"first_line": 20,
"local": true
},
{
"name": "fnptr_clean.main",
"name": "/fnptr_clean/main()->()",
"file_index": 0,
"first_line": 23,
"local": true
Expand Down
8 changes: 4 additions & 4 deletions checker/tests/call_graph/fnptr_deduplicate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,25 +66,25 @@ commit;
],
"callables": [
{
"name": "fnptr_deduplicate.fn1",
"name": "/fnptr_deduplicate/fn1(u32,&fn(u32) -> u32)->u32",
"file_index": 0,
"first_line": 10,
"local": true
},
{
"name": "fnptr_deduplicate.fn2",
"name": "/fnptr_deduplicate/fn2(u32)->u32",
"file_index": 0,
"first_line": 13,
"local": true
},
{
"name": "fnptr_deduplicate.fn3",
"name": "/fnptr_deduplicate/fn3(u32)->u32",
"file_index": 0,
"first_line": 16,
"local": true
},
{
"name": "fnptr_deduplicate.main",
"name": "/fnptr_deduplicate/main()->()",
"file_index": 0,
"first_line": 19,
"local": true
Expand Down
8 changes: 4 additions & 4 deletions checker/tests/call_graph/fnptr_dom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,25 +71,25 @@ commit;
],
"callables": [
{
"name": "fnptr_dom.fn1",
"name": "/fnptr_dom/fn1(u32,&fn(u32) -> u32,&fn(u32) -> u32)->u32",
"file_index": 0,
"first_line": 9,
"local": true
},
{
"name": "fnptr_dom.fn2",
"name": "/fnptr_dom/fn2(u32)->u32",
"file_index": 0,
"first_line": 13,
"local": true
},
{
"name": "fnptr_dom.fn3",
"name": "/fnptr_dom/fn3(u32)->u32",
"file_index": 0,
"first_line": 16,
"local": true
},
{
"name": "fnptr_dom.main",
"name": "/fnptr_dom/main()->()",
"file_index": 0,
"first_line": 19,
"local": true
Expand Down
10 changes: 5 additions & 5 deletions checker/tests/call_graph/fnptr_dom_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,31 +85,31 @@ commit;
],
"callables": [
{
"name": "fnptr_dom_loop.fn1",
"name": "/fnptr_dom_loop/fn1(u32,&fn(u32) -> u32,&fn(u32) -> u32)->u32",
"file_index": 0,
"first_line": 9,
"local": true
},
{
"name": "fnptr_dom_loop.fn2",
"name": "/fnptr_dom_loop/fn2(u32)->u32",
"file_index": 0,
"first_line": 13,
"local": true
},
{
"name": "fnptr_dom_loop.fn3",
"name": "/fnptr_dom_loop/fn3(u32)->u32",
"file_index": 0,
"first_line": 16,
"local": true
},
{
"name": "fnptr_dom_loop.fn4",
"name": "/fnptr_dom_loop/fn4(u32)->u32",
"file_index": 0,
"first_line": 19,
"local": true
},
{
"name": "fnptr_dom_loop.main",
"name": "/fnptr_dom_loop/main()->()",
"file_index": 0,
"first_line": 26,
"local": true
Expand Down
10 changes: 5 additions & 5 deletions checker/tests/call_graph/fnptr_dom_loop_souffle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,31 +82,31 @@ digraph {
],
"callables": [
{
"name": "fnptr_dom_loop_souffle.fn1",
"name": "/fnptr_dom_loop_souffle/fn1(u32,&fn(u32) -> u32,&fn(u32) -> u32)->u32",
"file_index": 0,
"first_line": 10,
"local": true
},
{
"name": "fnptr_dom_loop_souffle.fn2",
"name": "/fnptr_dom_loop_souffle/fn2(u32)->u32",
"file_index": 0,
"first_line": 14,
"local": true
},
{
"name": "fnptr_dom_loop_souffle.fn3",
"name": "/fnptr_dom_loop_souffle/fn3(u32)->u32",
"file_index": 0,
"first_line": 17,
"local": true
},
{
"name": "fnptr_dom_loop_souffle.fn4",
"name": "/fnptr_dom_loop_souffle/fn4(u32)->u32",
"file_index": 0,
"first_line": 20,
"local": true
},
{
"name": "fnptr_dom_loop_souffle.main",
"name": "/fnptr_dom_loop_souffle/main()->()",
"file_index": 0,
"first_line": 27,
"local": true
Expand Down
12 changes: 6 additions & 6 deletions checker/tests/call_graph/fnptr_fold.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,37 +73,37 @@ commit;
],
"callables": [
{
"name": "fnptr_fold.fn1",
"name": "/fnptr_fold/fn1(u32,&fn(u32) -> u32)->u32",
"file_index": 0,
"first_line": 10,
"local": true
},
{
"name": "fnptr_fold.fn2",
"name": "/fnptr_fold/fn2(u32)->u32",
"file_index": 0,
"first_line": 13,
"local": true
},
{
"name": "fnptr_fold.fn3",
"name": "/fnptr_fold/fn3(u32)->u32",
"file_index": 0,
"first_line": 16,
"local": true
},
{
"name": "fnptr_fold.main",
"name": "/fnptr_fold/main()->()",
"file_index": 0,
"first_line": 20,
"local": true
},
{
"name": "std.io.stdio._print",
"name": "/std/std::io::_print(std::fmt::Arguments<'_>)->()",
"file_index": 1,
"first_line": 1073,
"local": false
},
{
"name": "core.fmt.implement_core_fmt_Arguments.new_v1",
"name": "/core/std::fmt::Arguments::<'a>::new_v1(&'a [&'static str],&'a [std::fmt::ArgumentV1<'a>])->std::fmt::Arguments<'a>",
"file_index": 2,
"first_line": 394,
"local": true
Expand Down
8 changes: 4 additions & 4 deletions checker/tests/call_graph/fnptr_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,25 +76,25 @@ commit;
],
"callables": [
{
"name": "fnptr_loop.fn1",
"name": "/fnptr_loop/fn1(u32)->u32",
"file_index": 0,
"first_line": 9,
"local": true
},
{
"name": "fnptr_loop.fn2",
"name": "/fnptr_loop/fn2(u32,&fn(u32) -> u32)->u32",
"file_index": 0,
"first_line": 12,
"local": true
},
{
"name": "fnptr_loop.fn3",
"name": "/fnptr_loop/fn3(u32)->u32",
"file_index": 0,
"first_line": 15,
"local": true
},
{
"name": "fnptr_loop.main",
"name": "/fnptr_loop/main()->()",
"file_index": 0,
"first_line": 22,
"local": true
Expand Down
8 changes: 4 additions & 4 deletions checker/tests/call_graph/fnptr_slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,25 +62,25 @@ commit;
],
"callables": [
{
"name": "fnptr_slice.fn1",
"name": "/fnptr_slice/fn1(u32,&fn(u32) -> u32)->u32",
"file_index": 0,
"first_line": 10,
"local": true
},
{
"name": "fnptr_slice.fn2",
"name": "/fnptr_slice/fn2(u32)->u32",
"file_index": 0,
"first_line": 13,
"local": true
},
{
"name": "fnptr_slice.fn3",
"name": "/fnptr_slice/fn3(u32)->u32",
"file_index": 0,
"first_line": 16,
"local": true
},
{
"name": "fnptr_slice.main",
"name": "/fnptr_slice/main()->()",
"file_index": 0,
"first_line": 19,
"local": true
Expand Down
Loading

0 comments on commit 1acf5f7

Please sign in to comment.