Skip to content

Commit 12c3f50

Browse files
committed
PassWrapper: handle function rename from upstream D36850
thinLTOResolvePrevailingInModule became thinLTOFinalizeInModule and gained the ability to propagate noRecurse and noUnwind function attributes. I ran codegen tests with it both on and off, as the upstream patch uses it in both modes, and the tests pass both ways. Given that, it seemed reasonable to go ahead and let the propagation be enabled in rustc, and see what happens. See https://reviews.llvm.org/D36850 for more examples of how the new version of the function gets used.
1 parent 2b6ed3b commit 12c3f50

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -1572,7 +1572,11 @@ extern "C" bool
15721572
LLVMRustPrepareThinLTOResolveWeak(const LLVMRustThinLTOData *Data, LLVMModuleRef M) {
15731573
Module &Mod = *unwrap(M);
15741574
const auto &DefinedGlobals = Data->ModuleToDefinedGVSummaries.lookup(Mod.getModuleIdentifier());
1575+
#if LLVM_VERSION_GE(14, 0)
1576+
thinLTOFinalizeInModule(Mod, DefinedGlobals, /*PropagateAttrs=*/true);
1577+
#else
15751578
thinLTOResolvePrevailingInModule(Mod, DefinedGlobals);
1579+
#endif
15761580
return true;
15771581
}
15781582

0 commit comments

Comments
 (0)