summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2019-07-03 10:26:28 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2019-07-03 10:26:28 +0000
commita372bb21c36fab73dcbc8a99aad7312d7684eb78 (patch)
tree0105376a491dbc0d8d2c3cee042316af9996a0c3
parent64e3a515344f0d29ac67ea8f21b7abeba5e82047 (diff)
downloadbcm5719-llvm-a372bb21c36fab73dcbc8a99aad7312d7684eb78.tar.gz
bcm5719-llvm-a372bb21c36fab73dcbc8a99aad7312d7684eb78.zip
Fix MSVC "signed/unsigned mismatch" warning. NFCI.
Fixes PR42426. llvm-svn: 365019
-rw-r--r--clang/lib/Basic/SourceManager.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp
index c57f1fd856a..c7588aa796f 100644
--- a/clang/lib/Basic/SourceManager.cpp
+++ b/clang/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<unsigned>::max()) {
+ if ((uint64_t)ContentsEntry->getSize() >=
+ std::numeric_limits<unsigned>::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
OpenPOWER on IntegriCloud