]> granicus.if.org Git - clang/commit
Remove redundant casts. NFC
authorGeorge Burgess IV <george.burgess.iv@gmail.com>
Thu, 1 Mar 2018 05:43:23 +0000 (05:43 +0000)
committerGeorge Burgess IV <george.burgess.iv@gmail.com>
Thu, 1 Mar 2018 05:43:23 +0000 (05:43 +0000)
commitf6b7996bf623151fc1a9dfbcf659a609b178692f
tree3ed944a154c12478b2d7c6ffd929afff1ba56534
parentb7f026ae77d2cb0cd10834b61aac0037cfcff2bd
Remove redundant casts. NFC

So I wrote a clang-tidy check to lint out redundant `isa`, `cast`, and
`dyn_cast`s for fun. This is a portion of what it found for clang; I
plan to do similar cleanups in LLVM and other subprojects when I find
time.

Because of the volume of changes, I explicitly avoided making any change
that wasn't highly local and obviously correct to me (e.g. we still have
a number of foo(cast<Bar>(baz)) that I didn't touch, since overloading
is a thing and the cast<Bar> did actually change the type -- just up the
class hierarchy).

I also tried to leave the types we were cast<>ing to somewhere nearby,
in cases where it wasn't locally obvious what we were dealing with
before.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@326416 91177308-0d34-0410-b5e6-96231b3b80d8
51 files changed:
include/clang/AST/DeclCXX.h
include/clang/AST/Expr.h
include/clang/AST/ExprObjC.h
lib/AST/ASTContext.cpp
lib/AST/CXXInheritance.cpp
lib/AST/Decl.cpp
lib/AST/DeclCXX.cpp
lib/AST/DeclPrinter.cpp
lib/AST/Expr.cpp
lib/AST/ExprConstant.cpp
lib/AST/ItaniumMangle.cpp
lib/AST/MicrosoftCXXABI.cpp
lib/AST/MicrosoftMangle.cpp
lib/AST/RecordLayoutBuilder.cpp
lib/AST/TemplateBase.cpp
lib/AST/Type.cpp
lib/CodeGen/CGCoroutine.cpp
lib/CodeGen/CGDebugInfo.cpp
lib/CodeGen/CGObjCGNU.cpp
lib/CodeGen/CGOpenMPRuntime.cpp
lib/CodeGen/CGRecordLayoutBuilder.cpp
lib/CodeGen/CGStmtOpenMP.cpp
lib/CodeGen/CodeGenFunction.cpp
lib/CodeGen/CodeGenModule.cpp
lib/CodeGen/CodeGenTypes.cpp
lib/CodeGen/ItaniumCXXABI.cpp
lib/CodeGen/MicrosoftCXXABI.cpp
lib/Frontend/ASTUnit.cpp
lib/Frontend/Rewrite/RewriteModernObjC.cpp
lib/Frontend/Rewrite/RewriteObjC.cpp
lib/Sema/SemaChecking.cpp
lib/Sema/SemaCodeComplete.cpp
lib/Sema/SemaDecl.cpp
lib/Sema/SemaDeclAttr.cpp
lib/Sema/SemaDeclCXX.cpp
lib/Sema/SemaDeclObjC.cpp
lib/Sema/SemaExceptionSpec.cpp
lib/Sema/SemaExprCXX.cpp
lib/Sema/SemaObjCProperty.cpp
lib/Sema/SemaOpenMP.cpp
lib/Sema/SemaTemplate.cpp
lib/Sema/SemaTemplateInstantiate.cpp
lib/Sema/SemaTemplateInstantiateDecl.cpp
lib/Sema/SemaType.cpp
lib/Serialization/ASTReaderDecl.cpp
lib/StaticAnalyzer/Checkers/CastToStructChecker.cpp
lib/StaticAnalyzer/Checkers/IvarInvalidationChecker.cpp
lib/StaticAnalyzer/Core/CallEvent.cpp
lib/StaticAnalyzer/Core/MemRegion.cpp
lib/StaticAnalyzer/Core/ProgramState.cpp
lib/StaticAnalyzer/Core/RegionStore.cpp