diff options
| author | Serge Pavlov <sepavloff@gmail.com> | 2013-06-27 14:35:03 +0000 |
|---|---|---|
| committer | Serge Pavlov <sepavloff@gmail.com> | 2013-06-27 14:35:03 +0000 |
| commit | 24a3ebb78d7772f8c1ad045900ca6e1c75e444e5 (patch) | |
| tree | 1b801d8873c84963d74b7f83f0a449a6a5cb69a4 /llvm/lib/MC/MCObjectStreamer.cpp | |
| parent | 1c348978872fd56fbe03bb0b887e3be4f673a903 (diff) | |
| download | bcm5719-llvm-24a3ebb78d7772f8c1ad045900ca6e1c75e444e5.tar.gz bcm5719-llvm-24a3ebb78d7772f8c1ad045900ca6e1c75e444e5.zip | |
Use MCFillFragment for zero-initialized data.
It fixes PR16338 (ICE when compiling very large two-dimensional array).
Differential Revision: http://llvm-reviews.chandlerc.com/D1043
llvm-svn: 185080
Diffstat (limited to 'llvm/lib/MC/MCObjectStreamer.cpp')
| -rw-r--r-- | llvm/lib/MC/MCObjectStreamer.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCObjectStreamer.cpp b/llvm/lib/MC/MCObjectStreamer.cpp index a1ed01cebcd..b2c9c5d0459 100644 --- a/llvm/lib/MC/MCObjectStreamer.cpp +++ b/llvm/lib/MC/MCObjectStreamer.cpp @@ -18,6 +18,7 @@ #include "llvm/MC/MCExpr.h" #include "llvm/MC/MCObjectWriter.h" #include "llvm/MC/MCSymbol.h" +#include "llvm/MC/MCSection.h" #include "llvm/Support/ErrorHandling.h" using namespace llvm; @@ -374,6 +375,12 @@ void MCObjectStreamer::EmitFill(uint64_t NumBytes, uint8_t FillValue, getOrCreateDataFragment()->getContents().append(NumBytes, FillValue); } +void MCObjectStreamer::EmitZeros(uint64_t NumBytes, unsigned AddrSpace) { + assert(AddrSpace == 0 && "Address space must be 0!"); + unsigned ItemSize = getCurrentSection().first->isVirtualSection() ? 0 : 1; + insert(new MCFillFragment(0, ItemSize, NumBytes)); +} + void MCObjectStreamer::FinishImpl() { // Dump out the dwarf file & directory tables and line tables. const MCSymbol *LineSectionSymbol = NULL; |

