Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 27, 2023

Conversation

dpaoliello
Copy link
Contributor

@dpaoliello dpaoliello commented Sep 27, 2023

#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.

@llvmbot
Copy link
Member

llvmbot commented Sep 27, 2023

@llvm/pr-subscribers-debuginfo

Changes

#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.


Full diff: https://github.com/llvm/llvm-project/pull/67607.diff

1 Files Affected:

  • (modified) llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp (+3-3)
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());

@dpaoliello dpaoliello merged commit 9aa378d into llvm:main Sep 27, 2023
@dpaoliello dpaoliello deleted the fixinlinees branch September 27, 2023 21:46
legrosbuffle pushed a commit to legrosbuffle/llvm-project that referenced this pull request Sep 29, 2023
…bol (llvm#67607)

llvm#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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants