From patchwork Mon Mar 10 20:18:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Malcolm X-Patchwork-Id: 328734 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id A30A72C00C6 for ; Tue, 11 Mar 2014 07:20:00 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id; q=dns; s=default; b=IJ6B7v8LJR4w 2H/hleUJrwZWKiNUaqgEXmpeK6sve3JxAeSYp7W7ZF4/vJ+kll1oON9Ycq5ezee9 TZQAZyzhODTUYBwJthZavDitr9aEAnlSquRuvFOcriJvewYIVP7jWLNq6iYlxcEB E7ATr8qeJB9rHyMMSgpfzijtj6QeaLk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id; s=default; bh=OCJoToUFJ1ZMZBKN9f mkmEAfP44=; b=ZG7VnUWBTKUR0J+Glfky7uoSfb27ySLOGRozAtcFfIzt5vlf4K ADiId9U0lbJJO4XHeNzfgIpHvO2ydPuIUe5FtUppfoV4aFepy3mHx2jrzBsig6II 0rIaHgvh3T2BJZdg/jKOeL6k/i7ZtaWm1lsmzRk77W6+l5Co6KH0wT0vI= Received: (qmail 21759 invoked by alias); 10 Mar 2014 20:19:54 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 21738 invoked by uid 89); 10 Mar 2014 20:19:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 10 Mar 2014 20:19:52 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s2AKJptX010494 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 10 Mar 2014 16:19:51 -0400 Received: from surprise.redhat.com (vpn-239-141.phx2.redhat.com [10.3.239.141]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s2AKJlxe000859; Mon, 10 Mar 2014 16:19:48 -0400 From: David Malcolm To: jit@gcc.gnu.org, gcc-patches@gcc.gnu.org Cc: David Malcolm Subject: [jit] Make various C++ wrapper methods const Date: Mon, 10 Mar 2014 16:18:10 -0400 Message-Id: <1394482690-27510-1-git-send-email-dmalcolm@redhat.com> X-IsSubscribed: yes Committed to branch dmalcolm/jit: gcc/jit/ * libgccjit++.h (gccjit::context::new_rvalue): Make these methods const. (gccjit::context::zero): Likewise. (gccjit::context::one): Likewise. (gccjit::function::get_param): Likewise. --- gcc/jit/libgccjit++.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/gcc/jit/libgccjit++.h b/gcc/jit/libgccjit++.h index cd02dde..afcf892 100644 --- a/gcc/jit/libgccjit++.h +++ b/gcc/jit/libgccjit++.h @@ -133,14 +133,14 @@ namespace gccjit location loc = location ()); rvalue new_rvalue (type numeric_type, - int value); - rvalue zero (type numeric_type); - rvalue one (type numeric_type); + int value) const; + rvalue zero (type numeric_type) const; + rvalue one (type numeric_type) const; rvalue new_rvalue (type numeric_type, - double value); + double value) const; rvalue new_rvalue (type pointer_type, - void *value); - rvalue new_rvalue (const std::string &value); + void *value) const; + rvalue new_rvalue (const std::string &value) const; /* Generic unary operations... */ rvalue new_unary_op (enum gcc_jit_unary_op op, @@ -306,7 +306,7 @@ namespace gccjit void dump_to_dot (const std::string &path); - param get_param (int index); + param get_param (int index) const; block new_block (); block new_block (const std::string &name); @@ -671,7 +671,7 @@ context::new_global (type type_, inline rvalue context::new_rvalue (type numeric_type, - int value) + int value) const { return rvalue ( gcc_jit_context_new_rvalue_from_int (m_inner_ctxt, @@ -680,14 +680,14 @@ context::new_rvalue (type numeric_type, } inline rvalue -context::zero (type numeric_type) +context::zero (type numeric_type) const { return rvalue (gcc_jit_context_zero (m_inner_ctxt, numeric_type.get_inner_type ())); } inline rvalue -context::one (type numeric_type) +context::one (type numeric_type) const { return rvalue (gcc_jit_context_one (m_inner_ctxt, numeric_type.get_inner_type ())); @@ -695,7 +695,7 @@ context::one (type numeric_type) inline rvalue context::new_rvalue (type numeric_type, - double value) + double value) const { return rvalue ( gcc_jit_context_new_rvalue_from_double (m_inner_ctxt, @@ -705,7 +705,7 @@ context::new_rvalue (type numeric_type, inline rvalue context::new_rvalue (type pointer_type, - void *value) + void *value) const { return rvalue ( gcc_jit_context_new_rvalue_from_ptr (m_inner_ctxt, @@ -714,7 +714,7 @@ context::new_rvalue (type pointer_type, } inline rvalue -context::new_rvalue (const std::string &value) +context::new_rvalue (const std::string &value) const { return rvalue ( gcc_jit_context_new_string_literal (m_inner_ctxt, value.c_str ())); @@ -1156,7 +1156,7 @@ function::dump_to_dot (const std::string &path) } inline param -function::get_param (int index) +function::get_param (int index) const { return param (gcc_jit_function_get_param (get_inner_function (), index));