[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

llvm-svn: 340466
This commit is contained in:
Raphael Isemann 2018-08-22 22:49:32 +00:00
parent ee4cd22678
commit ff862be4ef
1 changed files with 0 additions and 32 deletions

View File

@ -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<CXXNamedCastExpr>(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;