[llvm-commits] [llvm-gcc-4.2] r45523 - /llvm-gcc-4.2/trunk/gcc/ada/decl.c

Duncan Sands baldrick at free.fr
Wed Jan 2 16:28:11 PST 2008


Author: baldrick
Date: Wed Jan  2 18:28:10 2008
New Revision: 45523

URL: http://llvm.org/viewvc/llvm-project?rev=45523&view=rev
Log:
If the TYPE_SIZE is set from an initial value, set
the entire type from the initial value.  The testcase
is FrontendAda/init_size.ads.

Modified:
    llvm-gcc-4.2/trunk/gcc/ada/decl.c

Modified: llvm-gcc-4.2/trunk/gcc/ada/decl.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/ada/decl.c?rev=45523&r1=45522&r2=45523&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/ada/decl.c (original)
+++ llvm-gcc-4.2/trunk/gcc/ada/decl.c Wed Jan  2 18:28:10 2008
@@ -577,9 +577,12 @@
 	    && CONTAINS_PLACEHOLDER_P (TYPE_SIZE (gnu_type)))
 	  {
 	    if (gnu_expr && kind == E_Constant)
-	      gnu_size
-		= SUBSTITUTE_PLACEHOLDER_IN_EXPR
-		  (TYPE_SIZE (TREE_TYPE (gnu_expr)), gnu_expr);
+/* LLVM local begin */
+              {
+                gnu_type = TREE_TYPE (gnu_expr);
+                gnu_size = TYPE_SIZE (gnu_type);
+              }
+/* LLVM local end */
 
 	    /* We may have no GNU_EXPR because No_Initialization is
 	       set even though there's an Expression.  */
@@ -587,10 +590,15 @@
 		     && (Nkind (Declaration_Node (gnat_entity))
 			 == N_Object_Declaration)
 		     && Present (Expression (Declaration_Node (gnat_entity))))
-	      gnu_size
-		= TYPE_SIZE (gnat_to_gnu_type
-			     (Etype
-			      (Expression (Declaration_Node (gnat_entity)))));
+/* LLVM local begin */
+              {
+                gnu_type
+                  = gnat_to_gnu_type
+                    (Etype (Expression (Declaration_Node (gnat_entity))));
+                gnu_size
+                  = TYPE_SIZE (gnu_type);
+              }
+/* LLVM local end */
 	    else
 	      {
 		gnu_size = max_size (TYPE_SIZE (gnu_type), true);





More information about the llvm-commits mailing list