aboutsummaryrefslogtreecommitdiff
path: root/gcc/d/d-compiler.cc
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gdcproject.org>2020-06-03 15:26:25 +0200
committerIain Buclaw <ibuclaw@gdcproject.org>2020-06-16 23:31:24 +0200
commit89fdaf5ad853c3d55060b9929027946833aee77a (patch)
treebd31fe1405120ce155c606fb258d6944e6a6be6b /gcc/d/d-compiler.cc
parent8fb4d1d58362b77da78c09740c6b5562124a369e (diff)
downloadgcc-89fdaf5ad853c3d55060b9929027946833aee77a.zip
gcc-89fdaf5ad853c3d55060b9929027946833aee77a.tar.gz
gcc-89fdaf5ad853c3d55060b9929027946833aee77a.tar.bz2
d: Use new isTypeXxxx helpers where possible.
gcc/d/ChangeLog: * d-builtins.cc (d_eval_constant_expression): Use isTypeXxxx helpers instead of explicit casts. (d_build_builtins_module): Likewise. * d-codegen.cc (get_array_length): Likewise. (identity_compare_p): Likewise. (lower_struct_comparison): Likewise. (build_array_from_val): Likewise. (array_bounds_check): Likewise. (get_function_type): Likewise. (d_build_call): Likewise. * d-compiler.cc (Compiler::paintAsType): Likewise. * d-convert.cc (convert_expr): Likewise. (convert_for_assignment): Likewise. * d-lang.cc (d_classify_record): Likewise. (d_build_eh_runtime_type): Likewise. * decl.cc (DeclVisitor::visit): Likewise. * expr.cc (ExprVisitor::needs_postblit): Likewise. (ExprVisitor::needs_dtor): Likewise. (ExprVisitor::visit): Likewise. * imports.cc (ImportVisitor::visit): Likewise. * typeinfo.cc (get_typeinfo_kind): Likewise. (TypeInfoVisitor::visit): Likewise. (TypeDeclInfoVisitor::visit): Likewise. * types.cc (merge_aggregate_types): Likewise. (TypeVisitor::visit): Likewise.
Diffstat (limited to 'gcc/d/d-compiler.cc')
-rw-r--r--gcc/d/d-compiler.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/d/d-compiler.cc b/gcc/d/d-compiler.cc
index a8adb98..75ca157 100644
--- a/gcc/d/d-compiler.cc
+++ b/gcc/d/d-compiler.cc
@@ -111,7 +111,7 @@ Compiler::paintAsType (UnionExp *, Expression *expr, Type *type)
}
/* Build vector type. */
- int nunits = ((TypeSArray *) expr->type)->dim->toUInteger ();
+ int nunits = expr->type->isTypeSArray ()->dim->toUInteger ();
Type *telem = expr->type->nextOf ();
tree vectype = build_vector_type (build_ctype (telem), nunits);
@@ -127,7 +127,7 @@ Compiler::paintAsType (UnionExp *, Expression *expr, Type *type)
{
/* Interpret value as a vector of the same size,
then return the array literal. */
- int nunits = ((TypeSArray *) type)->dim->toUInteger ();
+ int nunits = type->isTypeSArray ()->dim->toUInteger ();
Type *elem = type->nextOf ();
tree vectype = build_vector_type (build_ctype (elem), nunits);