diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-11-19 01:21:03 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-11-19 01:21:03 +0000 |
commit | 737d2816c42c1f9a63524e39ccfa7560777b6b42 (patch) | |
tree | fe55619b9715c5e68b78b3a797c2e15b51daea3a /lib/Support | |
parent | 8408edffcbd7f436c05018fafbfb9911146b208a (diff) | |
download | external_llvm-737d2816c42c1f9a63524e39ccfa7560777b6b42.zip external_llvm-737d2816c42c1f9a63524e39ccfa7560777b6b42.tar.gz external_llvm-737d2816c42c1f9a63524e39ccfa7560777b6b42.tar.bz2 |
Revert "Add ADT/IntervalMap.", GCC doesn't like it.
This reverts r119772.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119773 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support')
-rw-r--r-- | lib/Support/CMakeLists.txt | 1 | ||||
-rw-r--r-- | lib/Support/IntervalMap.cpp | 60 |
2 files changed, 0 insertions, 61 deletions
diff --git a/lib/Support/CMakeLists.txt b/lib/Support/CMakeLists.txt index 8a6ed6f..c9c862c 100644 --- a/lib/Support/CMakeLists.txt +++ b/lib/Support/CMakeLists.txt @@ -19,7 +19,6 @@ add_llvm_library(LLVMSupport FoldingSet.cpp FormattedStream.cpp GraphWriter.cpp - IntervalMap.cpp IsInf.cpp IsNAN.cpp ManagedStatic.cpp diff --git a/lib/Support/IntervalMap.cpp b/lib/Support/IntervalMap.cpp deleted file mode 100644 index 9f5c72f..0000000 --- a/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 - |