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:
commit
0bfc49b053
8 changed files with 40 additions and 27 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue