From: Raphael Isemann Date: Wed, 22 Aug 2018 22:49:32 +0000 (+0000) Subject: [ASTImporter] Remove duplicated and dead CXXNamedCastExpr handling code. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=342aa6e5c237453f78740ac311162e50898347dc;p=clang [ASTImporter] Remove duplicated and dead CXXNamedCastExpr handling code. Summary: `CXXNamedCastExpr` importing is already handled in the respective `VisitCXXNamedCastExpr` method. So this code here can never be reached under normal circumstances and we might as well remove it. This patch shouldn't change any observable behavior of the ASTImporter. Reviewers: a.sidorin, a_sidorin Reviewed By: a_sidorin Subscribers: martong, cfe-commits Differential Revision: https://reviews.llvm.org/D51110 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340466 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/ASTImporter.cpp b/lib/AST/ASTImporter.cpp index c454191400..d39b985f28 100644 --- a/lib/AST/ASTImporter.cpp +++ b/lib/AST/ASTImporter.cpp @@ -6087,38 +6087,6 @@ Expr *ASTNodeImporter::VisitExplicitCastExpr(ExplicitCastExpr *E) { E->getCastKind(), Importer.Import(OCE->getBridgeKeywordLoc()), TInfo, SubExpr); } - default: - break; // just fall through - } - - auto *Named = cast(E); - SourceLocation ExprLoc = Importer.Import(Named->getOperatorLoc()), - RParenLoc = Importer.Import(Named->getRParenLoc()); - SourceRange Brackets = Importer.Import(Named->getAngleBrackets()); - - switch (E->getStmtClass()) { - case Stmt::CXXStaticCastExprClass: - return CXXStaticCastExpr::Create(Importer.getToContext(), T, - E->getValueKind(), E->getCastKind(), - SubExpr, &BasePath, TInfo, - ExprLoc, RParenLoc, Brackets); - - case Stmt::CXXDynamicCastExprClass: - return CXXDynamicCastExpr::Create(Importer.getToContext(), T, - E->getValueKind(), E->getCastKind(), - SubExpr, &BasePath, TInfo, - ExprLoc, RParenLoc, Brackets); - - case Stmt::CXXReinterpretCastExprClass: - return CXXReinterpretCastExpr::Create(Importer.getToContext(), T, - E->getValueKind(), E->getCastKind(), - SubExpr, &BasePath, TInfo, - ExprLoc, RParenLoc, Brackets); - - case Stmt::CXXConstCastExprClass: - return CXXConstCastExpr::Create(Importer.getToContext(), T, - E->getValueKind(), SubExpr, TInfo, ExprLoc, - RParenLoc, Brackets); default: llvm_unreachable("Cast expression of unsupported type!"); return nullptr;