mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-23 14:25:07 +00:00
IR: Do not consider available_externally linkage to be linker-weak.
From the linker's perspective, an available_externally global is equivalent to an external declaration (per isDeclarationForLinker()), so it is incorrect to consider it to be a weak definition. Also clean up some logic in the dead argument elimination pass and clarify its comments to better explain how its behavior depends on linkage, introduce GlobalValue::isStrongDefinitionForLinker() and start using it throughout the optimizers and backend. Differential Revision: http://reviews.llvm.org/D10941 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241413 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -265,9 +265,7 @@ TargetLowering::isOffsetFoldingLegal(const GlobalAddressSDNode *GA) const {
|
||||
|
||||
// In dynamic-no-pic mode, assume that known defined values are safe.
|
||||
if (getTargetMachine().getRelocationModel() == Reloc::DynamicNoPIC &&
|
||||
GA &&
|
||||
!GA->getGlobal()->isDeclaration() &&
|
||||
!GA->getGlobal()->isWeakForLinker())
|
||||
GA && GA->getGlobal()->isStrongDefinitionForLinker())
|
||||
return true;
|
||||
|
||||
// Otherwise assume nothing is safe.
|
||||
|
Reference in New Issue
Block a user