[clang-rename] remove redundant *_cast<> traversal
authorKirill Bobyrev <omtcyfz@gmail.com>
Thu, 28 Jul 2016 10:31:16 +0000 (10:31 +0000)
committerKirill Bobyrev <omtcyfz@gmail.com>
Thu, 28 Jul 2016 10:31:16 +0000 (10:31 +0000)
llvm-svn: 276971

clang-tools-extra/clang-rename/USRLocFinder.cpp

index 834396d..5ab1558 100644 (file)
@@ -95,22 +95,6 @@ public:
     return true;
   }
 
-  bool VisitCXXStaticCastExpr(clang::CXXStaticCastExpr *Expr) {
-    return handleCXXNamedCastExpr(Expr);
-  }
-
-  bool VisitCXXDynamicCastExpr(clang::CXXDynamicCastExpr *Expr) {
-    return handleCXXNamedCastExpr(Expr);
-  }
-
-  bool VisitCXXReinterpretCastExpr(clang::CXXReinterpretCastExpr *Expr) {
-    return handleCXXNamedCastExpr(Expr);
-  }
-
-  bool VisitCXXConstCastExpr(clang::CXXConstCastExpr *Expr) {
-    return handleCXXNamedCastExpr(Expr);
-  }
-
   // Other visitors:
 
   bool VisitTypeLoc(const TypeLoc Loc) {
@@ -139,24 +123,6 @@ public:
     }
   }
 
-  bool handleCXXNamedCastExpr(clang::CXXNamedCastExpr *Expr) {
-    clang::QualType Type = Expr->getType();
-    // See if this a cast of a pointer.
-    const RecordDecl *Decl = Type->getPointeeCXXRecordDecl();
-    if (!Decl) {
-      // See if this is a cast of a reference.
-      Decl = Type->getAsCXXRecordDecl();
-    }
-
-    if (Decl && getUSRForDecl(Decl) == USR) {
-      SourceLocation Location =
-          Expr->getTypeInfoAsWritten()->getTypeLoc().getBeginLoc();
-      checkAndAddLocation(Location);
-    }
-
-    return true;
-  }
-
 private:
   void checkAndAddLocation(SourceLocation Loc) {
     const auto BeginLoc = Loc;