[llvm] 24e80d4 - [IndVars] Move "using namespace" to top-level scope (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 22 02:29:02 PST 2023


Author: Nikita Popov
Date: 2023-12-22T11:28:54+01:00
New Revision: 24e80d4cc5778fe4869badd34acbe1e7ded811d6

URL: https://github.com/llvm/llvm-project/commit/24e80d4cc5778fe4869badd34acbe1e7ded811d6
DIFF: https://github.com/llvm/llvm-project/commit/24e80d4cc5778fe4869badd34acbe1e7ded811d6.diff

LOG: [IndVars] Move "using namespace" to top-level scope (NFC)

Added: 
    

Modified: 
    llvm/lib/Transforms/Utils/SimplifyIndVar.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp b/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
index 722ed03db3de30..2f2fa3730c894a 100644
--- a/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
+++ b/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
@@ -27,6 +27,7 @@
 #include "llvm/Transforms/Utils/ScalarEvolutionExpander.h"
 
 using namespace llvm;
+using namespace llvm::PatternMatch;
 
 #define DEBUG_TYPE "indvars"
 
@@ -786,8 +787,6 @@ bool SimplifyIndvar::strengthenOverflowingOperation(BinaryOperator *BO,
 /// otherwise.
 bool SimplifyIndvar::strengthenRightShift(BinaryOperator *BO,
                                           Instruction *IVOperand) {
-  using namespace llvm::PatternMatch;
-
   if (BO->getOpcode() == Instruction::Shl) {
     bool Changed = false;
     ConstantRange IVRange = SE->getUnsignedRange(SE->getSCEV(IVOperand));
@@ -2011,8 +2010,6 @@ PHINode *WidenIV::createWideIV(SCEVExpander &Rewriter) {
 /// by looking at dominating conditions inside of the loop
 void WidenIV::calculatePostIncRange(Instruction *NarrowDef,
                                     Instruction *NarrowUser) {
-  using namespace llvm::PatternMatch;
-
   Value *NarrowDefLHS;
   const APInt *NarrowDefRHS;
   if (!match(NarrowDef, m_NSWAdd(m_Value(NarrowDefLHS),


        


More information about the llvm-commits mailing list