================
@@ -29,3 +26,29 @@ bool InitMap::isElementInitialized(unsigned I) const {
unsigned Bucket = I / PER_FIELD;
return data()[Bucket] & (T(1) << (I % PER_FIELD));
}
+
+// Values in the second half of data() are inverted,
+// i.e. 0 means "lifetime started".
+void InitMap::startElementLifetime(unsigned I) {
+ unsigned LifetimeIndex = NumElems + I;
+
+ unsigned Bucket = numFields(NumElems) / 2 + (I / PER_FIELD);
----------------
shafik wrote:
You calculate Bucket and Mask in several place, this is problematic. Duplicates
are known to drift over time and are a prime source for bugs.
More confusingly you seem to have two different calculation for Bucket, which
is ripe for bugs when a future person comes and modifies the code and confuses
the two.
https://github.com/llvm/llvm-project/pull/173333
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits