Skip to content

Commit 51b24dc

Browse files
committed
!fixup move to Metadata::PoisonGeneratingIDs.
1 parent 499d853 commit 51b24dc

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

llvm/include/llvm/IR/Instruction.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -503,10 +503,6 @@ class Instruction : public User,
503503
/// Determine whether the the nneg flag is set.
504504
bool hasNonNeg() const LLVM_READONLY;
505505

506-
/// Metadata IDs that may generate poison.
507-
constexpr static const unsigned PoisonGeneratingMetadataIDs[] = {
508-
LLVMContext::MD_range, LLVMContext::MD_nonnull, LLVMContext::MD_align};
509-
510506
/// Return true if this operator has flags which may cause this instruction
511507
/// to evaluate to poison despite having non-poison inputs.
512508
bool hasPoisonGeneratingFlags() const LLVM_READONLY;

llvm/include/llvm/IR/Metadata.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@ class Metadata {
138138
void printAsOperand(raw_ostream &OS, ModuleSlotTracker &MST,
139139
const Module *M = nullptr) const;
140140
/// @}
141+
142+
/// Metadata IDs that may generate poison.
143+
constexpr static const unsigned PoisonGeneratingIDs[] = {
144+
LLVMContext::MD_range, LLVMContext::MD_nonnull, LLVMContext::MD_align};
141145
};
142146

143147
// Create wrappers for C Binding types (see CBindingWrapping.h).

llvm/lib/IR/Instruction.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ void Instruction::dropPoisonGeneratingFlags() {
458458
}
459459

460460
bool Instruction::hasPoisonGeneratingMetadata() const {
461-
return any_of(PoisonGeneratingMetadataIDs,
461+
return any_of(Metadata::PoisonGeneratingIDs,
462462
[this](unsigned ID) { return hasMetadata(ID); });
463463
}
464464

@@ -486,7 +486,7 @@ bool Instruction::hasNonDebugLocLoopMetadata() const {
486486
}
487487

488488
void Instruction::dropPoisonGeneratingMetadata() {
489-
for (unsigned ID : PoisonGeneratingMetadataIDs)
489+
for (unsigned ID : Metadata::PoisonGeneratingIDs)
490490
eraseMetadata(ID);
491491
}
492492

0 commit comments

Comments
 (0)