Commit 82b481ed by Eric Botcazou

utils.c (build_vms_descriptor32): Fix formatting.

	* gcc-interface/utils.c (build_vms_descriptor32): Fix formatting.
	(build_vms_descriptor): Likewise.

From-SVN: r163027
parent 788e5046
2010-08-09 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/utils.c (build_vms_descriptor32): Fix formatting.
(build_vms_descriptor): Likewise.
2010-08-08 Nathan Froyd <froydnj@codesourcery.com> 2010-08-08 Nathan Froyd <froydnj@codesourcery.com>
* gcc-interface/utils.c (make_descriptor_field): Add tree parameter. * gcc-interface/utils.c (make_descriptor_field): Add tree parameter.
...@@ -6,9 +11,8 @@ ...@@ -6,9 +11,8 @@
2010-08-08 Nathan Froyd <froydnj@codesourcery.com> 2010-08-08 Nathan Froyd <froydnj@codesourcery.com>
* gcc-interface/decl.c (rec_variant). Declare. Declare a VEC of it. * gcc-interface/decl.c (rec_variant): Declare. Declare a VEC of it.
(build_variant_list): Return a VEC instead of a tree. Take a (build_variant_list): Take and return a VEC instead of a tree.
VEC instead of a tree.
(create_variant_part_from): Take a VEC instead of a tree for (create_variant_part_from): Take a VEC instead of a tree for
variant_list. Adjust accordingly. variant_list. Adjust accordingly.
(gnat_to_gnu_entity): Adjust for changes to previous functions. (gnat_to_gnu_entity): Adjust for changes to previous functions.
......
...@@ -2427,30 +2427,29 @@ build_vms_descriptor32 (tree type, Mechanism_Type mech, Entity_Id gnat_entity) ...@@ -2427,30 +2427,29 @@ build_vms_descriptor32 (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
/* Make the type for a descriptor for VMS. The first four fields are the /* Make the type for a descriptor for VMS. The first four fields are the
same for all types. */ same for all types. */
field_list = field_list
make_descriptor_field ("LENGTH", gnat_type_for_size (16, 1), = make_descriptor_field ("LENGTH", gnat_type_for_size (16, 1), record_type,
record_type, size_in_bytes ((mech == By_Descriptor_A
size_in_bytes
((mech == By_Descriptor_A
|| mech == By_Short_Descriptor_A) || mech == By_Short_Descriptor_A)
? inner_type : type), field_list); ? inner_type : type),
field_list = field_list);
make_descriptor_field ("DTYPE", gnat_type_for_size (8, 1), field_list
record_type, size_int (dtype), field_list); = make_descriptor_field ("DTYPE", gnat_type_for_size (8, 1), record_type,
field_list = size_int (dtype), field_list);
make_descriptor_field ("CLASS", gnat_type_for_size (8, 1), field_list
record_type, size_int (klass), field_list); = make_descriptor_field ("CLASS", gnat_type_for_size (8, 1), record_type,
size_int (klass), field_list);
/* Of course this will crash at run time if the address space is not /* Of course this will crash at run time if the address space is not
within the low 32 bits, but there is nothing else we can do. */ within the low 32 bits, but there is nothing else we can do. */
pointer32_type = build_pointer_type_for_mode (type, SImode, false); pointer32_type = build_pointer_type_for_mode (type, SImode, false);
field_list = field_list
make_descriptor_field ("POINTER", pointer32_type, record_type, = make_descriptor_field ("POINTER", pointer32_type, record_type,
build_unary_op (ADDR_EXPR, build_unary_op (ADDR_EXPR,
pointer32_type, pointer32_type,
build0 (PLACEHOLDER_EXPR, build0 (PLACEHOLDER_EXPR, type)),
type)), field_list); field_list);
switch (mech) switch (mech)
{ {
...@@ -2462,52 +2461,57 @@ build_vms_descriptor32 (tree type, Mechanism_Type mech, Entity_Id gnat_entity) ...@@ -2462,52 +2461,57 @@ build_vms_descriptor32 (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
case By_Descriptor_SB: case By_Descriptor_SB:
case By_Short_Descriptor_SB: case By_Short_Descriptor_SB:
field_list = field_list
make_descriptor_field ("SB_L1", gnat_type_for_size (32, 1), = make_descriptor_field ("SB_L1", gnat_type_for_size (32, 1),
record_type, record_type,
(TREE_CODE (type) == ARRAY_TYPE (TREE_CODE (type) == ARRAY_TYPE
? TYPE_MIN_VALUE (TYPE_DOMAIN (type)) ? TYPE_MIN_VALUE (TYPE_DOMAIN (type))
: size_zero_node), field_list); : size_zero_node),
field_list = field_list);
make_descriptor_field ("SB_U1", gnat_type_for_size (32, 1), field_list
= make_descriptor_field ("SB_U1", gnat_type_for_size (32, 1),
record_type, record_type,
(TREE_CODE (type) == ARRAY_TYPE (TREE_CODE (type) == ARRAY_TYPE
? TYPE_MAX_VALUE (TYPE_DOMAIN (type)) ? TYPE_MAX_VALUE (TYPE_DOMAIN (type))
: size_zero_node), field_list); : size_zero_node),
field_list);
break; break;
case By_Descriptor_A: case By_Descriptor_A:
case By_Short_Descriptor_A: case By_Short_Descriptor_A:
case By_Descriptor_NCA: case By_Descriptor_NCA:
case By_Short_Descriptor_NCA: case By_Short_Descriptor_NCA:
field_list = field_list
make_descriptor_field ("SCALE", gnat_type_for_size (8, 1), = make_descriptor_field ("SCALE", gnat_type_for_size (8, 1),
record_type, size_zero_node, field_list); record_type, size_zero_node, field_list);
field_list = field_list
make_descriptor_field ("DIGITS", gnat_type_for_size (8, 1), = make_descriptor_field ("DIGITS", gnat_type_for_size (8, 1),
record_type, size_zero_node, field_list); record_type, size_zero_node, field_list);
field_list = field_list
make_descriptor_field ("AFLAGS", gnat_type_for_size (8, 1), = make_descriptor_field ("AFLAGS", gnat_type_for_size (8, 1),
record_type, record_type,
size_int ((mech == By_Descriptor_NCA || size_int ((mech == By_Descriptor_NCA
mech == By_Short_Descriptor_NCA) || mech == By_Short_Descriptor_NCA)
? 0 ? 0
/* Set FL_COLUMN, FL_COEFF, and /* Set FL_COLUMN, FL_COEFF, and
FL_BOUNDS. */ FL_BOUNDS. */
: (TREE_CODE (type) == ARRAY_TYPE : (TREE_CODE (type) == ARRAY_TYPE
&& TYPE_CONVENTION_FORTRAN_P (type) && TYPE_CONVENTION_FORTRAN_P
? 224 : 192)), field_list); (type)
? 224 : 192)),
field_list);
field_list = field_list
make_descriptor_field ("DIMCT", gnat_type_for_size (8, 1), = make_descriptor_field ("DIMCT", gnat_type_for_size (8, 1),
record_type, size_int (ndim), field_list); record_type, size_int (ndim), field_list);
field_list = field_list
make_descriptor_field ("ARSIZE", gnat_type_for_size (32, 1), = make_descriptor_field ("ARSIZE", gnat_type_for_size (32, 1),
record_type, size_in_bytes (type), field_list); record_type, size_in_bytes (type),
field_list);
/* Now build a pointer to the 0,0,0... element. */ /* Now build a pointer to the 0,0,0... element. */
tem = build0 (PLACEHOLDER_EXPR, type); tem = build0 (PLACEHOLDER_EXPR, type);
...@@ -2517,8 +2521,8 @@ build_vms_descriptor32 (tree type, Mechanism_Type mech, Entity_Id gnat_entity) ...@@ -2517,8 +2521,8 @@ build_vms_descriptor32 (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
convert (TYPE_DOMAIN (inner_type), size_zero_node), convert (TYPE_DOMAIN (inner_type), size_zero_node),
NULL_TREE, NULL_TREE); NULL_TREE, NULL_TREE);
field_list = field_list
make_descriptor_field ("A0", pointer32_type, record_type, = make_descriptor_field ("A0", pointer32_type, record_type,
build1 (ADDR_EXPR, pointer32_type, tem), build1 (ADDR_EXPR, pointer32_type, tem),
field_list); field_list);
...@@ -2538,8 +2542,8 @@ build_vms_descriptor32 (tree type, Mechanism_Type mech, Entity_Id gnat_entity) ...@@ -2538,8 +2542,8 @@ build_vms_descriptor32 (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
fname[0] = ((mech == By_Descriptor_NCA || fname[0] = ((mech == By_Descriptor_NCA ||
mech == By_Short_Descriptor_NCA) ? 'S' : 'M'); mech == By_Short_Descriptor_NCA) ? 'S' : 'M');
fname[1] = '0' + i, fname[2] = 0; fname[1] = '0' + i, fname[2] = 0;
field_list = field_list
make_descriptor_field (fname, gnat_type_for_size (32, 1), = make_descriptor_field (fname, gnat_type_for_size (32, 1),
record_type, idx_length, field_list); record_type, idx_length, field_list);
if (mech == By_Descriptor_NCA || mech == By_Short_Descriptor_NCA) if (mech == By_Descriptor_NCA || mech == By_Short_Descriptor_NCA)
...@@ -2552,14 +2556,14 @@ build_vms_descriptor32 (tree type, Mechanism_Type mech, Entity_Id gnat_entity) ...@@ -2552,14 +2556,14 @@ build_vms_descriptor32 (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
char fname[3]; char fname[3];
fname[0] = 'L', fname[1] = '0' + i, fname[2] = 0; fname[0] = 'L', fname[1] = '0' + i, fname[2] = 0;
field_list = field_list
make_descriptor_field (fname, gnat_type_for_size (32, 1), = make_descriptor_field (fname, gnat_type_for_size (32, 1),
record_type, TYPE_MIN_VALUE (idx_arr[i]), record_type, TYPE_MIN_VALUE (idx_arr[i]),
field_list); field_list);
fname[0] = 'U'; fname[0] = 'U';
field_list = field_list
make_descriptor_field (fname, gnat_type_for_size (32, 1), = make_descriptor_field (fname, gnat_type_for_size (32, 1),
record_type, TYPE_MAX_VALUE (idx_arr[i]), record_type, TYPE_MAX_VALUE (idx_arr[i]),
field_list); field_list);
} }
...@@ -2731,15 +2735,16 @@ build_vms_descriptor (tree type, Mechanism_Type mech, Entity_Id gnat_entity) ...@@ -2731,15 +2735,16 @@ build_vms_descriptor (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
= make_descriptor_field ("LENGTH", gnat_type_for_size (64, 1), = make_descriptor_field ("LENGTH", gnat_type_for_size (64, 1),
record64_type, record64_type,
size_in_bytes (mech == By_Descriptor_A size_in_bytes (mech == By_Descriptor_A
? inner_type : type), field_list64); ? inner_type : type),
field_list64);
pointer64_type = build_pointer_type_for_mode (type, DImode, false); pointer64_type = build_pointer_type_for_mode (type, DImode, false);
field_list64 field_list64
= make_descriptor_field ("POINTER", pointer64_type, record64_type, = make_descriptor_field ("POINTER", pointer64_type, record64_type,
build_unary_op (ADDR_EXPR, pointer64_type, build_unary_op (ADDR_EXPR, pointer64_type,
build0 (PLACEHOLDER_EXPR, build0 (PLACEHOLDER_EXPR, type)),
type)), field_list64); field_list64);
switch (mech) switch (mech)
{ {
...@@ -2753,13 +2758,15 @@ build_vms_descriptor (tree type, Mechanism_Type mech, Entity_Id gnat_entity) ...@@ -2753,13 +2758,15 @@ build_vms_descriptor (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
record64_type, record64_type,
(TREE_CODE (type) == ARRAY_TYPE (TREE_CODE (type) == ARRAY_TYPE
? TYPE_MIN_VALUE (TYPE_DOMAIN (type)) ? TYPE_MIN_VALUE (TYPE_DOMAIN (type))
: size_zero_node), field_list64); : size_zero_node),
field_list64);
field_list64 field_list64
= make_descriptor_field ("SB_U1", gnat_type_for_size (64, 1), = make_descriptor_field ("SB_U1", gnat_type_for_size (64, 1),
record64_type, record64_type,
(TREE_CODE (type) == ARRAY_TYPE (TREE_CODE (type) == ARRAY_TYPE
? TYPE_MAX_VALUE (TYPE_DOMAIN (type)) ? TYPE_MAX_VALUE (TYPE_DOMAIN (type))
: size_zero_node), field_list64); : size_zero_node),
field_list64);
break; break;
case By_Descriptor_A: case By_Descriptor_A:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment