Don't assume size_t is unsigned long long.

Fixes a -Woverflow warning from gcc when building for 32-bit platforms.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156313 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Matt Beaumont-Gay 2012-05-07 18:12:42 +00:00
parent ed57984483
commit d58518a8b6

View File

@ -121,7 +121,7 @@ SourceMgr::getLineAndColumn(SMLoc Loc, int BufferID) const {
Cache.LineNoOfQuery = LineNo; Cache.LineNoOfQuery = LineNo;
size_t NewlineOffs = StringRef(BufStart, Ptr-BufStart).find_last_of("\n\r"); size_t NewlineOffs = StringRef(BufStart, Ptr-BufStart).find_last_of("\n\r");
if (NewlineOffs == StringRef::npos) NewlineOffs = ~0ULL; if (NewlineOffs == StringRef::npos) NewlineOffs = ~(size_t)0;
return std::make_pair(LineNo, Ptr-BufStart-NewlineOffs); return std::make_pair(LineNo, Ptr-BufStart-NewlineOffs);
} }
@ -358,5 +358,3 @@ void SMDiagnostic::print(const char *ProgName, raw_ostream &S,
S << '\n'; S << '\n';
} }