1
Fork 0

cleanup: add some comments per review feedback

This commit is contained in:
Augie Fackler 2021-03-22 14:37:49 -04:00
parent babe894bab
commit 9431e8577d
2 changed files with 6 additions and 0 deletions

View file

@ -1438,6 +1438,9 @@ LLVMRustCreateThinLTOData(LLVMRustThinLTOModule *modules,
};
#if LLVM_VERSION_GE(13,0)
// Uses FromPrevailing visibility scheme which works for many binary
// formats. We probably could and should use ELF visibility scheme for many of
// our targets, however.
lto::Config conf;
thinLTOResolvePrevailingInIndex(conf, Ret->Index, isPrevailing, recordNewLinkage,
Ret->GUIDPreservedSymbols);

View file

@ -383,6 +383,9 @@ LLVMRustBuildAtomicCmpXchg(LLVMBuilderRef B, LLVMValueRef Target,
LLVMAtomicOrdering Order,
LLVMAtomicOrdering FailureOrder, LLVMBool Weak) {
#if LLVM_VERSION_GE(13,0)
// Rust probably knows the alignment of the target value and should be able to
// specify something more precise than MaybeAlign here. See also
// https://reviews.llvm.org/D97224 which may be a useful reference.
AtomicCmpXchgInst *ACXI = unwrap(B)->CreateAtomicCmpXchg(
unwrap(Target), unwrap(Old), unwrap(Source), llvm::MaybeAlign(), fromRust(Order),
fromRust(FailureOrder));