mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 11:13:28 +01:00
Don't assume size_t is unsigned long long.
Fixes a -Woverflow warning from gcc when building for 32-bit platforms. llvm-svn: 156313
This commit is contained in:
parent
6fde9f74b4
commit
ee7706f1a3
@ -121,7 +121,7 @@ SourceMgr::getLineAndColumn(SMLoc Loc, int BufferID) const {
|
||||
Cache.LineNoOfQuery = LineNo;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
@ -358,5 +358,3 @@ void SMDiagnostic::print(const char *ProgName, raw_ostream &S,
|
||||
|
||||
S << '\n';
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user