[PATCH] D139168: [C++20] [Modules] [ClangScanDeps] Enable to print make-style dependency file within P1689 format (4/4)

2023-01-06 Thread Arthur Laurent via Phabricator via cfe-commits
Arthapz added a comment.

Hi, just wanted to say that i added support of these patch to XMake and it work 
pretty well :)

  > xmake b -vD 
  
  [  0%]: generating.module.deps src/main.cpp
  checking for clang-scan-deps ... /usr/bin/clang-scan-deps
  checking for flags (-std=c++20) ... ok
  > clang "-std=c++20"
  checking for flags (-fmodules) ... ok
  > clang "-fmodules"
  /usr/bin/clang-scan-deps --format=p1689 -- /usr/bin/clang -x c++ -c 
src/main.cpp -o build/.objs/dependence/linux/x86_64/release/src/main.cpp.o 
-Qunused-arguments -m64 -std=c++20 -fmodules -fno-implicit-module-maps
  [  0%]: generating.module.deps src/foo.mpp
  /usr/bin/clang-scan-deps --format=p1689 -- /usr/bin/clang -x c++ -c 
src/foo.mpp -o build/.objs/dependence/linux/x86_64/release/src/foo.mpp.o 
-Qunused-arguments -m64 -std=c++20 -fmodules -fno-implicit-module-maps
  [  0%]: generating.module.deps src/zoo.mpp
  /usr/bin/clang-scan-deps --format=p1689 -- /usr/bin/clang -x c++ -c 
src/zoo.mpp -o build/.objs/dependence/linux/x86_64/release/src/zoo.mpp.o 
-Qunused-arguments -m64 -std=c++20 -fmodules -fno-implicit-module-maps
  [  0%]: generating.module.deps src/cat.mpp
  /usr/bin/clang-scan-deps --format=p1689 -- /usr/bin/clang -x c++ -c 
src/cat.mpp -o build/.objs/dependence/linux/x86_64/release/src/cat.mpp.o 
-Qunused-arguments -m64 -std=c++20 -fmodules -fno-implicit-module-maps
  [  0%]: generating.module.deps src/bar.mpp
  /usr/bin/clang-scan-deps --format=p1689 -- /usr/bin/clang -x c++ -c 
src/bar.mpp -o build/.objs/dependence/linux/x86_64/release/src/bar.mpp.o 
-Qunused-arguments -m64 -std=c++20 -fmodules -fno-implicit-module-maps
  checking for flags (clang_modules_cache_path) ... ok
  > clang "-fmodules-cache-path=/dev/shm/.xmake1000/230107"
  [ 10%]: compiling.module.release zoo
  /usr/bin/clang -c -x c++-module --precompile -Qunused-arguments -m64 
-std=c++20 -fmodules -fno-implicit-module-maps 
-fmodules-cache-path=build/.gens/dependence/linux/x86_64/release/rules/modules/cache
 -o build/.gens/dependence/linux/x86_64/release/rules/modules/cache/zoo.pcm 
src/zoo.mpp
  /usr/bin/clang -c -Qunused-arguments -m64 -std=c++20 -fmodules 
-fno-implicit-module-maps 
-fmodules-cache-path=build/.gens/dependence/linux/x86_64/release/rules/modules/cache
 -o build/.objs/dependence/linux/x86_64/release/src/zoo.mpp.o 
build/.gens/dependence/linux/x86_64/release/rules/modules/cache/zoo.pcm
  checking for flags (-MMD -MF) ... ok
  > clang "-MMD" "-MF" "/dev/null"
  [ 10%]: compiling.module.release cat
  /usr/bin/clang -c -x c++-module --precompile -Qunused-arguments -m64 
-std=c++20 -fmodules -fno-implicit-module-maps 
-fmodules-cache-path=build/.gens/dependence/linux/x86_64/release/rules/modules/cache
 -o build/.gens/dependence/linux/x86_64/release/rules/modules/cache/cat.pcm 
