summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-01-28 01:06:32 +0000
committerChris Lattner <sabre@nondot.org>2010-01-28 01:06:32 +0000
commit565896b9ebe0b2efea98a68ba06ed7e09c797f99 (patch)
treeff2a1f0cf81fb476e4ecc8234d9dcee4ee31e5d7 /llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
parente4fd3300c9bc771a413c7abe46e7cbd02e8815a1 (diff)
downloadbcm5719-llvm-565896b9ebe0b2efea98a68ba06ed7e09c797f99.tar.gz
bcm5719-llvm-565896b9ebe0b2efea98a68ba06ed7e09c797f99.zip
emit a 0 byte instead of a noop if a function is empty on darwin.
"0" is nice and target independent. llvm-svn: 94718
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 68fd77c0bdb..e7a128623e4 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -376,10 +376,8 @@ void AsmPrinter::EmitFunctionBody() {
// If the function is empty and the object file uses .subsections_via_symbols,
// then we need to emit *some* thing to the function body to prevent the
// labels from collapsing together.
- if (MAI->hasSubsectionsViaSymbols() && !HasAnyRealCode) {
- // FIXME: EmitByte(0).
- O << "\tnop\n";
- }
+ if (MAI->hasSubsectionsViaSymbols() && !HasAnyRealCode)
+ OutStreamer.EmitIntValue(0, 1, 0/*addrspace*/);
if (MAI->hasDotTypeDotSizeDirective())
O << "\t.size\t" << *CurrentFnSym << ", .-" << *CurrentFnSym << '\n';
OpenPOWER on IntegriCloud