Skip to content

Commit 56e944b

Browse files
authored
[NFC] add anonymous namespace to a couple classes (#121511)
This ensures these classes are visible only to the appropriate translation unit and allows for more optimizations.
1 parent e4372c4 commit 56e944b

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

llvm/lib/IR/SafepointIRVerifier.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ static void PrintValueSet(raw_ostream &OS, IteratorTy Begin, IteratorTy End) {
289289

290290
using AvailableValueSet = DenseSet<const Value *>;
291291

292+
namespace {
292293
/// State we compute and track per basic block.
293294
struct BasicBlockState {
294295
// Set of values available coming in, before the phi nodes
@@ -305,6 +306,7 @@ struct BasicBlockState {
305306
// contribute to AvailableOut.
306307
bool Cleared = false;
307308
};
309+
} // namespace
308310

309311
/// A given derived pointer can have multiple base pointers through phi/selects.
310312
/// This type indicates when the base pointer is exclusively constant

llvm/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ static bool foldGuardedFunnelShift(Instruction &I, const DominatorTree &DT) {
181181
/// the bit indexes (Mask) needed by a masked compare. If we're matching a chain
182182
/// of 'and' ops, then we also need to capture the fact that we saw an
183183
/// "and X, 1", so that's an extra return value for that case.
184+
namespace {
184185
struct MaskOps {
185186
Value *Root = nullptr;
186187
APInt Mask;
@@ -190,6 +191,7 @@ struct MaskOps {
190191
MaskOps(unsigned BitWidth, bool MatchAnds)
191192
: Mask(APInt::getZero(BitWidth)), MatchAndChain(MatchAnds) {}
192193
};
194+
} // namespace
193195

194196
/// This is a recursive helper for foldAnyOrAllBitsSet() that walks through a
195197
/// chain of 'and' or 'or' instructions looking for shift ops of a common source

0 commit comments

Comments
 (0)