From f170dff3c198290eda05272f7d4beb6f93b80168 Mon Sep 17 00:00:00 2001 From: Don Hinton Date: Tue, 19 Mar 2019 06:14:14 +0000 Subject: Refactor cast<>'s in if conditionals, which can only assert on failure. Summary: This patch refactors several instances of cast<> used in if conditionals. Since cast<> asserts on failure, the else branch can never be taken. In some cases, the fix is to replace cast<> with dyn_cast<>. While others required the removal of the conditional and some minor refactoring. A discussion can be seen here: http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20190318/265044.html Differential Revision: https://reviews.llvm.org/D59529 llvm-svn: 356441 --- clang/lib/CodeGen/MicrosoftCXXABI.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/CodeGen/MicrosoftCXXABI.cpp') diff --git a/clang/lib/CodeGen/MicrosoftCXXABI.cpp b/clang/lib/CodeGen/MicrosoftCXXABI.cpp index cf6d0cf4483..7a5cdf6865f 100644 --- a/clang/lib/CodeGen/MicrosoftCXXABI.cpp +++ b/clang/lib/CodeGen/MicrosoftCXXABI.cpp @@ -735,7 +735,7 @@ public: CGM.CreateRuntimeFunction(FTy, "_CxxThrowException"); // _CxxThrowException is stdcall on 32-bit x86 platforms. if (CGM.getTarget().getTriple().getArch() == llvm::Triple::x86) { - if (auto *Fn = cast(Throw.getCallee())) + if (auto *Fn = dyn_cast(Throw.getCallee())) Fn->setCallingConv(llvm::CallingConv::X86_StdCall); } return Throw; -- cgit v1.2.3