summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter.cpp
index 8757d303ec8..833ed28f085 100644
--- a/llvm/lib/CodeGen/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter.cpp
@@ -106,6 +106,18 @@ bool AsmPrinter::doInitialization(Module &M) {
}
bool AsmPrinter::doFinalization(Module &M) {
+ if (TAI->getWeakRefDirective()) {
+ if (ExtWeakSymbols.begin() != ExtWeakSymbols.end())
+ SwitchToDataSection("");
+
+ for (std::set<const GlobalValue*>::iterator i = ExtWeakSymbols.begin(),
+ e = ExtWeakSymbols.end(); i != e; ++i) {
+ const GlobalValue *GV = *i;
+ std::string Name = Mang->getValueName(GV);
+ O << TAI->getWeakRefDirective() << Name << "\n";
+ }
+ }
+
delete Mang; Mang = 0;
return false;
}
OpenPOWER on IntegriCloud