summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-04-03 22:19:41 +0000
committerChris Lattner <sabre@nondot.org>2010-04-03 22:19:41 +0000
commitc6d67d4ca56009b105d146f894dc8bcb56781ae9 (patch)
tree5a7ebc7a3ced482584c8d6bb55c0ae8a32da6032
parent1716721df17d300450eac9122d0eb659372f703b (diff)
downloadbcm5719-llvm-c6d67d4ca56009b105d146f894dc8bcb56781ae9.tar.gz
bcm5719-llvm-c6d67d4ca56009b105d146f894dc8bcb56781ae9.zip
emit the cygwin stub thing through mcstreamer.
llvm-svn: 100295
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 6791633bcfb..4f45f6514d0 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -164,7 +164,7 @@ void AsmPrinter::EmitLinkage(unsigned Linkage, MCSymbol *GVSym) const {
// .linkonce discard
// FIXME: It would be nice to use .linkonce samesize for non-common
// globals.
- OutStreamer.EmitRawText(LinkOnce);
+ OutStreamer.EmitRawText(StringRef(LinkOnce));
} else {
// .weak _foo
OutStreamer.EmitSymbolAttribute(GVSym, MCSA_Weak);
@@ -322,9 +322,13 @@ void AsmPrinter::EmitFunctionHeader() {
// Add some workaround for linkonce linkage on Cygwin\MinGW.
if (MAI->getLinkOnceDirective() != 0 &&
- (F->hasLinkOnceLinkage() || F->hasWeakLinkage()))
+ (F->hasLinkOnceLinkage() || F->hasWeakLinkage())) {
// FIXME: What is this?
- O << "Lllvm$workaround$fake$stub$" << *CurrentFnSym << ":\n";
+ MCSymbol *FakeStub =
+ OutContext.GetOrCreateSymbol(Twine("Lllvm$workaround$fake$stub$")+
+ CurrentFnSym->getName());
+ OutStreamer.EmitLabel(FakeStub);
+ }
// Emit pre-function debug and/or EH information.
if (MAI->doesSupportDebugInformation() || MAI->doesSupportExceptionHandling())
@@ -454,8 +458,11 @@ void AsmPrinter::EmitFunctionBody() {
// Emit target-specific gunk after the function body.
EmitFunctionBodyEnd();
- if (MAI->hasDotTypeDotSizeDirective())
+ // If the target wants a .size directive for the size of the function, emit
+ // it.
+ if (MAI->hasDotTypeDotSizeDirective()) {
O << "\t.size\t" << *CurrentFnSym << ", .-" << *CurrentFnSym << '\n';
+ }
// Emit post-function debug information.
if (MAI->doesSupportDebugInformation() || MAI->doesSupportExceptionHandling())
OpenPOWER on IntegriCloud