These module flags use the Min merge behavior with a default value of
zero, so we don't need to emit them if zero.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/IR/AutoUpgrade.cpp | ||
---|---|---|
4415–4430 ↗ | (On Diff #446053) | In a full LTO build the linker will complain about the mis match between the flags if one of the objects compiled with an older compiler that emitted Module:Error for these flags. |
llvm/lib/IR/AutoUpgrade.cpp | ||
---|---|---|
4415–4430 ↗ | (On Diff #446053) | The new approach doesnot emit a flag for 0 value, so there won't be an error even with old bitcode files using Error. |
llvm/lib/IR/AutoUpgrade.cpp | ||
---|---|---|
4415–4430 ↗ | (On Diff #446053) | older compiler could emit Module:Error with 0 and with this patch we emit 1 with min so the linker will stop with clang++-13 -flto=full -c foo.cpp -o foo.o ../build/bin/clang++ -flto=full -c main.cpp -o main.o -mbranch-protection=standard ../build/bin/clang++ -fuse-ld=lld main.o foo.o -o a.out |
llvm/lib/IR/AutoUpgrade.cpp | ||
---|---|---|
4415–4430 ↗ | (On Diff #446053) | Perhaps we should respect the Error for older llvm and not try fixing it for regular LTO? If you feel this is strongly needed, I'll have to restore this chunk. The main purpose is to remove the module flags for 0. |