[PATCH] D89612: NFC: Fix -Wsign-compare warnings on 32-bit builds

Hubert Tong via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 20 17:52:30 PDT 2020


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG134ffa8138c3: NFC: Fix -Wsign-compare warnings on 32-bit builds (authored by hubert.reinterpretcast).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89612/new/

https://reviews.llvm.org/D89612

Files:
  clang/lib/Serialization/ASTReaderStmt.cpp
  llvm/lib/CodeGen/StackMaps.cpp


Index: llvm/lib/CodeGen/StackMaps.cpp
===================================================================
--- llvm/lib/CodeGen/StackMaps.cpp
+++ llvm/lib/CodeGen/StackMaps.cpp
@@ -401,7 +401,7 @@
     SmallVector<unsigned, 8> GCPtrIndices;
     unsigned GCPtrIdx = (unsigned)SO.getFirstGCPtrIdx();
     assert((int)GCPtrIdx != -1);
-    assert(MOI - MI.operands_begin() == GCPtrIdx);
+    assert(MOI - MI.operands_begin() == GCPtrIdx + 0LL);
     while (NumGCPointers--) {
       GCPtrIndices.push_back(GCPtrIdx);
       GCPtrIdx = StackMaps::getNextMetaArgIdx(&MI, GCPtrIdx);
Index: clang/lib/Serialization/ASTReaderStmt.cpp
===================================================================
--- clang/lib/Serialization/ASTReaderStmt.cpp
+++ clang/lib/Serialization/ASTReaderStmt.cpp
@@ -2186,9 +2186,9 @@
   unsigned NumArgs = Record.readInt();
   E->BeginLoc = readSourceLocation();
   E->EndLoc = readSourceLocation();
-  assert(
-      (NumArgs == std::distance(E->children().begin(), E->children().end())) &&
-      "Wrong NumArgs!");
+  assert((NumArgs + 0LL ==
+          std::distance(E->children().begin(), E->children().end())) &&
+         "Wrong NumArgs!");
   (void)NumArgs;
   for (Stmt *&Child : E->children())
     Child = Record.readSubStmt();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89612.299528.patch
Type: text/x-patch
Size: 1263 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201021/dff2bb9a/attachment.bin>


More information about the cfe-commits mailing list