mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-17 04:24:00 +00:00
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185080 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user