From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 41177 invoked by alias); 12 Mar 2018 18:15:42 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 41045 invoked by uid 89); 12 Mar 2018 18:15:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=Hello!, H*i:sk:AZqejLc, H*i:sk:CANHA4O, (unknown) X-HELO: mail-lf0-f68.google.com Received: from mail-lf0-f68.google.com (HELO mail-lf0-f68.google.com) (209.85.215.68) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 12 Mar 2018 18:15:18 +0000 Received: by mail-lf0-f68.google.com with SMTP id m69-v6so24702926lfe.8 for ; Mon, 12 Mar 2018 11:15:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=4mi9MuwkOLbaQzPVQtJol0pDqb+myArkqPK3PLQYPb8=; b=VLAX4J1FcAOdxtuhBnrUNEQX8ZfRMtffEL2FFJ8n1C0AS86VMF5zLWMyM0JtGezRm/ 3xKLqks9kNgztG1Ed1JnQe05Bc2DVqLjkkx54pzLI7eeHnZlcG4jfP1YIRjG6Pzt2uAx yrby5eeTOCk0LLFJBOanZKe/87pC4F8YZKtMqF4ymnvZ8FPCVPaVGL3bvurOsZIzpULI MhF2FkPOqXickO4Q2ohgSbuRf4I5MHHiUxJX3f74Jd7GVWWpJLI0qCnh5qQ9kZWPIPsH v7vXiRzMnuKsTipNKYfI6hwug2uvX8AnGtNiQegtyf8c/8eTaHJBu90aQ5a9YAgpVSzS bGkw== X-Gm-Message-State: AElRT7ElhowrGHxN5IiXio25QeMV7jfZp0Me2UhAwxB5mU0MkpZ7NR+/ jNuIC0UHeZWg1PdwvSriOwLFZLVtSQWYElf9yZSy4Q== X-Google-Smtp-Source: AG47ELtguJvDCOOHcHH7XCNnJRLA4rRGPxRvfsQ6SSk+ZUczIwnBOYqhdD5Tb1eij1VvmRAtNaCrwz6rw6py4tAXhdc= X-Received: by 2002:a19:e112:: with SMTP id y18-v6mr4174135lfg.102.1520878508328; Mon, 12 Mar 2018 11:15:08 -0700 (PDT) MIME-Version: 1.0 Received: by 10.46.91.10 with HTTP; Mon, 12 Mar 2018 11:15:07 -0700 (PDT) In-Reply-To: References: From: Richard Biener Date: Mon, 12 Mar 2018 18:15:00 -0000 Message-ID: Subject: Re: [ Plugins ] Read-only, or...? To: Deruupu Sutoomo Cc: GCC Development Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2018-03/txt/msg00145.txt.bz2 On Mon, Mar 12, 2018 at 3:47 PM, Deruupu Sutoomo wrote: > Hello! I have a question regarding Plugins... > > I implemented a small one as a test to get used to working with GIMPLE and > basic blocks. I read the Plugin API page, the wiki, and followed a tutorial > to get started. However, I seem to have hit a bit of a road block in > actually modifying the output of the compiled program itself. > > Are plugins a "read-only" look at the compilation model? If I wanted to > provide an implementation of an intrinsic or modify a C++-compiled > Translation Unit in some fashion, are plugins what I should be looking at? plugins are not restricted to introspection, you have full access to all internal GCC functions so modifying the IL is possible. It might be easier to actually patch GCC though. Richard. > Background: I am attempting to add a function which relies on "compiler > magic" and the file system to pull data made available to the program, > replacing every instance of that function with the appropriate > implementation (the data is to be constexpr). > > ( This is my first time on the mailing list, after carefully reading the > descriptions for the others and asking around, this seemed to be > appropriate. Let em know if I have the wrong space! )