From ee915ad903e0d476c07d0398b42b2970a4dc4b19 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Wed, 3 Jul 2019 10:26:28 +0000 Subject: [PATCH] Fix MSVC "signed/unsigned mismatch" warning. NFCI. Fixes PR42426. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365019 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Basic/SourceManager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Basic/SourceManager.cpp b/lib/Basic/SourceManager.cpp index c57f1fd856..c7588aa796 100644 --- a/lib/Basic/SourceManager.cpp +++ b/lib/Basic/SourceManager.cpp @@ -113,7 +113,8 @@ const llvm::MemoryBuffer *ContentCache::getBuffer(DiagnosticsEngine &Diag, // Clang (including elsewhere in this file!) use 'unsigned' to represent file // offsets, line numbers, string literal lengths, and so on, and fail // miserably on large source files. - if (ContentsEntry->getSize() >= std::numeric_limits::max()) { + if ((uint64_t)ContentsEntry->getSize() >= + std::numeric_limits::max()) { // We can't make a memory buffer of the required size, so just make a small // one. We should never hit a situation where we've already parsed to a // later offset of the file, so it shouldn't matter that the buffer is -- 2.40.0