From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 180963959E57 for ; Wed, 26 Oct 2022 08:39:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 180963959E57 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666773579; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=155tGRPua0xMnowYiqABaK7EXre9Xwb6sgGMgUUhW4Q=; b=cMQ+iKsDG+jZDx+Fn1rW7c+8lJ4TYgdL7XNUBfpzYooO0HdisM9hE3ksYQs7DhywLqIQLz cIrMxQy8NHboJC1bNnS4RqNrrW9AroDw3EfLfRw33FRJY3gYSlfCXSdTvdQhwlrvgOlthE 3aXT75LkiYWFdyofNkP63IA5POQzYhk= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-73-yyt2eShnOZ-3tJjIl2JuHw-1; Wed, 26 Oct 2022 04:39:35 -0400 X-MC-Unique: yyt2eShnOZ-3tJjIl2JuHw-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 644C3185A7A9; Wed, 26 Oct 2022 08:39:35 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.193.252]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DA3BD49BB63; Wed, 26 Oct 2022 08:39:34 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 29Q8dGbl2560758 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 26 Oct 2022 10:39:22 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 29Q8d9FS2560756; Wed, 26 Oct 2022 10:39:09 +0200 Date: Wed, 26 Oct 2022 10:39:09 +0200 From: Jakub Jelinek To: arthur.cohen@embecosm.com, Jason Merrill , Mark Wielaard , Tom Tromey Cc: gcc-patches@gcc.gnu.org, gcc-rust@gcc.gnu.org Subject: Re: [PATCH Rust front-end v3 01/46] Use DW_ATE_UTF for the Rust 'char' type Message-ID: Reply-To: Jakub Jelinek References: <20221026081811.602573-1-arthur.cohen@embecosm.com> <20221026081811.602573-2-arthur.cohen@embecosm.com> MIME-Version: 1.0 In-Reply-To: <20221026081811.602573-2-arthur.cohen@embecosm.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP 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: On Wed, Oct 26, 2022 at 10:17:26AM +0200, arthur.cohen@embecosm.com wrote: > @@ -25201,6 +25215,13 @@ gen_compile_unit_die (const char *filename) > } > else if (strcmp (language_string, "GNU F77") == 0) > language = DW_LANG_Fortran77; > + else if (strcmp (language_string, "GNU Rust") == 0) > + { > + if (dwarf_version >= 5 || !dwarf_strict) > + language = DW_LANG_Rust; > + else > + language = DW_LANG_Rust_old; > + } I must say I don't understand nor like this DW_LANG_Rust_old stuff at all. Other languages don't do similar dances. Look for D, or Go. Neither of them has any non-standard lang code as fallback, they use the DWARF assigned DW_LANG_* code, and DW_LANG_C as fallback. On most arches, DWARF 5 is the default anyway, or non-strict DWARF at least. Where neither is enabled because of prehistoric or buggy DWARF consumers, it is unlikely they'd handle Rust sanely anyway. Just follow what Go does in the same function. Jakub