Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions llvm/lib/Analysis/ScalarEvolution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13990,7 +13990,15 @@ static void PrintLoopInfo(raw_ostream &OS, ScalarEvolution *SE,
}

namespace llvm {
raw_ostream &operator<<(raw_ostream &OS, ScalarEvolution::LoopDisposition LD) {
// Note: these overloaded operators need to be in the llvm namespace for them
// to be resolved correctly. If we put them outside the llvm namespace, the
//
// OS << ": " << SE.getLoopDisposition(SV, InnerL);
//
// code below "breaks" and start printing raw enum values as opposed to the
// string values.
static raw_ostream &operator<<(raw_ostream &OS,
ScalarEvolution::LoopDisposition LD) {
switch (LD) {
case ScalarEvolution::LoopVariant:
OS << "Variant";
Expand All @@ -14005,7 +14013,8 @@ raw_ostream &operator<<(raw_ostream &OS, ScalarEvolution::LoopDisposition LD) {
return OS;
}

raw_ostream &operator<<(raw_ostream &OS, ScalarEvolution::BlockDisposition BD) {
static raw_ostream &operator<<(raw_ostream &OS,
llvm::ScalarEvolution::BlockDisposition BD) {
switch (BD) {
case ScalarEvolution::DoesNotDominateBlock:
OS << "DoesNotDominate";
Expand Down
4 changes: 0 additions & 4 deletions llvm/lib/Analysis/ScalarEvolutionDivision.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ class Type;

using namespace llvm;

namespace {

static inline int sizeOfSCEV(const SCEV *S) {
struct FindSCEVSize {
int Size = 0;
Expand All @@ -52,8 +50,6 @@ static inline int sizeOfSCEV(const SCEV *S) {
return F.Size;
}

} // namespace

// Computes the Quotient and Remainder of the division of Numerator by
// Denominator.
void SCEVDivision::divide(ScalarEvolution &SE, const SCEV *Numerator,
Expand Down