r203167 - Remove dead code I introduced 6 years, 4 months ago in r43518.

Ted Kremenek kremenek at apple.com
Thu Mar 6 14:14:11 PST 2014


Argyrios corrected me that I read “blame" wrong.  The real culprit was r40460, ;-)

On Mar 6, 2014, at 1:42 PM, Ted Kremenek <kremenek at apple.com> wrote:

> Author: kremenek
> Date: Thu Mar  6 15:42:43 2014
> New Revision: 203167
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=203167&view=rev
> Log:
> Remove dead code I introduced 6 years, 4 months ago in r43518.
> 
> Found by -Wunreachable-code.
> 
> Modified:
>    cfe/trunk/lib/Basic/SourceManager.cpp
> 
> Modified: cfe/trunk/lib/Basic/SourceManager.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/SourceManager.cpp?rev=203167&r1=203166&r2=203167&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Basic/SourceManager.cpp (original)
> +++ cfe/trunk/lib/Basic/SourceManager.cpp Thu Mar  6 15:42:43 2014
> @@ -1378,31 +1378,6 @@ unsigned SourceManager::getLineNumber(Fi
>     }
>   }
> 
> -  // 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;
> 
> 
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits





More information about the cfe-commits mailing list