summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/IntervalMap.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-11-19 01:21:03 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-11-19 01:21:03 +0000
commit09770251f6add86354667fc566b612be5819e7b6 (patch)
tree9b0eece8f29a3d482e99cad39db24338ad1cf449 /llvm/lib/Support/IntervalMap.cpp
parent6d89171dccba14b1791ce131043e5522e57a1fb4 (diff)
downloadbcm5719-llvm-09770251f6add86354667fc566b612be5819e7b6.tar.gz
bcm5719-llvm-09770251f6add86354667fc566b612be5819e7b6.zip
Revert "Add ADT/IntervalMap.", GCC doesn't like it.
This reverts r119772. llvm-svn: 119773
Diffstat (limited to 'llvm/lib/Support/IntervalMap.cpp')
-rw-r--r--llvm/lib/Support/IntervalMap.cpp60
1 files changed, 0 insertions, 60 deletions
diff --git a/llvm/lib/Support/IntervalMap.cpp b/llvm/lib/Support/IntervalMap.cpp
deleted file mode 100644
index 9f5c72fef1c..00000000000
--- a/llvm/lib/Support/IntervalMap.cpp
+++ /dev/null
@@ -1,60 +0,0 @@
-//===- lib/Support/IntervalMap.cpp - A sorted interval map ----------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the few non-templated functions in IntervalMap.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/ADT/IntervalMap.h"
-
-namespace llvm {
-namespace IntervalMapImpl {
-
-IdxPair distribute(unsigned Nodes, unsigned Elements, unsigned Capacity,
- const unsigned *CurSize, unsigned NewSize[],
- unsigned Position, bool Grow) {
- assert(Elements + Grow <= Nodes * Capacity && "Not enough room for elements");
- assert(Position <= Elements && "Invalid position");
- if (!Nodes)
- return IdxPair();
-
- // Trivial algorithm: left-leaning even distribution.
- const unsigned PerNode = (Elements + Grow) / Nodes;
- const unsigned Extra = (Elements + Grow) % Nodes;
- IdxPair PosPair = IdxPair(Nodes, 0);
- unsigned Sum = 0;
- for (unsigned n = 0; n != Nodes; ++n) {
- Sum += NewSize[n] = PerNode + (n < Extra);
- if (PosPair.first == Nodes && Sum > Position)
- PosPair = IdxPair(n, Position - (Sum - NewSize[n]));
- }
- assert(Sum == Elements + Grow && "Bad distribution sum");
-
- // Subtract the Grow element that was added.
- if (Grow) {
- assert(PosPair.first < Nodes && "Bad algebra");
- assert(NewSize[PosPair.first] && "Too few elements to need Grow");
- --NewSize[PosPair.first];
- }
-
-#ifndef NDEBUG
- Sum = 0;
- for (unsigned n = 0; n != Nodes; ++n) {
- assert(NewSize[n] <= Capacity && "Overallocated node");
- Sum += NewSize[n];
- }
- assert(Sum == Elements && "Bad distribution sum");
-#endif
-
- return PosPair;
-}
-
-} // namespace IntervalMapImpl
-} // namespace llvm
-
OpenPOWER on IntegriCloud