[clang-tools-extra] r276971 - [clang-rename] remove redundant *_cast<> traversal
Kirill Bobyrev via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 28 03:31:16 PDT 2016
Author: omtcyfz
Date: Thu Jul 28 05:31:16 2016
New Revision: 276971
URL: http://llvm.org/viewvc/llvm-project?rev=276971&view=rev
Log:
[clang-rename] remove redundant *_cast<> traversal
Modified:
clang-tools-extra/trunk/clang-rename/USRLocFinder.cpp
Modified: clang-tools-extra/trunk/clang-rename/USRLocFinder.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-rename/USRLocFinder.cpp?rev=276971&r1=276970&r2=276971&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-rename/USRLocFinder.cpp (original)
+++ clang-tools-extra/trunk/clang-rename/USRLocFinder.cpp Thu Jul 28 05:31:16 2016
@@ -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;
More information about the cfe-commits
mailing list