Home | History | Annotate | Download | only in Rewrite

Lines Matching refs:Delta

1 //===--- DeltaTree.cpp - B-Tree for Rewrite Delta tracking ----------------===//
24 /// DeltaTree implements a key/value mapping from FileIndex to Delta, allowing
26 /// can also efficiently tell us the full accumulated delta for a specific
31 /// former and adds children pointers. Each node knows the full delta of all
33 /// full delta implied by a whole subtree in constant time.
41 int Delta;
44 SourceDelta Delta;
45 Delta.FileLoc = Loc;
46 Delta.Delta = D;
47 return Delta;
81 /// FullDelta - This is the full delta of all the values in this node and
102 /// DoInsertion - Do an insertion of the specified FileIndex/Delta pair into
106 bool DoInsertion(unsigned FileIndex, int Delta, InsertResult *InsertRes);
137 FullDelta = IR.LHS->getFullDelta()+IR.RHS->getFullDelta()+IR.Split.Delta;
168 NewFullDelta += Values[i].Delta;
175 /// DoInsertion - Do an insertion of the specified FileIndex/Delta pair into
179 bool DeltaTreeNode::DoInsertion(unsigned FileIndex, int Delta,
181 // Maintain full delta for this node.
182 FullDelta += Delta;
184 // Find the insertion point, the first delta whose index is >= FileIndex.
192 // NOTE: Delta could drop to zero here. This means that the delta entry is
194 // leaving an entry with Delta=0, so we just leave an entry with Delta=0 in
196 Values[i].Delta += Delta;
208 Values[i] = SourceDelta::get(FileIndex, Delta);
219 InsertRes->LHS->DoInsertion(FileIndex, Delta, nullptr /*can't fail*/);
221 InsertRes->RHS->DoInsertion(FileIndex, Delta, nullptr /*can't fail*/);
227 if (!IN->Children[i]->DoInsertion(FileIndex, Delta, InsertRes))
269 // Find the insertion point, the first delta whose index is >SubSplit.FileLoc.
286 InsertSide->FullDelta += SubSplit.Delta + SubRHS->getFullDelta();
322 // Recompute the two nodes' full delta.
351 FullDelta += N->getValue(i).Delta;
365 FullDelta += IVal.Delta;
401 /// getDeltaAt - Return the accumulated delta at the specified file offset.
421 Result += Val.Delta;
449 /// this method is used to record that info. It inserts a delta of 'Delta'
451 void DeltaTree::AddDelta(unsigned FileIndex, int Delta) {
452 assert(Delta && "Adding a noop?");
456 if (MyRoot->DoInsertion(FileIndex, Delta, &InsertRes)) {