simplify this logic a bit more.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75118 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2009-07-09 07:02:30 +00:00
parent 75cdf27f48
commit ac007b64ea

View File

@ -4582,18 +4582,14 @@ X86TargetLowering::LowerGlobalAddress(const GlobalValue *GV, DebugLoc dl,
// Link-once, declaration, or Weakly-linked global variables need
// non-lazily-resolved stubs.
if (!GV->isDeclaration() && !GV->isWeakForLinker()) {
if (!ExtraLoadRequired) {
// Not a stub reference.
OpFlags = IsPIC ? X86II::MO_PIC_BASE_OFFSET : 0;
} else if (!GV->hasHiddenVisibility()) {
// Non-hidden $non_lazy_ptr reference.
OpFlags = IsPIC ? X86II::MO_DARWIN_NONLAZY_PIC_BASE :
X86II::MO_DARWIN_NONLAZY;
} else if (!GV->isDeclaration() && !GV->hasCommonLinkage())
// Definition is definitely in the current linkage unit.
// Not a stub reference.
OpFlags = IsPIC ? X86II::MO_PIC_BASE_OFFSET : 0;
else {
} else {
// Hidden $non_lazy_ptr reference.
OpFlags = IsPIC ? X86II::MO_DARWIN_HIDDEN_NONLAZY_PIC_BASE :
X86II::MO_DARWIN_HIDDEN_NONLAZY;