Skip to content

Commit 941a0de

Browse files
committed
[NFC][LLVM] Namespace cleanup in ScalarEvolution
1 parent 4f428d3 commit 941a0de

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

llvm/lib/Analysis/ScalarEvolution.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13990,7 +13990,15 @@ static void PrintLoopInfo(raw_ostream &OS, ScalarEvolution *SE,
1399013990
}
1399113991

1399213992
namespace llvm {
13993-
raw_ostream &operator<<(raw_ostream &OS, ScalarEvolution::LoopDisposition LD) {
13993+
// Note: these overloaded operators need to be in the llvm namespace for them
13994+
// to be resolved correctly. If we put them outside the llvm namespace, the
13995+
//
13996+
// OS << ": " << SE.getLoopDisposition(SV, InnerL);
13997+
//
13998+
// code below "breaks" and start printing raw enum values as opposed to the
13999+
// string values.
14000+
static raw_ostream &operator<<(raw_ostream &OS,
14001+
ScalarEvolution::LoopDisposition LD) {
1399414002
switch (LD) {
1399514003
case ScalarEvolution::LoopVariant:
1399614004
OS << "Variant";
@@ -14005,7 +14013,8 @@ raw_ostream &operator<<(raw_ostream &OS, ScalarEvolution::LoopDisposition LD) {
1400514013
return OS;
1400614014
}
1400714015

14008-
raw_ostream &operator<<(raw_ostream &OS, ScalarEvolution::BlockDisposition BD) {
14016+
static raw_ostream &operator<<(raw_ostream &OS,
14017+
llvm::ScalarEvolution::BlockDisposition BD) {
1400914018
switch (BD) {
1401014019
case ScalarEvolution::DoesNotDominateBlock:
1401114020
OS << "DoesNotDominate";

llvm/lib/Analysis/ScalarEvolutionDivision.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ class Type;
2929

3030
using namespace llvm;
3131

32-
namespace {
33-
3432
static inline int sizeOfSCEV(const SCEV *S) {
3533
struct FindSCEVSize {
3634
int Size = 0;
@@ -52,8 +50,6 @@ static inline int sizeOfSCEV(const SCEV *S) {
5250
return F.Size;
5351
}
5452

55-
} // namespace
56-
5753
// Computes the Quotient and Remainder of the division of Numerator by
5854
// Denominator.
5955
void SCEVDivision::divide(ScalarEvolution &SE, const SCEV *Numerator,

0 commit comments

Comments
 (0)