1
Fork 0

Rollup merge of #131876 - workingjubilee:llvm-c-c-c-comdat, r=Zalathar

compiler: Use LLVM's Comdat support

Acting on these long-ago issues:
- https://github.com/rust-lang/rust/issues/46437
- https://github.com/rust-lang/rust/issues/68955
This commit is contained in:
Stuart Cook 2024-10-20 14:06:03 +11:00 committed by GitHub
commit 0bfc49b053
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 40 additions and 27 deletions

View file

@ -1658,16 +1658,6 @@ extern "C" void LLVMRustPositionBuilderAtStart(LLVMBuilderRef B,
unwrap(B)->SetInsertPoint(unwrap(BB), Point);
}
extern "C" void LLVMRustSetComdat(LLVMModuleRef M, LLVMValueRef V,
const char *Name, size_t NameLen) {
Triple TargetTriple = Triple(unwrap(M)->getTargetTriple());
GlobalObject *GV = unwrap<GlobalObject>(V);
if (TargetTriple.supportsCOMDAT()) {
StringRef NameRef(Name, NameLen);
GV->setComdat(unwrap(M)->getOrInsertComdat(NameRef));
}
}
enum class LLVMRustLinkage {
ExternalLinkage = 0,
AvailableExternallyLinkage = 1,