CodeQL library for Rust
codeql/rust-all 0.2.5-dev (changelog, source)
Search

Member predicate Ssa::Definition::getARead

Gets a control flow node that reads the value of this SSA definition.

Example:

fn phi(b : bool) {              // defines b_0
     let mut x = 1;             // defines x_0
     println!("{}", x);         // reads x_0
     println!("{}", x + 1);     // reads x_0

     if b {                     // reads b_0
         x = 2;                 // defines x_1
         println!("{}", x);     // reads x_1
         println!("{}", x + 1); // reads x_1
     } else {
         x = 3;                 // defines x_2
         println!("{}", x);     // reads x_2
         println!("{}", x + 1); // reads x_2
     }
                                // defines x_3 = phi(x_1, x_2)
     println!("{}", x);         // reads x_3
}
Expr getARead()