diff options
author | Chuanqi Xu <yedeng.yd@linux.alibaba.com> | 2024-02-23 10:59:46 +0800 |
---|---|---|
committer | Chuanqi Xu <yedeng.yd@linux.alibaba.com> | 2024-02-23 11:05:15 +0800 |
commit | 2e5af56b05c2d39ab2c829bf4c13190523b67ddd (patch) | |
tree | 59c9917f61b3c1ba0c1c771a4b193050b7c09861 /llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp | |
parent | 5ccf54640a2bdb6f36f65c574feb312da7f75243 (diff) | |
download | llvm-2e5af56b05c2d39ab2c829bf4c13190523b67ddd.zip llvm-2e5af56b05c2d39ab2c829bf4c13190523b67ddd.tar.gz llvm-2e5af56b05c2d39ab2c829bf4c13190523b67ddd.tar.bz2 |
[C++20] [Modules] Allow to compile a pcm with and without -fPIC
seperately
We can compile a module unit in 2 phase compilaton:
```
clang++ -std=c++20 a.cppm --precompile -o a.pcm
clang++ -std=c++20 a.pcm -c -o a.o
```
And it is a general requirement that we need to compile a translation
unit with and without -fPIC for static and shared libraries.
But for C++20 modules with 2 phase compilation, it may be waste of time
to compile them 2 times completely. It may be fine to generate one BMI
and compile it with and without -fPIC seperately.
e.g.,
```
clang++ -std=c++20 a.cppm --precompile -o a.pcm
clang++ -std=c++20 a.pcm -c -o a.o
clang++ -std=c++20 a.pcm -c -fPIC -o a-PIC.o
```
Then we can save the time to parse a.cppm repeatedly.
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp')
0 files changed, 0 insertions, 0 deletions