public inbox for java-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mjw@redhat.com>
To: gcc-patches@gcc.gnu.org,	java-patches@gcc.gnu.org
Cc: tromey@redhat.com,	Mark Wielaard <mjw@redhat.com>
Subject: [PATCH] java: Use build_qualified_type instead of build_type_variant.
Date: Tue, 08 Jul 2014 20:13:00 -0000	[thread overview]
Message-ID: <1404850329-16974-1-git-send-email-mjw@redhat.com> (raw)

The java frontend is one of the only places where build_type_variant is
still used. New code should use build_qualified_type. See gcc/tree.h.

Build and tested on x86_64-unknown-linux-gnu.

gcc/java/ChangeLog

	* builtins.c (putVolatile_builtin): Use build_qualified_type
	instead of build_type_variant.
	(getVolatile_builtin): Likewise.
	(build_classdollar_field): Likewise.
---
 gcc/java/ChangeLog  |    7 +++++++
 gcc/java/builtins.c |    8 +++++---
 gcc/java/class.c    |    8 ++++----
 3 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index ce90e28..d12b664 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,10 @@
+2014-07-08  Mark Wielaard  <mjw@redhat.com>
+
+	* builtins.c (putVolatile_builtin): Use build_qualified_type
+	instead of build_type_variant.
+	(getVolatile_builtin): Likewise.
+	(build_classdollar_field): Likewise.
+
 2014-06-24  Trevor Saunders  <tsaunders@mozilla.com>
 
 	* jcf-io.c: Adjust.
diff --git a/gcc/java/builtins.c b/gcc/java/builtins.c
index 1ce9ce5..12c427d 100644
--- a/gcc/java/builtins.c
+++ b/gcc/java/builtins.c
@@ -394,7 +394,8 @@ putVolatile_builtin (tree method_return_type ATTRIBUTE_UNUSED,
   
   addr = build_addr_sum (value_type, obj_arg, offset_arg);
   addr 
-    = fold_convert (build_pointer_type (build_type_variant (value_type, 0, 1)),
+    = fold_convert (build_pointer_type (build_qualified_type
+					(value_type, TYPE_QUAL_VOLATILE)),
 		    addr);
   
   stmt = build_call_expr (builtin_decl_explicit (BUILT_IN_SYNC_SYNCHRONIZE), 0);
@@ -418,8 +419,9 @@ getVolatile_builtin (tree method_return_type ATTRIBUTE_UNUSED,
 
   addr = build_addr_sum (method_return_type, obj_arg, offset_arg);
   addr 
-    = fold_convert (build_pointer_type (build_type_variant 
-					(method_return_type, 0, 1)), addr);
+    = fold_convert (build_pointer_type (build_qualified_type
+					(method_return_type,
+					 TYPE_QUAL_VOLATILE)), addr);
   
   stmt = build_call_expr (builtin_decl_explicit (BUILT_IN_SYNC_SYNCHRONIZE), 0);
   tmp = build_decl (BUILTINS_LOCATION, VAR_DECL, NULL, method_return_type);
diff --git a/gcc/java/class.c b/gcc/java/class.c
index dae3218..0d51165 100644
--- a/gcc/java/class.c
+++ b/gcc/java/class.c
@@ -1067,11 +1067,11 @@ build_classdollar_field (tree type)
       decl 
 	= build_decl (input_location,
 		      VAR_DECL, decl_name, 
-		      (build_type_variant 
+		      (build_qualified_type
 		       (build_pointer_type 
-			(build_type_variant (class_type_node, 
-					     /* const */ 1, 0)),
-			/* const */ 1, 0)));
+			(build_qualified_type (class_type_node,
+					       TYPE_QUAL_CONST)),
+			TYPE_QUAL_CONST)));
       TREE_STATIC (decl) = 1;
       TREE_CONSTANT (decl) = 1;
       TREE_READONLY (decl) = 1;
-- 
1.7.1

             reply	other threads:[~2014-07-08 20:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-08 20:13 Mark Wielaard [this message]
2014-07-09 10:23 ` Richard Biener
2014-07-09 10:58   ` Mark Wielaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1404850329-16974-1-git-send-email-mjw@redhat.com \
    --to=mjw@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=java-patches@gcc.gnu.org \
    --cc=tromey@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).