]> granicus.if.org Git - clang/commit
Refactor cast<>'s in if conditionals, which can only assert on failure.
authorDon Hinton <hintonda@gmail.com>
Tue, 19 Mar 2019 06:14:14 +0000 (06:14 +0000)
committerDon Hinton <hintonda@gmail.com>
Tue, 19 Mar 2019 06:14:14 +0000 (06:14 +0000)
commit64aa9a1dd1600e10da95a2a42d79e95ed0e53d7c
treef34d048cad38955036c28f9a25d7937468725746
parentdb1579bf88f1a45d81d3648745067afa4ac95956
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356441 91177308-0d34-0410-b5e6-96231b3b80d8
lib/AST/ASTImporter.cpp
lib/AST/DeclBase.cpp
lib/CodeGen/CGExprConstant.cpp
lib/CodeGen/MicrosoftCXXABI.cpp
lib/Sema/SemaOpenMP.cpp