[llvm] 31efecf - Remove a top-level "using namespace" from TargetTransformInfoImpl.h

Pavel Labath via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 2 06:39:39 PST 2022


Author: Pavel Labath
Date: 2022-03-02T15:38:20+01:00
New Revision: 31efecfde988a55f70aea97fbc59681f28ef2652

URL: https://github.com/llvm/llvm-project/commit/31efecfde988a55f70aea97fbc59681f28ef2652
DIFF: https://github.com/llvm/llvm-project/commit/31efecfde988a55f70aea97fbc59681f28ef2652.diff

LOG: Remove a top-level "using namespace" from TargetTransformInfoImpl.h

Move it into the implementation of the function that needs it.

Avoids polluting the namespace of all files including the header.

Added: 
    

Modified: 
    llvm/include/llvm/Analysis/TargetTransformInfoImpl.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h b/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
index aebe61977bd71..45990266fb30e 100644
--- a/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
+++ b/llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
@@ -24,8 +24,6 @@
 #include "llvm/IR/PatternMatch.h"
 #include <utility>
 
-using namespace llvm::PatternMatch;
-
 namespace llvm {
 
 class Function;
@@ -960,6 +958,8 @@ class TargetTransformInfoImplCRTPBase : public TargetTransformInfoImplBase {
 
   InstructionCost getUserCost(const User *U, ArrayRef<const Value *> Operands,
                               TTI::TargetCostKind CostKind) {
+    using namespace llvm::PatternMatch;
+
     auto *TargetTTI = static_cast<T *>(this);
     // Handle non-intrinsic calls, invokes, and callbr.
     // FIXME: Unlikely to be true for anything but CodeSize.


        


More information about the llvm-commits mailing list