From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb1-xb2b.google.com (mail-yb1-xb2b.google.com [IPv6:2607:f8b0:4864:20::b2b]) by sourceware.org (Postfix) with ESMTPS id 84D753858D28 for ; Mon, 3 Jul 2023 00:47:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 84D753858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-yb1-xb2b.google.com with SMTP id 3f1490d57ef6-bacf685150cso4565795276.3 for ; Sun, 02 Jul 2023 17:47:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688345227; x=1690937227; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=03lBTn5UdYjEBy/uxpgOWvtfloCT/y8QCnfahWVqpKg=; b=N25xfmSQFL7zRbLiXMnzrzqaCmura0cm8Fxl2scdeKoH0yGoYXUo+6JkFbeLKjvKWc oSXcGI4htjWp+mB22J7OIx/luGz/qKBsFWczVjB5hSXPDcb2Bhz3IZUCG+isyDnF7+FJ 9V5UvGes1H2KVWCagj96jl+4Ya5lDHpjQNvdunC5H8qumCokYltGJudBxiRpx0MCjvek oS8aB47Xp9sUGhZopl8WTwuWGDdi2wJGT6o6jO2o7XdemoR+OOZLB0z09LNQSAw2KlLY qKcyzF4yblRSwaZxI3BzbuXjqUyFdNbK5jxlCXsiLvuw3+j/akgzMvJ2x2bvIuvQQ6eK 2ZVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688345227; x=1690937227; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=03lBTn5UdYjEBy/uxpgOWvtfloCT/y8QCnfahWVqpKg=; b=gvdRTtVfKm+wJ/A2LSRHv2jDg5Hxtt8pBXjImxvfWQQuFS2lrR179IXrZeI7Z6W0QF W7KL0QskU4SysSc3VLBwMQoJhncKCBs3O+YYWohmHh5Q/tCRSlZgix4gWapx+1oY4yz1 d2BC3Zk5YAjGfDWdaHbjm976yysP50NcDK7h1UZkL9Wbv85q/DOdk7NwEeie+V70zn1b s3+qNk8zqPoBMC8xkCGR3iP8niY2R2H+CSQQXZ6dht5URVHpTbS5ZkUpw9yhI0YPjbxb YZpFvXGHfoaIXfD7IJPisvxZg2Rv8a1OLAUllbUdhCkdftnptFkFClxsRWT2wDyfs9VH S8KQ== X-Gm-Message-State: ABy/qLZ2+KaFmYsk439cFN3bZHA8+w9Pb6WvctibCXFwy5TDml1K5yQ1 Uz95rKIWsUN/4P278d2GuQeRPvAyfD6IR/dopeE= X-Google-Smtp-Source: APBJJlH3ygYCEsjo3T2viTtjNRSTF/qRAgpTlJ5r/Uvzt6/bIVGCzXRqvaM7xudi0507EAfzxlP+wvdx/Xwpy/kD34Q= X-Received: by 2002:a25:ad9f:0:b0:c20:3bdf:ee36 with SMTP id z31-20020a25ad9f000000b00c203bdfee36mr9541586ybi.23.1688345226678; Sun, 02 Jul 2023 17:47:06 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Aaron Lorey Date: Mon, 3 Jul 2023 02:46:55 +0200 Message-ID: Subject: Re: Mapping of TREE_CODE to tree_node To: David Malcolm Cc: gcc@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Am Mo., 26. Juni 2023 um 20:09 Uhr schrieb David Malcolm : > > On Mon, 2023-06-26 at 18:59 +0200, Aaron Lorey via Gcc wrote: > > Hello, > > > > this is the first time I am writing to a mailing list. I've tried > > researching the normal procedure but nothing special seems to be > > required. > > > > I'm currently trying to do a complete graph-discovery of GCC's symtab > > / > > tree_nodes to dump the full internal representation of the > > compilation > > unit. Gitlab: https://gitlab.com/graph-prog/code-database > > > > It is not exceptionally heavy but also not very easy to serialize the > > internal state to disk. I think this task was simply not considered > > in the > > design. > > > > Reason for writing to the mailing list are the troubles in connecting > > the > > TREE_CODE enumeration to the appropriate struct tree_node memory > > layout > > without guessing. > > > > Can you provide a mapping of TREE_CODE to tree_node memory layout? > > I don't know that such a mapping exists directly, but have a look at > the functions "tree_code_size" and "tree_size" defined in gcc/tree.cc. > > You might also find the LTO streaming code of interest; see gcc/lto- > streamer-{in,out}.cc > > Hope this is helpful > Dave > > Thank you for your reply. The tree_size() and tree_code_size() functions are useful, although incomplete. If I understand correctly, the link time optimization works on the GIMPLE representation. The original syntax tree and symbol table would be preferable. Andrew's suggestion might be more what I'm looking for.