diff options
author | Matt Beaumont-Gay <matthewbg@google.com> | 2012-05-07 18:12:42 +0000 |
---|---|---|
committer | Matt Beaumont-Gay <matthewbg@google.com> | 2012-05-07 18:12:42 +0000 |
commit | d58518a8b60962988c0b27803fc8e89916a5d80f (patch) | |
tree | f31d43c258d76cb55d43e8eafc3def856ccbc150 /lib/Support | |
parent | ed57984483b9268c30c71031fca07e71b985f169 (diff) |
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
Diffstat (limited to 'lib/Support')
-rw-r--r-- | lib/Support/SourceMgr.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/Support/SourceMgr.cpp b/lib/Support/SourceMgr.cpp index 5fa987bc3d..37a9d8f827 100644 --- a/lib/Support/SourceMgr.cpp +++ b/lib/Support/SourceMgr.cpp @@ -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'; } - - |