summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-04-27 07:41:44 +0000
committerChris Lattner <sabre@nondot.org>2010-04-27 07:41:44 +0000
commit64d43d80be37caf43bc7e116d5dc7d67f745533b (patch)
tree72472420f09d277c30c77f774113ae607e72b0a0 /llvm/lib/CodeGen
parentf205977e6fffc01f11faaee00bcc673da24b1fac (diff)
downloadbcm5719-llvm-64d43d80be37caf43bc7e116d5dc7d67f745533b.tar.gz
bcm5719-llvm-64d43d80be37caf43bc7e116d5dc7d67f745533b.zip
round zero-byte .zerofill directives up to 1 byte. This
should fix some "g++.dg-struct-layout-1" failures, rdar://7886017 llvm-svn: 102421
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 31cb0cab580..f000a7063d5 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -283,6 +283,8 @@ void AsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) {
// Handle the zerofill directive on darwin, which is a special form of BSS
// emission.
if (GVKind.isBSSExtern() && MAI->hasMachoZeroFillDirective()) {
+ if (Size == 0) Size = 1; // zerofill of 0 bytes is undefined.
+
// .globl _foo
OutStreamer.EmitSymbolAttribute(GVSym, MCSA_Global);
// .zerofill __DATA, __common, _foo, 400, 5
OpenPOWER on IntegriCloud