[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-02-18 Thread Mark de Wever via cfe-commits
mordante wrote: > (This is another example that the github review can't work well with the > reverted patches...) > > @mordante I think you can add `// REQUIRES: x86-registered-target` to the > test if @kaz7 can't respond quickly. It will skip the test on targets other > than x86. And it

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-02-17 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: (This is another example that the github review can't work well with the reverted patches...) @mordante I think you can add `// REQUIRES: x86-registered-target` to the test if @kaz7 can't respond quickly. It will skip the test on targets other than x86. And it should keep

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-02-17 Thread Mark de Wever via cfe-commits
mordante wrote: @kaz7 ping, can you have a look at the patch, I really like to reland this patch. https://github.com/llvm/llvm-project/pull/76451 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-02-10 Thread Mark de Wever via cfe-commits
mordante wrote: @kaz7 ping https://github.com/llvm/llvm-project/pull/76451 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-02-04 Thread Mark de Wever via cfe-commits
mordante wrote: Thanks for reverting @AaronBallman I somehow missed this comment. @kaz7 it should work on all platforms AFAIK. I don't have access to a VE system. Looking at some VE tests I wonder whether the following patch would work.

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-23 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: The build is still failing, so I've reverted these changes in https://github.com/llvm/llvm-project/commit/82f424f766be00b037a706a835d0a0663a2680f1 https://github.com/llvm/llvm-project/pull/76451 ___ cfe-commits mailing list

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-22 Thread Kazushi Marukawa via cfe-commits
kaz7 wrote: Hi @mordante, Does this test, `Driver/modules-print-library-module-manifest-path.cpp`, work on other than x86? It is failing on VE build bot like below. https://lab.llvm.org/buildbot/#/builders/91/builds/22189 https://github.com/llvm/llvm-project/pull/76451

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-22 Thread Mark de Wever via cfe-commits
https://github.com/mordante closed https://github.com/llvm/llvm-project/pull/76451 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-22 Thread Mark de Wever via cfe-commits
mordante wrote: > LGTM with a few nits. Can you double check modules.json is inside `lib/` > (`usr/lib/x86_64-linux-gnu{{/|\\}}modules.json`) instead of some directory > under `include`? Thanks for the review. The json will indeed be installed in the lib dir in libc++.

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-22 Thread Mark de Wever via cfe-commits
https://github.com/mordante updated https://github.com/llvm/llvm-project/pull/76451 >From f3f0db64da4d341f8e4a2054f9f25c87f8eda829 Mon Sep 17 00:00:00 2001 From: Mark de Wever Date: Wed, 27 Dec 2023 17:34:10 +0100 Subject: [PATCH 01/13] [clang][modules] Print library module manifest path.

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-21 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay approved this pull request. LGTM with a few nits. Can you double check modules.json is inside `lib/` (`usr/lib/x86_64-linux-gnu{{/|\\}}modules.json`) instead of some directory under `include`? https://github.com/llvm/llvm-project/pull/76451

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-21 Thread Fangrui Song via cfe-commits
@@ -6135,6 +6141,45 @@ std::string Driver::GetProgramPath(StringRef Name, const ToolChain ) const { return std::string(Name); } +std::string Driver::GetStdModuleManifestPath(const Compilation , + const ToolChain ) const { +

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-21 Thread Fangrui Song via cfe-commits
@@ -602,6 +602,16 @@ class Driver { // FIXME: This should be in CompilationInfo. std::string GetProgramPath(StringRef Name, const ToolChain ) const; + /// GetModuleManifestPath - Lookup the name of the Standard library manifest. + /// + /// \param C - The compilation.

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-21 Thread Mark de Wever via cfe-commits
mordante wrote: @MaskRay can you have another look, it would be great to land this before LLVM 18 branches, thanks! https://github.com/llvm/llvm-project/pull/76451 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-21 Thread Mark de Wever via cfe-commits
https://github.com/mordante updated https://github.com/llvm/llvm-project/pull/76451 >From f3f0db64da4d341f8e4a2054f9f25c87f8eda829 Mon Sep 17 00:00:00 2001 From: Mark de Wever Date: Wed, 27 Dec 2023 17:34:10 +0100 Subject: [PATCH 01/12] [clang][modules] Print library module manifest path.

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-21 Thread Mark de Wever via cfe-commits
https://github.com/mordante updated https://github.com/llvm/llvm-project/pull/76451 >From f3f0db64da4d341f8e4a2054f9f25c87f8eda829 Mon Sep 17 00:00:00 2001 From: Mark de Wever Date: Wed, 27 Dec 2023 17:34:10 +0100 Subject: [PATCH 01/11] [clang][modules] Print library module manifest path.

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-21 Thread Mark de Wever via cfe-commits
https://github.com/mordante updated https://github.com/llvm/llvm-project/pull/76451 >From f3f0db64da4d341f8e4a2054f9f25c87f8eda829 Mon Sep 17 00:00:00 2001 From: Mark de Wever Date: Wed, 27 Dec 2023 17:34:10 +0100 Subject: [PATCH 01/10] [clang][modules] Print library module manifest path.

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-21 Thread Mark de Wever via cfe-commits
https://github.com/mordante updated https://github.com/llvm/llvm-project/pull/76451 >From f3f0db64da4d341f8e4a2054f9f25c87f8eda829 Mon Sep 17 00:00:00 2001 From: Mark de Wever Date: Wed, 27 Dec 2023 17:34:10 +0100 Subject: [PATCH 1/9] [clang][modules] Print library module manifest path. This

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-21 Thread Mark de Wever via cfe-commits
https://github.com/mordante updated https://github.com/llvm/llvm-project/pull/76451 >From f3f0db64da4d341f8e4a2054f9f25c87f8eda829 Mon Sep 17 00:00:00 2001 From: Mark de Wever Date: Wed, 27 Dec 2023 17:34:10 +0100 Subject: [PATCH 1/8] [clang][modules] Print library module manifest path. This

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-20 Thread Mark de Wever via cfe-commits
https://github.com/mordante updated https://github.com/llvm/llvm-project/pull/76451 >From f3f0db64da4d341f8e4a2054f9f25c87f8eda829 Mon Sep 17 00:00:00 2001 From: Mark de Wever Date: Wed, 27 Dec 2023 17:34:10 +0100 Subject: [PATCH 1/7] [clang][modules] Print library module manifest path. This

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-19 Thread Mark de Wever via cfe-commits
https://github.com/mordante updated https://github.com/llvm/llvm-project/pull/76451 >From f3f0db64da4d341f8e4a2054f9f25c87f8eda829 Mon Sep 17 00:00:00 2001 From: Mark de Wever Date: Wed, 27 Dec 2023 17:34:10 +0100 Subject: [PATCH 1/6] [clang][modules] Print library module manifest path. This

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-19 Thread Mark de Wever via cfe-commits
@@ -0,0 +1,40 @@ +// Test that -print-library-module-manifest-path finds the correct file. mordante wrote: not per se, I thought this was common in clang, I'll remove it. https://github.com/llvm/llvm-project/pull/76451

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-19 Thread Mark de Wever via cfe-commits
@@ -0,0 +1,40 @@ +// Test that -print-library-module-manifest-path finds the correct file. + +// RUN: rm -rf %t +// RUN: mkdir -p %t +// RUN: touch %t/libc++.so +// RUN: split-file %s %t +// RUN: cd %t + +// RUN: %clang -print-library-module-manifest-path \ +// RUN:

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-19 Thread Mark de Wever via cfe-commits
@@ -0,0 +1,40 @@ +// Test that -print-library-module-manifest-path finds the correct file. + +// RUN: rm -rf %t mordante wrote: I copied the 3 line version from another test, I'll fix it. https://github.com/llvm/llvm-project/pull/76451

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-18 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,15 @@ +// Test that -print-library-module-manifest-path finds the correct file. + +// RUN: %clang -print-library-module-manifest-path \ MaskRay wrote: A lot of new options do support only the `--` form. For `--print-*` options, many support both `-`

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-18 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/76451 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-18 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,40 @@ +// Test that -print-library-module-manifest-path finds the correct file. MaskRay wrote: Is the `cxx23-` prefix useful? https://github.com/llvm/llvm-project/pull/76451 ___ cfe-commits mailing list

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-18 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/76451 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-18 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/76451 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-18 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,40 @@ +// Test that -print-library-module-manifest-path finds the correct file. + +// RUN: rm -rf %t +// RUN: mkdir -p %t +// RUN: touch %t/libc++.so +// RUN: split-file %s %t +// RUN: cd %t + +// RUN: %clang -print-library-module-manifest-path \ +// RUN:

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-18 Thread Fangrui Song via cfe-commits
@@ -6135,6 +6141,42 @@ std::string Driver::GetProgramPath(StringRef Name, const ToolChain ) const { return std::string(Name); } +std::string Driver::GetStdModuleManifestPath(const Compilation , + const ToolChain ) const { + +

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-18 Thread Fangrui Song via cfe-commits
@@ -6135,6 +6141,42 @@ std::string Driver::GetProgramPath(StringRef Name, const ToolChain ) const { return std::string(Name); } +std::string Driver::GetStdModuleManifestPath(const Compilation , + const ToolChain ) const { +

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-18 Thread Fangrui Song via cfe-commits
@@ -602,6 +602,17 @@ class Driver { // FIXME: This should be in CompilationInfo. std::string GetProgramPath(StringRef Name, const ToolChain ) const; + /// GetStdModuleManifestPath - Lookup the path to the Standard library module MaskRay wrote: Remove

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-18 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay requested changes to this pull request. https://github.com/llvm/llvm-project/pull/76451 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-18 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/76451 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-18 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,40 @@ +// Test that -print-library-module-manifest-path finds the correct file. + +// RUN: rm -rf %t +// RUN: mkdir -p %t +// RUN: touch %t/libc++.so +// RUN: split-file %s %t +// RUN: cd %t + +// RUN: %clang -print-library-module-manifest-path \ +// RUN:

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-18 Thread Fangrui Song via cfe-commits
https://github.com/MaskRay edited https://github.com/llvm/llvm-project/pull/76451 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-18 Thread Fangrui Song via cfe-commits
@@ -0,0 +1,40 @@ +// Test that -print-library-module-manifest-path finds the correct file. + +// RUN: rm -rf %t MaskRay wrote: You can remove `mkdir -p %t` and simplify this to `rm -rf %t && split-file %s %t && cd %t`. This does place 3 commands on one line,

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-18 Thread Mark de Wever via cfe-commits
https://github.com/mordante updated https://github.com/llvm/llvm-project/pull/76451 >From f3f0db64da4d341f8e4a2054f9f25c87f8eda829 Mon Sep 17 00:00:00 2001 From: Mark de Wever Date: Wed, 27 Dec 2023 17:34:10 +0100 Subject: [PATCH 1/5] [clang][modules] Print library module manifest path. This

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-17 Thread Chuanqi Xu via cfe-commits
ChuanqiXu9 wrote: > > LGTM. > > We need to delete > > `clang/test/Driver/Inputs/cxx23_modules/usr/lib/x86_64-linux-gnu/libc++.so` > > and > > `clang/test/Driver/Inputs/cxx23_modules/usr/lib/x86_64-linux-gnu/modules.json`, > > we should generate them with `split-file` > > Are you sure that

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-16 Thread Mark de Wever via cfe-commits
mordante wrote: > LGTM. > > We need to delete > `clang/test/Driver/Inputs/cxx23_modules/usr/lib/x86_64-linux-gnu/libc++.so` > and > `clang/test/Driver/Inputs/cxx23_modules/usr/lib/x86_64-linux-gnu/modules.json`, > we should generate them with `split-file` Are you sure that is the proper

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-14 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 edited https://github.com/llvm/llvm-project/pull/76451 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-14 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 edited https://github.com/llvm/llvm-project/pull/76451 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-14 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. LGTM. While we need to delete `clang/test/Driver/Inputs/cxx23_modules/usr/lib/x86_64-linux-gnu/libc++.so` and `clang/test/Driver/Inputs/cxx23_modules/usr/lib/x86_64-linux-gnu/modules.json`.

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-12 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff 8cf6bcf5a30673dd8a234ae3ef4ab4c1e63786b1 a8f9dc9edd98416a84d524ca6b233a27882f5085 --

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-12 Thread Mark de Wever via cfe-commits
https://github.com/mordante updated https://github.com/llvm/llvm-project/pull/76451 >From f3f0db64da4d341f8e4a2054f9f25c87f8eda829 Mon Sep 17 00:00:00 2001 From: Mark de Wever Date: Wed, 27 Dec 2023 17:34:10 +0100 Subject: [PATCH 1/4] [clang][modules] Print library module manifest path. This

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-12 Thread Mark de Wever via cfe-commits
@@ -0,0 +1,9 @@ +// Test that -print-library-module-manifest-path finds the correct file. +// +// Note this file is currently not available on Apple platforms mordante wrote: I'll remove this test for now. It can be added later when it's known where Apple will

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-12 Thread Mark de Wever via cfe-commits
@@ -6135,6 +6141,42 @@ std::string Driver::GetProgramPath(StringRef Name, const ToolChain ) const { return std::string(Name); } +std::string Driver::GetStdModuleManifestPath(const Compilation , + const ToolChain ) const { + +

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-11 Thread Chuanqi Xu via cfe-commits
@@ -6135,6 +6141,42 @@ std::string Driver::GetProgramPath(StringRef Name, const ToolChain ) const { return std::string(Name); } +std::string Driver::GetStdModuleManifestPath(const Compilation , + const ToolChain ) const { + +

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-11 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,15 @@ +// Test that -print-library-module-manifest-path finds the correct file. + +// RUN: %clang -print-library-module-manifest-path \ +// RUN: -stdlib=libc++ \ +// RUN: --sysroot=%S/Inputs/cxx23_modules \ +// RUN: --target=x86_64-linux-gnu 2>&1 \ +// RUN:

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-11 Thread Chuanqi Xu via cfe-commits
@@ -6135,6 +6141,42 @@ std::string Driver::GetProgramPath(StringRef Name, const ToolChain ) const { return std::string(Name); } +std::string Driver::GetStdModuleManifestPath(const Compilation , + const ToolChain ) const { + +

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-11 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 commented: LGTM generally. https://github.com/llvm/llvm-project/pull/76451 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-11 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,9 @@ +// Test that -print-library-module-manifest-path finds the correct file. +// +// Note this file is currently not available on Apple platforms ChuanqiXu9 wrote: I don't get the intention for the test since there is standard library related

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-11 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 edited https://github.com/llvm/llvm-project/pull/76451 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-11 Thread Mark de Wever via cfe-commits
mordante wrote: @ChuanqiXu9 can you do a full review? I'd like to have this reviewed so we can land it when the libc++ side is ready. https://github.com/llvm/llvm-project/pull/76451 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-11 Thread Mark de Wever via cfe-commits
https://github.com/mordante updated https://github.com/llvm/llvm-project/pull/76451 >From f3f0db64da4d341f8e4a2054f9f25c87f8eda829 Mon Sep 17 00:00:00 2001 From: Mark de Wever Date: Wed, 27 Dec 2023 17:34:10 +0100 Subject: [PATCH 1/3] [clang][modules] Print library module manifest path. This

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-03 Thread Mark de Wever via cfe-commits
https://github.com/mordante updated https://github.com/llvm/llvm-project/pull/76451 >From f3f0db64da4d341f8e4a2054f9f25c87f8eda829 Mon Sep 17 00:00:00 2001 From: Mark de Wever Date: Wed, 27 Dec 2023 17:34:10 +0100 Subject: [PATCH 1/2] [clang][modules] Print library module manifest path. This

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-03 Thread Mark de Wever via cfe-commits
https://github.com/mordante edited https://github.com/llvm/llvm-project/pull/76451 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-03 Thread Mark de Wever via cfe-commits
mordante wrote: > If this is the right thing to do (i.e., printing this information as part of > `-print-search-dirs`), then perhaps it's still worth it to try and fix? Once > you add a separate option, you will have to drag it forever (for backwards > compatibility). I have a feeling how

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2024-01-03 Thread Mark de Wever via cfe-commits
@@ -2164,6 +2164,12 @@ bool Driver::HandleImmediateArgs(const Compilation ) { return false; } + if (C.getArgs().hasArg(options::OPT_print_library_module_manifest_path)) { +llvm::outs() << "module: =" mordante wrote: I removed the prefix and return

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2023-12-30 Thread Boris Kolpackov via cfe-commits
boris-kolpackov wrote: > I had looked at `-print-search-dirs` but it seems buggy. For example, it > ignores the `-stdlib` flag to the compiler invocation. True. I couldn't find a bug report for this so I filed one: https://github.com/llvm/llvm-project/issues/76614 > Solving this seems a lot

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2023-12-30 Thread Mark de Wever via cfe-commits
mordante wrote: I had looked at `-print-search-dirs` but it seems buggy. For example, it ignores the `-stdlib` flag to the compiler invocation. Solving this seems a lot of work. So didn't want to add new features to that code. https://github.com/llvm/llvm-project/pull/76451

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2023-12-29 Thread Boris Kolpackov via cfe-commits
boris-kolpackov wrote: If I understand correctly, this invents a new option just to print the std modules path. Is there a reason why we cannot just print this information as part of `-print-search-dirs`? The benefit of this will be saving an extra compiler invocation in case the build system

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2023-12-29 Thread Ben Boeckel via cfe-commits
@@ -2164,6 +2164,12 @@ bool Driver::HandleImmediateArgs(const Compilation ) { return false; } + if (C.getArgs().hasArg(options::OPT_print_library_module_manifest_path)) { +llvm::outs() << "module: =" mathstuf wrote: I suppose that's good enough;

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2023-12-29 Thread Mark de Wever via cfe-commits
@@ -2164,6 +2164,12 @@ bool Driver::HandleImmediateArgs(const Compilation ) { return false; } + if (C.getArgs().hasArg(options::OPT_print_library_module_manifest_path)) { +llvm::outs() << "module: =" mordante wrote: > I'd like there to be some

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2023-12-29 Thread Thorsten Schütt via cfe-commits
@@ -2164,6 +2164,12 @@ bool Driver::HandleImmediateArgs(const Compilation ) { return false; } + if (C.getArgs().hasArg(options::OPT_print_library_module_manifest_path)) { +llvm::outs() << "module: =" tschuett wrote: If the output starts with a /,

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2023-12-29 Thread Ben Boeckel via cfe-commits
@@ -2164,6 +2164,12 @@ bool Driver::HandleImmediateArgs(const Compilation ) { return false; } + if (C.getArgs().hasArg(options::OPT_print_library_module_manifest_path)) { +llvm::outs() << "module: =" mathstuf wrote: I'd like there to be some

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2023-12-28 Thread Chuanqi Xu via cfe-commits
@@ -2164,6 +2164,12 @@ bool Driver::HandleImmediateArgs(const Compilation ) { return false; } + if (C.getArgs().hasArg(options::OPT_print_library_module_manifest_path)) { +llvm::outs() << "module: =" ChuanqiXu9 wrote: But "module: =" doesn't look

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2023-12-28 Thread Mark de Wever via cfe-commits
@@ -2164,6 +2164,12 @@ bool Driver::HandleImmediateArgs(const Compilation ) { return false; } + if (C.getArgs().hasArg(options::OPT_print_library_module_manifest_path)) { +llvm::outs() << "module: =" mordante wrote: returning an empty string gives

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2023-12-28 Thread Chuanqi Xu via cfe-commits
@@ -2164,6 +2164,12 @@ bool Driver::HandleImmediateArgs(const Compilation ) { return false; } + if (C.getArgs().hasArg(options::OPT_print_library_module_manifest_path)) { +llvm::outs() << "module: =" ChuanqiXu9 wrote: I don't get why we can't just

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2023-12-28 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,15 @@ +// Test that -print-library-module-manifest-path finds the correct file. ChuanqiXu9 wrote: Let's change the suffix of this file to `.cpp` https://github.com/llvm/llvm-project/pull/76451 ___

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2023-12-28 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,9 @@ +// Test that -print-library-module-manifest-path finds the correct file. ChuanqiXu9 wrote: Let's change the suffix. https://github.com/llvm/llvm-project/pull/76451 ___ cfe-commits mailing list

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2023-12-28 Thread Chuanqi Xu via cfe-commits
@@ -602,6 +602,16 @@ class Driver { // FIXME: This should be in CompilationInfo. std::string GetProgramPath(StringRef Name, const ToolChain ) const; + /// GetModuleManifestPath - Lookup the name of the Standard library manifest. + /// + /// \param C - The compilation.

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2023-12-28 Thread Mark de Wever via cfe-commits
@@ -602,6 +602,16 @@ class Driver { // FIXME: This should be in CompilationInfo. std::string GetProgramPath(StringRef Name, const ToolChain ) const; + /// GetModuleManifestPath - Lookup the name of the Standard library manifest. + /// + /// \param C - The compilation.

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2023-12-28 Thread Mark de Wever via cfe-commits
@@ -0,0 +1,15 @@ +// Test that -print-library-module-manifest-path finds the correct file. + +// RUN: %clang -print-library-module-manifest-path \ +// RUN: -stdlib=libc++ \ +// RUN: --sysroot=%S/Inputs/cxx23_modules \ +// RUN: --target=x86_64-linux-gnu 2>&1 \ +// RUN:

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2023-12-28 Thread Mark de Wever via cfe-commits
@@ -2164,6 +2164,12 @@ bool Driver::HandleImmediateArgs(const Compilation ) { return false; } + if (C.getArgs().hasArg(options::OPT_print_library_module_manifest_path)) { +llvm::outs() << "module: =" mordante wrote: some places do some don't.

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2023-12-28 Thread Thorsten Schütt via cfe-commits
@@ -2164,6 +2164,12 @@ bool Driver::HandleImmediateArgs(const Compilation ) { return false; } + if (C.getArgs().hasArg(options::OPT_print_library_module_manifest_path)) { +llvm::outs() << "module: =" tschuett wrote: ```shell > clang

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2023-12-27 Thread Chuanqi Xu via cfe-commits
@@ -602,6 +602,16 @@ class Driver { // FIXME: This should be in CompilationInfo. std::string GetProgramPath(StringRef Name, const ToolChain ) const; + /// GetModuleManifestPath - Lookup the name of the Standard library manifest. + /// + /// \param C - The compilation.

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2023-12-27 Thread Chuanqi Xu via cfe-commits
@@ -2164,6 +2164,12 @@ bool Driver::HandleImmediateArgs(const Compilation ) { return false; } + if (C.getArgs().hasArg(options::OPT_print_library_module_manifest_path)) { +llvm::outs() << "module: =" ChuanqiXu9 wrote: Do we need the prefix? I am

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2023-12-27 Thread Chuanqi Xu via cfe-commits
@@ -0,0 +1,15 @@ +// Test that -print-library-module-manifest-path finds the correct file. + +// RUN: %clang -print-library-module-manifest-path \ +// RUN: -stdlib=libc++ \ +// RUN: --sysroot=%S/Inputs/cxx23_modules \ +// RUN: --target=x86_64-linux-gnu 2>&1 \ +// RUN:

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2023-12-27 Thread Chuanqi Xu via cfe-commits
@@ -602,6 +602,16 @@ class Driver { // FIXME: This should be in CompilationInfo. std::string GetProgramPath(StringRef Name, const ToolChain ) const; + /// GetModuleManifestPath - Lookup the name of the Standard library manifest. + /// + /// \param C - The compilation.

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2023-12-27 Thread Chuanqi Xu via cfe-commits
@@ -5280,6 +5280,9 @@ def print_resource_dir : Flag<["-", "--"], "print-resource-dir">, def print_search_dirs : Flag<["-", "--"], "print-search-dirs">, HelpText<"Print the paths used for finding libraries and programs">, Visibility<[ClangOption, CLOption]>; +def

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2023-12-27 Thread Chuanqi Xu via cfe-commits
@@ -602,6 +602,16 @@ class Driver { // FIXME: This should be in CompilationInfo. std::string GetProgramPath(StringRef Name, const ToolChain ) const; + /// GetModuleManifestPath - Lookup the name of the Standard library manifest. ChuanqiXu9 wrote:

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2023-12-27 Thread Mark de Wever via cfe-commits
@@ -0,0 +1,15 @@ +// Test that -print-library-module-manifest-path finds the correct file. + +// RUN: %clang -print-library-module-manifest-path \ mordante wrote: I wasn't aware of that. I got used to using one dash using clang.

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2023-12-27 Thread Mark de Wever via cfe-commits
@@ -6135,6 +6141,40 @@ std::string Driver::GetProgramPath(StringRef Name, const ToolChain ) const { return std::string(Name); } +std::string Driver::GetModuleManifestPath(const Compilation , + const ToolChain ) const { + + switch

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2023-12-27 Thread Thorsten Schütt via cfe-commits
@@ -6135,6 +6141,40 @@ std::string Driver::GetProgramPath(StringRef Name, const ToolChain ) const { return std::string(Name); } +std::string Driver::GetModuleManifestPath(const Compilation , + const ToolChain ) const { + + switch

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2023-12-27 Thread Thorsten Schütt via cfe-commits
@@ -6135,6 +6141,40 @@ std::string Driver::GetProgramPath(StringRef Name, const ToolChain ) const { return std::string(Name); } +std::string Driver::GetModuleManifestPath(const Compilation , + const ToolChain ) const { + + switch

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2023-12-27 Thread Thorsten Schütt via cfe-commits
@@ -6135,6 +6141,40 @@ std::string Driver::GetProgramPath(StringRef Name, const ToolChain ) const { return std::string(Name); } +std::string Driver::GetModuleManifestPath(const Compilation , + const ToolChain ) const { + + switch

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2023-12-27 Thread Thorsten Schütt via cfe-commits
@@ -0,0 +1,15 @@ +// Test that -print-library-module-manifest-path finds the correct file. + +// RUN: %clang -print-library-module-manifest-path \ tschuett wrote: The trend seems to go to two dashes and there are no tests for 2 dashes.

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2023-12-27 Thread Mark de Wever via cfe-commits
@@ -602,6 +602,16 @@ class Driver { // FIXME: This should be in CompilationInfo. std::string GetProgramPath(StringRef Name, const ToolChain ) const; + /// GetModuleManifestPath - Lookup the name of the Standard library manifest. + /// + /// \param C - The compilation.

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2023-12-27 Thread Mark de Wever via cfe-commits
@@ -0,0 +1,15 @@ +// Test that -print-library-module-manifest-path finds the correct file. + +// RUN: %clang -print-library-module-manifest-path \ mordante wrote: They work with one or two dashes, `Flag<["-", "--"]`, in `Options.td` does that. This option does

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2023-12-27 Thread Thorsten Schütt via cfe-commits
@@ -0,0 +1,15 @@ +// Test that -print-library-module-manifest-path finds the correct file. + +// RUN: %clang -print-library-module-manifest-path \ tschuett wrote: --print-runtime-dir, --print-target-triple, --print-supported-cpus, and

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2023-12-27 Thread Thorsten Schütt via cfe-commits
@@ -602,6 +602,16 @@ class Driver { // FIXME: This should be in CompilationInfo. std::string GetProgramPath(StringRef Name, const ToolChain ) const; + /// GetModuleManifestPath - Lookup the name of the Standard library manifest. + /// + /// \param C - The compilation.

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2023-12-27 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver @llvm/pr-subscribers-clang Author: Mark de Wever (mordante) Changes This implements a way for the compiler to find the modules.json associated with the C++23 Standard library modules. This is based on a discussion in SG15. At the moment

[clang] [clang][modules] Print library module manifest path. (PR #76451)

2023-12-27 Thread Mark de Wever via cfe-commits
https://github.com/mordante created https://github.com/llvm/llvm-project/pull/76451 This implements a way for the compiler to find the modules.json associated with the C++23 Standard library modules. This is based on a discussion in SG15. At the moment no Standard library installs this