[llvm] 9aa378d - [llvm] Fix 32bit build after change to implement S_INLINEES debug symbol (#67607)

via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 27 14:46:50 PDT 2023


Author: Daniel Paoliello
Date: 2023-09-27T14:46:45-07:00
New Revision: 9aa378d89ef0027b72f37c1e8fb4998d891e34e6

URL: https://github.com/llvm/llvm-project/commit/9aa378d89ef0027b72f37c1e8fb4998d891e34e6
DIFF: https://github.com/llvm/llvm-project/commit/9aa378d89ef0027b72f37c1e8fb4998d891e34e6.diff

LOG: [llvm] Fix 32bit build after change to implement S_INLINEES debug symbol (#67607)

https://github.com/llvm/llvm-project/pull/67490 broke 32bit builds by
having mismatched types in a call to `std::min"

This change standardizes on using `size_t` to avoid the mismatch.

Added: 
    

Modified: 
    llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
index 335eccb106519ca..4ff056042c6f95e 100644
--- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
@@ -3597,14 +3597,14 @@ void CodeViewDebug::emitInlinees(
     const SmallSet<codeview::TypeIndex, 1> &Inlinees) {
   // Divide the list of inlinees into chunks such that each chunk fits within
   // one record.
-  constexpr auto ChunkSize =
+  constexpr size_t ChunkSize =
       (MaxRecordLength - sizeof(SymbolKind) - sizeof(uint32_t)) /
       sizeof(uint32_t);
 
   SmallVector<TypeIndex> SortedInlinees{Inlinees.begin(), Inlinees.end()};
   llvm::sort(SortedInlinees);
 
-  uint64_t CurrentIndex = 0;
+  size_t CurrentIndex = 0;
   while (CurrentIndex < SortedInlinees.size()) {
     auto Symbol = beginSymbolRecord(SymbolKind::S_INLINEES);
     auto CurrentChunkSize =
@@ -3612,7 +3612,7 @@ void CodeViewDebug::emitInlinees(
     OS.AddComment("Count");
     OS.emitInt32(CurrentChunkSize);
 
-    const uint64_t CurrentChunkEnd = CurrentIndex + CurrentChunkSize;
+    const size_t CurrentChunkEnd = CurrentIndex + CurrentChunkSize;
     for (; CurrentIndex < CurrentChunkEnd; ++CurrentIndex) {
       OS.AddComment("Inlinee");
       OS.emitInt32(SortedInlinees[CurrentIndex].getIndex());


        


More information about the llvm-commits mailing list