aboutsummaryrefslogtreecommitdiff
path: root/gcc/bitmap.h
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2016-10-07 11:26:15 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2016-10-07 11:26:15 +0000
commit7a18d752e7061c81f83f97969ecf5cd46379d51e (patch)
tree06de74d64a0c15784179e33c169e3c67777b2ee0 /gcc/bitmap.h
parenta30fe4b68120118221578b111036fa5fea0d25b3 (diff)
downloadgcc-7a18d752e7061c81f83f97969ecf5cd46379d51e.zip
gcc-7a18d752e7061c81f83f97969ecf5cd46379d51e.tar.gz
gcc-7a18d752e7061c81f83f97969ecf5cd46379d51e.tar.bz2
bitmap.h: Document constraints on bitmap modification while iterating over it.
2016-10-07 Richard Biener <rguenther@suse.de> * bitmap.h: Document constraints on bitmap modification while iterating over it. From-SVN: r240860
Diffstat (limited to 'gcc/bitmap.h')
-rw-r--r--gcc/bitmap.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/bitmap.h b/gcc/bitmap.h
index e4e80d6..1b2c8e0 100644
--- a/gcc/bitmap.h
+++ b/gcc/bitmap.h
@@ -755,6 +755,18 @@ bmp_iter_and_compl (bitmap_iterator *bi, unsigned *bit_no)
}
}
+/* If you are modifying a bitmap you are currently iterating over you
+ have to ensure to
+ - never remove the current bit;
+ - if you set or clear a bit before the current bit this operation
+ will not affect the set of bits you are visiting during the iteration;
+ - if you set or clear a bit after the current bit it is unspecified
+ whether that affects the set of bits you are visiting during the
+ iteration.
+ If you want to remove the current bit you can delay this to the next
+ iteration (and after the iteration in case the last iteration is
+ affected). */
+
/* Loop over all bits set in BITMAP, starting with MIN and setting
BITNUM to the bit number. ITER is a bitmap iterator. BITNUM
should be treated as a read-only variable as it contains loop