[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
Evan Cheng
evan.cheng at apple.com
Thu Nov 30 23:56:52 PST 2006
Changes in directory llvm/lib/Target/PowerPC:
PPCAsmPrinter.cpp updated: 1.211 -> 1.212
---
Log message:
Darwin PPC external weak linkage support.
---
Diffs of the changes: (+15 -1)
PPCAsmPrinter.cpp | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletion(-)
Index: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
diff -u llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.211 llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.212
--- llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.211 Tue Nov 28 12:21:52 2006
+++ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp Fri Dec 1 01:56:37 2006
@@ -52,6 +52,9 @@
std::set<std::string> FnStubs, GVStubs;
const PPCSubtarget &Subtarget;
+ // Necessary for external weak linkage support
+ std::set<std::string> ExtWeakSymbols;
+
PPCAsmPrinter(std::ostream &O, TargetMachine &TM, const TargetAsmInfo *T)
: AsmPrinter(O, TM, T), Subtarget(TM.getSubtarget<PPCSubtarget>()) {
}
@@ -159,6 +162,8 @@
std::string Name = Mang->getValueName(GV);
FnStubs.insert(Name);
O << "L" << Name << "$stub";
+ if (GV->hasExternalWeakLinkage())
+ ExtWeakSymbols.insert(Name);
return;
}
}
@@ -330,8 +335,10 @@
return;
}
}
-
O << Name;
+
+ if (GV->hasExternalWeakLinkage())
+ ExtWeakSymbols.insert(Name);
return;
}
@@ -633,6 +640,13 @@
}
}
+ if (ExtWeakSymbols.begin() != ExtWeakSymbols.end())
+ SwitchToDataSection("");
+ for (std::set<std::string>::iterator i = ExtWeakSymbols.begin(),
+ e = ExtWeakSymbols.end(); i != e; ++i) {
+ O << "\t.weak_reference " << *i << "\n";
+ }
+
bool isPPC64 = TD->getPointerSizeInBits() == 64;
// Output stubs for dynamically-linked functions
More information about the llvm-commits
mailing list