aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/SourceManager.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2014-03-06 21:42:43 +0000
committerTed Kremenek <kremenek@apple.com>2014-03-06 21:42:43 +0000
commit02548c08f85393fac483fa66565d07ef38da9b01 (patch)
tree4de95540bcb3a40af34bde77c2d1096c7f6805fa /clang/lib/Basic/SourceManager.cpp
parentbd48799c8de417633ae745cd3e9c5c7bf4df255a (diff)
downloadllvm-02548c08f85393fac483fa66565d07ef38da9b01.zip
llvm-02548c08f85393fac483fa66565d07ef38da9b01.tar.gz
llvm-02548c08f85393fac483fa66565d07ef38da9b01.tar.bz2
Remove dead code I introduced 6 years, 4 months ago in r43518.
Found by -Wunreachable-code. llvm-svn: 203167
Diffstat (limited to 'clang/lib/Basic/SourceManager.cpp')
-rw-r--r--clang/lib/Basic/SourceManager.cpp25
1 files changed, 0 insertions, 25 deletions
diff --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp
index bc42d3e..b78e9f59 100644
--- a/clang/lib/Basic/SourceManager.cpp
+++ b/clang/lib/Basic/SourceManager.cpp
@@ -1378,31 +1378,6 @@ unsigned SourceManager::getLineNumber(FileID FID, unsigned FilePos,
}
}
- // If the spread is large, do a "radix" test as our initial guess, based on
- // the assumption that lines average to approximately the same length.
- // NOTE: This is currently disabled, as it does not appear to be profitable in
- // initial measurements.
- if (0 && SourceLineCacheEnd-SourceLineCache > 20) {
- unsigned FileLen = Content->SourceLineCache[Content->NumLines-1];
-
- // Take a stab at guessing where it is.
- unsigned ApproxPos = Content->NumLines*QueriedFilePos / FileLen;
-
- // Check for -10 and +10 lines.
- unsigned LowerBound = std::max(int(ApproxPos-10), 0);
- unsigned UpperBound = std::min(ApproxPos+10, FileLen);
-
- // If the computed lower bound is less than the query location, move it in.
- if (SourceLineCache < SourceLineCacheStart+LowerBound &&
- SourceLineCacheStart[LowerBound] < QueriedFilePos)
- SourceLineCache = SourceLineCacheStart+LowerBound;
-
- // If the computed upper bound is greater than the query location, move it.
- if (SourceLineCacheEnd > SourceLineCacheStart+UpperBound &&
- SourceLineCacheStart[UpperBound] >= QueriedFilePos)
- SourceLineCacheEnd = SourceLineCacheStart+UpperBound;
- }
-
unsigned *Pos
= std::lower_bound(SourceLineCache, SourceLineCacheEnd, QueriedFilePos);
unsigned LineNo = Pos-SourceLineCacheStart;