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);
139 FullDelta = IR.LHS->getFullDelta()+IR.RHS->getFullDelta()+IR.Split.Delta;
171 NewFullDelta += Values[i].Delta;
178 /// DoInsertion - Do an insertion of the specified FileIndex/Delta pair into
182 bool DeltaTreeNode::DoInsertion(unsigned FileIndex, int Delta,
184 // Maintain full delta for this node.
185 FullDelta += Delta;
187 // Find the insertion point, the first delta whose index is >= FileIndex.
195 // NOTE: Delta could drop to zero here. This means that the delta entry is
197 // leaving an entry with Delta=0, so we just leave an entry with Delta=0 in
199 Values[i].Delta += Delta;
211 Values[i] = SourceDelta::get(FileIndex, Delta);
222 InsertRes->LHS->DoInsertion(FileIndex, Delta, 0 /*can't fail*/);
224 InsertRes->RHS->DoInsertion(FileIndex, Delta, 0 /*can't fail*/);
230 if (!IN->Children[i]->DoInsertion(FileIndex, Delta, InsertRes))
272 // Find the insertion point, the first delta whose index is >SubSplit.FileLoc.
289 InsertSide->FullDelta += SubSplit.Delta + SubRHS->getFullDelta();
325 // Recompute the two nodes' full delta.
354 FullDelta += N->getValue(i).Delta;
368 FullDelta += IVal.Delta;
404 /// getDeltaAt - Return the accumulated delta at the specified file offset.
424 Result += Val.Delta;
452 /// this method is used to record that info. It inserts a delta of 'Delta'
454 void DeltaTree::AddDelta(unsigned FileIndex, int Delta) {
455 assert(Delta && "Adding a noop?");
459 if (MyRoot->DoInsertion(FileIndex, Delta, &InsertRes)) {