Bool VG_(lookupSWA) ( const SparseWA* swa,
- /*OUT*/UWord* keyP, /*OUT*/UWord* valP,
+ /*OUT*/UWord* valP,
UWord key )
{
Int i;
vg_assert(level0->nInUse > 0);
ix = key & 0xFF;
if (swa_bitarray_read(level0->inUse, ix) == 0) return False;
- *keyP = key; /* this is stupid. only here to make it look like WordFM */
*valP = level0->words[ix];
return True;
}
Bool VG_(delFromSWA) ( SparseWA* swa,
- /*OUT*/UWord* oldK, /*OUT*/UWord* oldV, UWord key )
+ /*OUT*/UWord* oldV, UWord key )
{
Int i;
UWord ix;
if (swa_bitarray_read_then_clear(level0->inUse, ix) == 0)
return False;
- *oldK = key; /* this is silly */
*oldV = level0->words[ix];
level0->nInUse--;
OldRef* ref;
RCEC* rcec;
Word i, j;
- UWord keyW, valW;
+ UWord valW;
Bool b;
tl_assert(thr);
/* Look in the map to see if we already have a record for this
address. */
- b = VG_(lookupSWA)( oldrefTree, &keyW, &valW, a );
+ b = VG_(lookupSWA)( oldrefTree, &valW, a );
if (b) {
/* We already have a record for this address. We now need to
see if we have a stack trace pertaining to this (thrid, R/W,
size) triple. */
- tl_assert(keyW == a);
ref = (OldRef*)valW;
tl_assert(ref->magic == OldRef_MAGIC);
{
Word i, j;
OldRef* ref;
- UWord keyW, valW;
+ UWord valW;
Bool b;
ThrID cand_thrid;
cand_a = toCheck[j];
// VG_(printf)("test %ld %p\n", j, cand_a);
- b = VG_(lookupSWA)( oldrefTree, &keyW, &valW, cand_a );
+ b = VG_(lookupSWA)( oldrefTree, &valW, cand_a );
if (!b)
continue;
ref = (OldRef*)valW;
- tl_assert(keyW == cand_a);
tl_assert(ref->magic == OldRef_MAGIC);
tl_assert(ref->accs[0].thrid != 0); /* first slot must always be used */
for (i = 0; i < n2del; i++) {
Bool b;
Addr ga2del = *(Addr*)VG_(indexXA)( refs2del, i );
- b = VG_(delFromSWA)( oldrefTree, &keyW, &valW, ga2del );
+ b = VG_(delFromSWA)( oldrefTree, &valW, ga2del );
tl_assert(b);
- tl_assert(keyW == ga2del);
oldref = (OldRef*)valW;
for (j = 0; j < N_OLDREF_ACCS; j++) {
ThrID aThrID = oldref->accs[j].thrid;
// overwritten. Returned Bool is True iff a previous binding existed.
Bool VG_(addToSWA) ( SparseWA* swa, UWord key, UWord val );
-// Delete key from swa, returning associated key and val if found.
-// Note: returning associated key is stupid (it can only be the
-// key you just specified). This behaviour is retained to make it
-// easier to migrate from WordFM. Returned Bool is True iff
-// the key was actually bound in the mapping.
+// Delete key from swa, returning val if found.
+// Returned Bool is True iff the key was actually bound in the mapping.
Bool VG_(delFromSWA) ( SparseWA* swa,
- /*OUT*/UWord* oldK, /*OUT*/UWord* oldV,
+ /*OUT*/UWord* oldV,
UWord key );
// Indexes swa at 'key' (or, if you like, looks up 'key' in the
-// mapping), and returns the associated value, if any, in *valP. For
-// compatibility with WordFM, 'key' is also returned in *keyP. Returned
-// Bool is True iff a binding for 'key' actually existed.
+// mapping), and returns the associated value, if any, in *valP.
+// Returned Bool is True iff a binding for 'key' actually existed.
Bool VG_(lookupSWA) ( const SparseWA* swa,
- /*OUT*/UWord* keyP, /*OUT*/UWord* valP,
+ /*OUT*/UWord* valP,
UWord key );
// Set up 'swa' for iteration.