src/cat.mpp
  /usr/bin/clang -c -Qunused-arguments -m64 -std=c++20 -fmodules 
-fno-implicit-module-maps 
-fmodules-cache-path=build/.gens/dependence/linux/x86_64/release/rules/modules/cache
 -o build/.objs/dependence/linux/x86_64/release/src/cat.mpp.o 
build/.gens/dependence/linux/x86_64/release/rules/modules/cache/cat.pcm
  checking for flags (-fdiagnostics-color=always) ... ok
  > clang "-fdiagnostics-color=always"
  checking for flags (clang_module_file) ... ok
  > clang 
"-fmodule-file=/dev/shm/.xmake1000/230107/_11EA40624C464D10876A6DA3D0E41320.pcm"
  [ 30%]: compiling.module.release bar
  /usr/bin/clang -c -x c++-module --precompile -Qunused-arguments -m64 
-std=c++20 -fmodules -fno-implicit-module-maps 
-fmodules-cache-path=build/.gens/dependence/linux/x86_64/release/rules/modules/cache
 
-fmodule-file=build/.gens/dependence/linux/x86_64/release/rules/modules/cache/zoo.pcm
 -o build/.gens/dependence/linux/x86_64/release/rules/modules/cache/bar.pcm 
src/bar.mpp
  /usr/bin/clang -c -Qunused-arguments -m64 -std=c++20 -fmodules 
-fno-implicit-module-maps 
-fmodules-cache-path=build/.gens/dependence/linux/x86_64/release/rules/modules/cache
 
-fmodule-file=build/.gens/dependence/linux/x86_64/release/rules/modules/cache/zoo.pcm
 -o build/.objs/dependence/linux/x86_64/release/src/bar.mpp.o 
build/.gens/dependence/linux/x86_64/release/rules/modules/cache/bar.pcm
  [ 40%]: compiling.module.release foo
  /usr/bin/clang -c -x c++-module --precompile -Qunused-arguments -m64 
-std=c++20 -fmodules -fno-implicit-module-maps 
-fmodules-cache-path=build/.gens/dependence/linux/x86_64/release/rules/modules/cache
 
-fmodule-file=build/.gens/dependence/linux/x86_64/release/rules/modules/cache/bar.pcm
 
-fmodule-file=build/.gens/dependence/linux/x86_64/release/rules/modules/cache/zoo.pcm
 
-fmodule-file=build/.gens/dependence/linux/x86_64/release/rules/modules/cache/cat.pcm
 -o build/.gens/dependence/linux/x86_64/release/rules/modules/cache/foo.pcm 
src/foo.mpp
  /usr/bin/clang -c -Qunused-arguments -m64 -std=c++20 -fmodules 
-fno-implicit-module-maps 
-fmodules-cac

[PATCH] D139168: [C++20] [Modules] [ClangScanDeps] Enable to print make-style dependency file within P1689 format (4/4)

2023-01-09 Thread Arthur Laurent via Phabricator via cfe-commits
Arthapz added a comment.

> BTW, for header units, it is still under discussion that how should build 
> system and compiler interact about header units. It is still unclear whether 
> or not the header units should be transparent to build systems (and other 
> tools).

On XMake we built our support around MSVC then extended support to GCC and 
clang, so we handle header units separately from named modules (but in a 
similar way), i don't have problem to add some logic in XMake to support them 
for clang


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139168/new/

https://reviews.llvm.org/D139168

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D142704: [C++20][Modules] Handle template declarations in header units.

2023-01-28 Thread Arthur Laurent via Phabricator via cfe-commits
Arthapz added a comment.

