diff options
author | Chris Lattner <sabre@nondot.org> | 2010-04-27 07:41:44 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-04-27 07:41:44 +0000 |
commit | 4c4d0c0cc582a61d9e7f58594c71540aaa56b280 (patch) | |
tree | abcf41eb3d85f6beee70b48146fd7ca8b3b2ee29 /lib/CodeGen | |
parent | 77640feed77b2e3a5edacd5b36305d5400fc4705 (diff) |
round zero-byte .zerofill directives up to 1 byte. This
should fix some "g++.dg-struct-layout-1" failures,
rdar://7886017
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102421 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 31cb0cab58..f000a7063d 100644 --- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/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 |