From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9783 invoked by alias); 21 Sep 2017 15:43:32 -0000 Mailing-List: contact jit-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Subscribe: Sender: jit-owner@gcc.gnu.org Received: (qmail 9771 invoked by uid 89); 21 Sep 2017 15:43:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=obtaining X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: mail-wr0-f179.google.com Received: from mail-wr0-f179.google.com (HELO mail-wr0-f179.google.com) (209.85.128.179) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 21 Sep 2017 15:43:30 +0000 Received: by mail-wr0-f179.google.com with SMTP id o42so4906253wrb.3 for ; Thu, 21 Sep 2017 08:43:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=huuugegames-com.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=tO0QR678q7AekG/VIhhBWSCaNwvFW8vckYeNNnC2cOo=; b=02VHBq9J4vXASxnL9Nut8rz8k44a3B85+8kcsBXHK4f0pVW6Bw83HLlcuvDH8sFHHI YSAiC9UFqE+5JWWcZcOBaLEgu+GPCfI0oho0YX6y0qej1Zzzg/XR1G5RKi8y6/BkE9WW zdwuqsZupkchLg62Lwph7YJlT2e7yndxu4KU3wh01BRto9jbrJyv56Kra5COSxXZGP5p vCj3J0J5BpQMlDbxc40UNcF8AZAmrRErvyvtlVmo1NRAaRTXOg+H5LqrbmG93sCqC8Vt Umf1e/okEB2fH0ddB5MPIWI+KO4Cs2J6qgkrpctKVVJvt7R5Y5qOVRdF41sr4kD8wOZ/ 9iCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=tO0QR678q7AekG/VIhhBWSCaNwvFW8vckYeNNnC2cOo=; b=FAtg2Yq9WAvL4rJ8tTAsStgesw6TtoMMIyLIPacHvrAm/vc4NGbdoZQwp7bD0IWZ7G YUnyOaS0B0DXjG5LWDyiTMlexWSGdKrU8c/SKZQl3uvGHlb/BFjb4slTrFWABFtQR8pY Q+UfUAXLY1rDNveJeg3JAR0UWbpEnTd9bv236CLpKW/uGlr1O/6uwbPw8NcP+9VulQEC CyXUUMctl2KdKjR56qx07inscv0TFUTvbixozZ6yqneBtwFg9AHWtAq+HClSA7MzkYHW qKNFGXeS/SVCJFkrrL/TU4Sd3lCHcg2dnUIqpgs8zEqcJQqbUydv2q5q0fvrj5EBk1GT S1CQ== X-Gm-Message-State: AHPjjUjFtS2fPgRw2PuA6316vLx5xBm4QMYNyp/+RuyecP7j9UaHAcf4 wAxhK4swoqKmglqnw0ekJGJeTz+Z2mrSoTU5KdDBulq4 X-Google-Smtp-Source: AOwi7QAdifW1SZiolIXbXnhrc9qhVy+kzaXpZsIpM6wWkWhg7wvjMCFm67sZsfq4wYPMNn5ea123ONwQtkBccPr45RQ= X-Received: by 10.223.163.83 with SMTP id d19mr2333816wrb.84.1506008608300; Thu, 21 Sep 2017 08:43:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.216.210 with HTTP; Thu, 21 Sep 2017 08:43:27 -0700 (PDT) From: Bartosz Szreder Date: Sun, 01 Jan 2017 00:00:00 -0000 Message-ID: Subject: Function pointer handling To: jit@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2017-q3/txt/msg00017.txt.bz2 I have some questions regarding pointers to functions in current (7.2) version of GCC-JIT. 1. The documentation doesn't mention existence of gcc_jit_context_new_function_ptr_type() as a mechanism of handling function pointers, yet contains gcc_jit_context_new_call_through_ptr(). - Is the former function unsupported/buggy in some way and is not indented for general use, or just lacks proper documentation? - What is the proper way of obtaining a function pointer to be passed to gcc_jit_context_new_call_through_ptr()? There doesn't seem to be any counterpart to gcc_jit_lvalue_get_address() for functions. As the name suggests, gcc_jit_lvalue_get_address() works on an L-value and gcc_jit_function type isn't an ancestor of gcc_jit_lvalue in the internal type system, therefore upcasting is impossible. 2. Is it safe to pass a function pointer as a GCC_JIT_TYPE_VOID_PTR and use gcc_jit_context_new_call_through_ptr() on such value? Thanks, Bartosz Szreder