summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/CellSPU/SPUAsmPrinter.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2008-05-14 20:12:51 +0000
committerDale Johannesen <dalej@apple.com>2008-05-14 20:12:51 +0000
commitce4396bc92640e84cb8aa55e424f11341a3f1e3b (patch)
treee49fb307951b1f7cfdf182eee611d01333dc00df /llvm/lib/Target/CellSPU/SPUAsmPrinter.cpp
parente94e0f66cdd503e02936f0705ddf74ed9bf44e0c (diff)
downloadbcm5719-llvm-ce4396bc92640e84cb8aa55e424f11341a3f1e3b.tar.gz
bcm5719-llvm-ce4396bc92640e84cb8aa55e424f11341a3f1e3b.zip
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. llvm-svn: 51118
Diffstat (limited to 'llvm/lib/Target/CellSPU/SPUAsmPrinter.cpp')
-rw-r--r--llvm/lib/Target/CellSPU/SPUAsmPrinter.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Target/CellSPU/SPUAsmPrinter.cpp b/llvm/lib/Target/CellSPU/SPUAsmPrinter.cpp
index f627896f6b8..4e4324bbefe 100644
--- a/llvm/lib/Target/CellSPU/SPUAsmPrinter.cpp
+++ b/llvm/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);
OpenPOWER on IntegriCloud