Skip to content

Conversation

@pedroclobo
Copy link
Member

Fill default values of a map with poison instead of undef. There should be no functional difference as the default values are overridden later.

Fill default values of a map with `poison` instead of `undef`.
There should be no functional difference as the default values are
overridden later.
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:codegen IR generation bugs: mangling, exceptions, etc. labels Apr 7, 2025
@llvmbot
Copy link
Member

llvmbot commented Apr 7, 2025

@llvm/pr-subscribers-clang-codegen

Author: Pedro Lobo (pedroclobo)

Changes

Fill default values of a map with poison instead of undef. There should be no functional difference as the default values are overridden later.


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

1 Files Affected:

  • (modified) clang/lib/CodeGen/MicrosoftCXXABI.cpp (+1-1)
diff --git a/clang/lib/CodeGen/MicrosoftCXXABI.cpp b/clang/lib/CodeGen/MicrosoftCXXABI.cpp
index ba5f74f153d59..7bef436302526 100644
--- a/clang/lib/CodeGen/MicrosoftCXXABI.cpp
+++ b/clang/lib/CodeGen/MicrosoftCXXABI.cpp
@@ -370,7 +370,7 @@ class MicrosoftCXXABI : public CGCXXABI {
     MicrosoftVTableContext &VTContext = CGM.getMicrosoftVTableContext();
     unsigned NumEntries = 1 + SrcRD->getNumVBases();
     SmallVector<llvm::Constant *, 4> Map(NumEntries,
-                                         llvm::UndefValue::get(CGM.IntTy));
+                                         llvm::PoisonValue::get(CGM.IntTy));
     Map[0] = llvm::ConstantInt::get(CGM.IntTy, 0);
     bool AnyDifferent = false;
     for (const auto &I : SrcRD->vbases()) {

@llvmbot
Copy link
Member

llvmbot commented Apr 7, 2025

@llvm/pr-subscribers-clang

Author: Pedro Lobo (pedroclobo)

Changes

Fill default values of a map with poison instead of undef. There should be no functional difference as the default values are overridden later.


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

1 Files Affected:

  • (modified) clang/lib/CodeGen/MicrosoftCXXABI.cpp (+1-1)
diff --git a/clang/lib/CodeGen/MicrosoftCXXABI.cpp b/clang/lib/CodeGen/MicrosoftCXXABI.cpp
index ba5f74f153d59..7bef436302526 100644
--- a/clang/lib/CodeGen/MicrosoftCXXABI.cpp
+++ b/clang/lib/CodeGen/MicrosoftCXXABI.cpp
@@ -370,7 +370,7 @@ class MicrosoftCXXABI : public CGCXXABI {
     MicrosoftVTableContext &VTContext = CGM.getMicrosoftVTableContext();
     unsigned NumEntries = 1 + SrcRD->getNumVBases();
     SmallVector<llvm::Constant *, 4> Map(NumEntries,
-                                         llvm::UndefValue::get(CGM.IntTy));
+                                         llvm::PoisonValue::get(CGM.IntTy));
     Map[0] = llvm::ConstantInt::get(CGM.IntTy, 0);
     bool AnyDifferent = false;
     for (const auto &I : SrcRD->vbases()) {

Copy link
Collaborator

@efriedma-quic efriedma-quic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pedroclobo pedroclobo merged commit bb50061 into llvm:main Apr 8, 2025
14 checks passed
@pedroclobo pedroclobo deleted the ms-poison branch April 8, 2025 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang:codegen IR generation bugs: mangling, exceptions, etc. clang Clang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants