diff options
author | Dale Johannesen <dalej@apple.com> | 2008-05-14 20:12:51 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2008-05-14 20:12:51 +0000 |
commit | aafce77b17d340aace52bcd49d1944109d82f14a (patch) | |
tree | e7d1caf5f9d6c359802174c4a01644b9aa326202 /lib/Target/CellSPU | |
parent | 50871247216dfef8386a112766e972a1792b0b56 (diff) | |
download | external_llvm-aafce77b17d340aace52bcd49d1944109d82f14a.zip external_llvm-aafce77b17d340aace52bcd49d1944109d82f14a.tar.gz external_llvm-aafce77b17d340aace52bcd49d1944109d82f14a.tar.bz2 |
Add CommonLinkage; currently tentative definitions
are represented as "weak", but there are subtle differences
in some cases on Darwin, so we need both. The intent
is that "common" will behave identically to "weak" unless
somebody changes their target to do something else.
No functional change as yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51118 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/CellSPU')
-rw-r--r-- | lib/Target/CellSPU/SPUAsmPrinter.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Target/CellSPU/SPUAsmPrinter.cpp b/lib/Target/CellSPU/SPUAsmPrinter.cpp index f627896..4e4324b 100644 --- a/lib/Target/CellSPU/SPUAsmPrinter.cpp +++ b/lib/Target/CellSPU/SPUAsmPrinter.cpp @@ -340,7 +340,7 @@ void SPUAsmPrinter::printOp(const MachineOperand &MO) { // stubs if (TM.getRelocationModel() != Reloc::Static) { if (((GV->isDeclaration() || GV->hasWeakLinkage() || - GV->hasLinkOnceLinkage()))) { + GV->hasLinkOnceLinkage() || GV->hasCommonLinkage()))) { GVStubs.insert(Name); O << "L" << Name << "$non_lazy_ptr"; return; @@ -510,7 +510,7 @@ bool LinuxAsmPrinter::doFinalization(Module &M) { if (C->isNullValue() && /* FIXME: Verify correct */ (I->hasInternalLinkage() || I->hasWeakLinkage() || - I->hasLinkOnceLinkage() || + I->hasLinkOnceLinkage() || I->hasCommonLinkage() || (I->hasExternalLinkage() && !I->hasSection()))) { if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it. if (I->hasExternalLinkage()) { @@ -537,6 +537,7 @@ bool LinuxAsmPrinter::doFinalization(Module &M) { switch (I->getLinkage()) { case GlobalValue::LinkOnceLinkage: case GlobalValue::WeakLinkage: + case GlobalValue::CommonLinkage: O << "\t.global " << name << '\n' << "\t.weak_definition " << name << '\n'; SwitchToDataSection(".section __DATA,__datacoal_nt,coalesced", I); |