[cfe-dev] Proposed: change tracking for RegionStore

Jordy Rose jediknil at belkadan.com
Fri Jul 30 11:27:07 PDT 2010

In working with C string length tracking, I've found it's hard to track
all the cases when a region might change. One possibility would be to
registering callbacks when /any/ store is made (possibly erasures as
I wasn't so fond of that idea.

Instead, I went with an alternate idea: record a "change marker" in the
store for each region. Whenever a region changes, the marker is cleared, as
well as markers for all its super-regions.

The markers are stored under a new type of binding (BindingKey::Change),
(ab)using UndefinedVal's data slot to contain the marker. The actual value
of the marker is simply a pointer to the store just before the marker was

The downside, of course, is that the marker-clearing happens with every
Add/Remove in the store, most of the time doing nothing. The super-region
hierarchy isn't /that/ deep, but it's still something to consider.

Comments? What needs to be done to make this committable?
RequestChangeMarker is particularly bad, but I'm not sure what the best way
around it is.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: change-markers.patch
Type: text/x-diff
Size: 6348 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20100730/f90c4f89/attachment.patch>

More information about the cfe-dev mailing list