diff options
author | Tom de Vries <tom@codesourcery.com> | 2011-09-26 12:36:56 +0000 |
---|---|---|
committer | Tom de Vries <vries@gcc.gnu.org> | 2011-09-26 12:36:56 +0000 |
commit | 703ffc3005c21d95d957e2fdc89f0c54f937c9a1 (patch) | |
tree | 8d02f7d1f0d75bf09d203369ba6db35e46bacc12 /gcc/tree-ssa-structalias.c | |
parent | 750db0248d1fe522587cb677402a839b68185d58 (diff) | |
download | gcc-703ffc3005c21d95d957e2fdc89f0c54f937c9a1.zip gcc-703ffc3005c21d95d957e2fdc89f0c54f937c9a1.tar.gz gcc-703ffc3005c21d95d957e2fdc89f0c54f937c9a1.tar.bz2 |
tree-ssa-alias.h (pt_solution_singleton_p): Declare.
2011-09-26 Tom de Vries <tom@codesourcery.com>
* tree-ssa-alias.h (pt_solution_singleton_p): Declare.
* tree-ssa-structalias.c (pt_solution_singleton_p): New function.
* tree-ssa-ccp.c (fold_builtin_alloca_for_var): Set points-to solution
of new var.
From-SVN: r179193
Diffstat (limited to 'gcc/tree-ssa-structalias.c')
-rw-r--r-- | gcc/tree-ssa-structalias.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index b2f068a..1023acf 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -5979,6 +5979,21 @@ pt_solution_empty_p (struct pt_solution *pt) return true; } +/* Return true if the points-to solution *PT only point to a single var, and + return the var uid in *UID. */ + +bool +pt_solution_singleton_p (struct pt_solution *pt, unsigned *uid) +{ + if (pt->anything || pt->nonlocal || pt->escaped || pt->ipa_escaped + || pt->null || pt->vars == NULL + || !bitmap_single_bit_set_p (pt->vars)) + return false; + + *uid = bitmap_first_set_bit (pt->vars); + return true; +} + /* Return true if the points-to solution *PT includes global memory. */ bool |