From: Sanjoy Das Date: Tue, 27 Sep 2016 18:01:44 +0000 (+0000) Subject: [SCEV] Reduce the scope of a struct; NFC X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4ecb8cd59fd32b0146e965915fa87e5b563d754b;p=llvm [SCEV] Reduce the scope of a struct; NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282513 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp index 401e736396d..2b70cae895e 100644 --- a/lib/Analysis/ScalarEvolution.cpp +++ b/lib/Analysis/ScalarEvolution.cpp @@ -3343,31 +3343,29 @@ bool ScalarEvolution::checkValidity(const SCEV *S) const { return !F.FindOne; } -namespace { -// Helper class working with SCEVTraversal to figure out if a SCEV contains -// a sub SCEV of scAddRecExpr type. FindInvalidSCEVUnknown::FoundOne is set -// iff if such sub scAddRecExpr type SCEV is found. -struct FindAddRecurrence { - bool FoundOne; - FindAddRecurrence() : FoundOne(false) {} +bool ScalarEvolution::containsAddRecurrence(const SCEV *S) { + // Helper class working with SCEVTraversal to figure out if a SCEV contains a + // sub SCEV of scAddRecExpr type. FindInvalidSCEVUnknown::FoundOne is set iff + // if such sub scAddRecExpr type SCEV is found. + struct FindAddRecurrence { + bool FoundOne; + FindAddRecurrence() : FoundOne(false) {} - bool follow(const SCEV *S) { - switch (static_cast(S->getSCEVType())) { - case scAddRecExpr: - FoundOne = true; - case scConstant: - case scUnknown: - case scCouldNotCompute: - return false; - default: - return true; + bool follow(const SCEV *S) { + switch (static_cast(S->getSCEVType())) { + case scAddRecExpr: + FoundOne = true; + case scConstant: + case scUnknown: + case scCouldNotCompute: + return false; + default: + return true; + } } - } - bool isDone() const { return FoundOne; } -}; -} + bool isDone() const { return FoundOne; } + }; -bool ScalarEvolution::containsAddRecurrence(const SCEV *S) { HasRecMapType::iterator I = HasRecMap.find_as(S); if (I != HasRecMap.end()) return I->second;