tried the patch and it seems to work with libstdc++ but not with libc++

  > rm -rf .xmake build; xmake f --toolchain=clang; xmake b
  checking for platform ... linux
  checking for architecture ... x86_64
  [  0%]: generating.module.deps src/main.cpp
  [  4%]: compiling.headerunit.release iostream
  [  4%]: compiling.headerunit.release utility
  [  4%]: compiling.headerunit.release cstdio
  [  4%]: compiling.headerunit.release vector
  [  4%]: compiling.headerunit.release fstream
  [  4%]: compiling.headerunit.release memory
  [  4%]: compiling.headerunit.release queue
  [  4%]: compiling.headerunit.release string
  [  4%]: compiling.headerunit.release map
  [  4%]: compiling.headerunit.release complex
  [  4%]: compiling.headerunit.release deque
  [  4%]: compiling.headerunit.release iomanip
  [  4%]: compiling.headerunit.release cstdlib
  [  4%]: compiling.headerunit.release set
  [  4%]: compiling.headerunit.release algorithm
  [  4%]: compiling.headerunit.release exception
  [  4%]: compiling.headerunit.release stack
  [  4%]: compiling.headerunit.release list
  [ 88%]: compiling.release src/main.cpp
  [ 92%]: linking.release stl_headerunit_cpp_only
  [100%]: build ok!
  
  > rm -rf .xmake build; xmake f --toolchain=clang --cxxflags="-stdlib=libc++"; 
xmake b 
  
  checking for platform ... linux
  checking for architecture ... x86_64
  [  0%]: generating.module.deps src/main.cpp
  [  4%]: compiling.headerunit.release memory
  [  4%]: compiling.headerunit.release exception
  [  4%]: compiling.headerunit.release queue
  [  4%]: compiling.headerunit.release iomanip
  [  4%]: compiling.headerunit.release vector
  [  4%]: compiling.headerunit.release utility
  [  4%]: compiling.headerunit.release deque
  [  4%]: compiling.headerunit.release set
  [  4%]: compiling.headerunit.release map
  [  4%]: compiling.headerunit.release fstream
  [  4%]: compiling.headerunit.release cstdio
  [  4%]: compiling.headerunit.release complex
  [  4%]: compiling.headerunit.release cstdlib
  [  4%]: compiling.headerunit.release iostream
  [  4%]: compiling.headerunit.release list
  [  4%]: compiling.headerunit.release string
  [  4%]: compiling.headerunit.release stack
  [  4%]: compiling.headerunit.release algorithm
  [ 88%]: compiling.release src/main.cpp
  error: /usr/bin/../include/c++/v1/ostream:254:20: error: 
'std::basic_ostream::operator<<' from module 
'/usr/bin/../include/c++/v1/complex' is not present in definition of 
'std::ostream' in module '/usr/bin/../include/c++/v1/iostream'
  basic_ostream& operator<<(basic_streambuf* __sb);
 ^
  /usr/bin/../include/c++/v1/ostream:221:20: note: declaration of 'operator<<' 
does not match
  basic_ostream& operator<<(basic_ostream& (*__pf)(basic_ostream&))
 ^
  /usr/bin/../include/c++/v1/ostream:225:20: note: declaration of 'operator<<' 
does not match
  basic_ostream& operator<<(basic_ios&
 ^
  /usr/bin/../include/c++/v1/ostream:230:20: note: declaration of 'operator<<' 
does not match
  basic_ostream& operator<<(ios_base& (*__pf)(ios_base&))
 ^
  /usr/bin/../include/c++/v1/ostream:233:20: note: declaration of 'operator<<' 
does not match
  basic_ostream& operator<<(bool __n);
 ^
  /usr/bin/../include/c++/v1/ostream:234:20: note: declaration of 'operator<<' 
does not match
  basic_ostream& operator<<(short __n);
> in src/main.cpp

  > cat src/main.cpp
  import ;
  import ;
  import ;
  import ;
  import ;
  import ;
  import ;
  import ;
  import ;
  import ;
  import ;
  import ;
  import ;
  import ;
  import ;
  import ;
  import ;
  import ;
  import ;
  import ;
  
  using namespace std;
  
  int main(int argc, char** argv)
  {
  cout << "hello world!" << endl;
  return 0;
  }


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142704/new/

https://reviews.llvm.org/D142704

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits