From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by sourceware.org (Postfix) with ESMTPS id 835DC3834C2C for ; Wed, 7 Dec 2022 15:23:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 835DC3834C2C 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-ej1-x633.google.com with SMTP id kw15so11363792ejc.10 for ; Wed, 07 Dec 2022 07:23:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=8uckQ5ts9fvbmlF8qMxFVrMdHelp27/JKdMpN6jxWxQ=; b=dX4eW0EYVgVRvh/aQOZA05Csv26htrv8rDLN/DKGokZ2vgyrH/jFQ3yiVhLV+W/yBj Zh/zC1ao3YBE+JG71fVa4sOW2IXkVCezZcYXvKMcr1RBVejDMezpm6y7QiZ8l0HbeP5M FIEn1x8/t8FGwXzcc7JIEM18RswwsgyL+oFzpgV7Mbd1EIIv3SVh4Ob4BuOIu3pMkIsf qTlrue5K2iQiuqfYA88QZIaMzkREHrSQrJknDyKv1jK9lFb5JpDvm366dYR3muRWyU9J NwSMxYLg5QDBpamOfKujJZUhIz/0fuX5KDd1Yi3F32NcjjRKVKEmQlZ9Z9btB7qKG3v4 wD1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=8uckQ5ts9fvbmlF8qMxFVrMdHelp27/JKdMpN6jxWxQ=; b=l9+oXa4XNVANaNc8ZwjB2xSXQ56yVZiVLXT3aKJsifP9LAfWBJTpko1lmMZ0wgToky jj4+UCHXVqGCX0GDl0qa2OVOvSjGQKSuC9V70+x8tC5xreUdfZTLpk4nj6K3daC/ySTj TAo+isD1WAiMdL00nL6Wi74aP8fdlJ1bCJIDvr9HKPLoQbyXpxY3u8grTEOC1yxwi0fS unpqZJBW21/JCyJRspOh8XiUrht8ONIxi85T/VGdDIMq7KekIn0v3rHigXt/r4dBF/8h 4RPVhB0B+Nfi3/seZDQ6CatbqOiSWYPoYL5q8dWSjAhmCRup8WnRWtmoLbpwGY1zHBjk TsmA== X-Gm-Message-State: ANoB5pmHm6vjWelya3f9ID/kvS58UE5pL02RvA5TW+NJ0wal/WZ19Q8Z wINE8b0rhk/Ig+EF/FVuu7npi58KIVZ6Nh7Lr1OyWkPS X-Google-Smtp-Source: AA0mqf4ADBFQFWCx2g8ktVLIVKcBkmzlhAmZ5P3gdi8XLu6PmHSp7efZ37DKazhg/z2OOp8J14FNAD+P4UVa7wPCz70= X-Received: by 2002:a17:907:cf84:b0:78d:4795:ff1f with SMTP id ux4-20020a170907cf8400b0078d4795ff1fmr31761484ejc.331.1670426601097; Wed, 07 Dec 2022 07:23:21 -0800 (PST) MIME-Version: 1.0 References: <96699ff0-f4d7-4276-8af7-5a4ce9735174@acm.org> In-Reply-To: From: Jonathan Wakely Date: Wed, 7 Dec 2022 15:23:09 +0000 Message-ID: Subject: Re: Naming flag for specifying the output file name for Binary Module Interface files To: "chuanqi.xcq" Cc: David Blaikie , gcc Mailing List , Iain Sandoe , Nathan Sidwell , "ben.boeckel" Content-Type: multipart/alternative; boundary="0000000000002e8e6205ef3e802c" X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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: --0000000000002e8e6205ef3e802c Content-Type: text/plain; charset="UTF-8" On Wed, 7 Dec 2022, 02:30 chuanqi.xcq via Gcc, wrote: > Hi Nathan, > > 1) 'save' -- does it *cause* the bmi to be saved, or is that actually > controlled > by other options? (I suspect the latter) > Yes, it causes the bmi to be saved. In fact, when we add `-save-temps` > option in clang and we compile a module unit, we'll see the preprocessed > output, the bmi, the LLVM IR and the assembly code. So the semantics of the > option `-fsave-std-cxx-module-file=` is to save the bmi to the specified > output. > > 2) 'std' -- why is this there. There's only one C++ std, with different > variants thereof being temporally selectable. > Since in clang we have clang c++ modules extension. It is not std one. And > we have objective C modules in clang too. So we said `std-cxx`. > > 3) 'cxx' -- why not 'c++'? Let's not let this transliteration of + to x > get > into the options -- it hasn't in '-std=c++20' for example. > `c++` should be good advice. > > Might I suggest something more like '-fmodule-output='? That collates > nicely with other -fmodule-$FOO options, and the 'output' part is similar > to the mnemonic '-o' for the regular output file naming. > My previous concern was there were tons of `-fmodule-*` options in clang, > which are not standard c++ modules. So I was afraid the name > `-fmodule-output` may be confusing. > So I proposed `-fsave-std-cxx-module-file=`. But I didn't recognize we > need to keep the option consistency between gcc and clang until Iain > mentioned it. > It is obviously redundant for gcc to keep the `-std-cxx` prefix in the > name. Personally, I feel the clearity of the option name is more important > than the length. > I disagree. I can easily remember "module output" but I would have to check the manual every time to see if it's "std c++ module save file" or some other permutation of those words And if the flag is not consistent between clang and GCC that's even worse. Since I think such flags will be mainly used by build systems/build scripts > so such flags wouldn't be typed frequently. > But command line interface consistency is very important too. I know tools > writer will hate to write tons of codes like: > ``` > if compiler == gcc > ... > elif compiler == clang > ... > ``` > So I think the conclusion may be: > (1) If gcc can tolerate the lengthy `-fsave-std-c++-module-file=` name, it > would be best for clang. > IMHO that's unacceptable for GCC. (2) If (1) is not acceptable and we love to keep the command line > consistency, I think clang can use '-fmodule-output=' as long as we make it > clear in the document. It will be confusing but it may be the cost clang > need to pay for the extension (so I'll vote against strongly if someone > want to add some other extensions) > Given that C++20 modules are in an ISO standard and clang modules aren't, I think it's right that the "simple" name refers to C++20 modules, without requiring "std-c++-modules". It also seems right that the difficulty of distinguishing clang modules from std modules should be dealt with by clang, not by other compilers. --0000000000002e8e6205ef3e802c--