diff options
author | J.Ru <juanruben.segovia@gmail.com> | 2018-07-20 10:03:21 +0200 |
---|---|---|
committer | J.Ru <juanruben.segovia@gmail.com> | 2018-08-11 16:39:58 +0200 |
commit | 2a2d15cf8aae73746cd9644d0be55e7a6716fb32 (patch) | |
tree | d28eb92b3923b4083512382c8c43b4045fb97c2f | |
parent | 29291f385bcf9b735fef3d559d9d03f7d4616675 (diff) |
Replace remaining dyn_cast_or_null with DynCastFrom
-rw-r--r-- | iwyu.cc | 4 | ||||
-rw-r--r-- | iwyu_ast_util.cc | 3 |
2 files changed, 2 insertions, 5 deletions
@@ -216,7 +216,6 @@ using clang::ValueDecl; using clang::VarDecl; using llvm::cast; using llvm::dyn_cast; -using llvm::dyn_cast_or_null; using llvm::errs; using llvm::isa; using std::make_pair; @@ -2490,8 +2489,7 @@ class IwyuBaseAstVisitor : public BaseAstVisitor<Derived> { if (CanIgnoreCurrentASTNode()) return true; // ... only if this NewExpr involves a constructor call. const Expr* initializer = expr->getInitializer(); - if (const CXXConstructExpr* cce = - dyn_cast_or_null<CXXConstructExpr>(initializer)) { + if (const CXXConstructExpr* cce = DynCastFrom(initializer)) { ReportIfReferenceVararg(cce->getArgs(), cce->getNumArgs(), cce->getConstructor()); diff --git a/iwyu_ast_util.cc b/iwyu_ast_util.cc index 4fe2dd0..e22b2c7 100644 --- a/iwyu_ast_util.cc +++ b/iwyu_ast_util.cc @@ -120,7 +120,6 @@ using llvm::ArrayRef; using llvm::PointerUnion; using llvm::cast; using llvm::dyn_cast; -using llvm::dyn_cast_or_null; using llvm::errs; using llvm::isa; using llvm::raw_string_ostream; @@ -618,7 +617,7 @@ const RecordDecl* GetDefinitionForClass(const Decl* decl) { const RecordDecl* as_record = DynCastFrom(decl); const ClassTemplateDecl* as_tpl = DynCastFrom(decl); if (as_tpl) { // Convert the template to its underlying class defn. - as_record = dyn_cast_or_null<RecordDecl>(as_tpl->getTemplatedDecl()); + as_record = DynCastFrom(as_tpl->getTemplatedDecl()); } if (as_record) { if (const RecordDecl* record_dfn = as_record->getDefinition()) { |