aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
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
commit10e7c60c0444a766c256f6c7c922e43963590a5c (patch)
treedc15d1025ebe86cb02972b19d3808bbf37230d8b /lib/CodeGen
parent14c38ec2afeaf25c53a50c2c65116aca8c889401 (diff)
emit a 0 byte instead of a noop if a function is empty on darwin.
"0" is nice and target independent. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94718 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/AsmPrinter/AsmPrinter.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 68fd77c0bd..e7a128623e 100644
--- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/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';