mirror of
https://github.com/RPCS3/llvm.git
synced 2024-11-25 04:39:51 +00:00
EmitZerofill should take a 64-bit size or else it's chopping off large zero-filled global. rdar://11729134
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159023 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
04ce06dc4c
commit
c90a1fcf9f
@ -326,7 +326,7 @@ namespace llvm {
|
||||
/// @param ByteAlignment - The alignment of the zerofill symbol if
|
||||
/// non-zero. This must be a power of 2 on some targets.
|
||||
virtual void EmitZerofill(const MCSection *Section, MCSymbol *Symbol = 0,
|
||||
unsigned Size = 0,unsigned ByteAlignment = 0) = 0;
|
||||
uint64_t Size = 0,unsigned ByteAlignment = 0) = 0;
|
||||
|
||||
/// EmitTBSSSymbol - Emit a thread local bss (.tbss) symbol.
|
||||
///
|
||||
|
@ -171,7 +171,7 @@ public:
|
||||
unsigned ByteAlignment);
|
||||
|
||||
virtual void EmitZerofill(const MCSection *Section, MCSymbol *Symbol = 0,
|
||||
unsigned Size = 0, unsigned ByteAlignment = 0);
|
||||
uint64_t Size = 0, unsigned ByteAlignment = 0);
|
||||
|
||||
virtual void EmitTBSSSymbol (const MCSection *Section, MCSymbol *Symbol,
|
||||
uint64_t Size, unsigned ByteAlignment = 0);
|
||||
@ -529,7 +529,7 @@ void MCAsmStreamer::EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
|
||||
}
|
||||
|
||||
void MCAsmStreamer::EmitZerofill(const MCSection *Section, MCSymbol *Symbol,
|
||||
unsigned Size, unsigned ByteAlignment) {
|
||||
uint64_t Size, unsigned ByteAlignment) {
|
||||
// Note: a .zerofill directive does not switch sections.
|
||||
OS << ".zerofill ";
|
||||
|
||||
|
@ -91,7 +91,7 @@ public:
|
||||
unsigned ByteAlignment);
|
||||
|
||||
virtual void EmitZerofill(const MCSection *Section, MCSymbol *Symbol = 0,
|
||||
unsigned Size = 0, unsigned ByteAlignment = 0) {
|
||||
uint64_t Size = 0, unsigned ByteAlignment = 0) {
|
||||
llvm_unreachable("ELF doesn't support this directive");
|
||||
}
|
||||
virtual void EmitTBSSSymbol(const MCSection *Section, MCSymbol *Symbol,
|
||||
|
@ -74,7 +74,7 @@ public:
|
||||
llvm_unreachable("macho doesn't support this directive");
|
||||
}
|
||||
virtual void EmitZerofill(const MCSection *Section, MCSymbol *Symbol = 0,
|
||||
unsigned Size = 0, unsigned ByteAlignment = 0);
|
||||
uint64_t Size = 0, unsigned ByteAlignment = 0);
|
||||
virtual void EmitTBSSSymbol(const MCSection *Section, MCSymbol *Symbol,
|
||||
uint64_t Size, unsigned ByteAlignment = 0);
|
||||
virtual void EmitBytes(StringRef Data, unsigned AddrSpace);
|
||||
@ -326,7 +326,7 @@ void MCMachOStreamer::EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
|
||||
}
|
||||
|
||||
void MCMachOStreamer::EmitZerofill(const MCSection *Section, MCSymbol *Symbol,
|
||||
unsigned Size, unsigned ByteAlignment) {
|
||||
uint64_t Size, unsigned ByteAlignment) {
|
||||
MCSectionData &SectData = getAssembler().getOrCreateSectionData(*Section);
|
||||
|
||||
// The symbol may not be present, which only creates the section.
|
||||
|
@ -63,7 +63,7 @@ namespace {
|
||||
virtual void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
|
||||
unsigned ByteAlignment) {}
|
||||
virtual void EmitZerofill(const MCSection *Section, MCSymbol *Symbol = 0,
|
||||
unsigned Size = 0, unsigned ByteAlignment = 0) {}
|
||||
uint64_t Size = 0, unsigned ByteAlignment = 0) {}
|
||||
virtual void EmitTBSSSymbol(const MCSection *Section, MCSymbol *Symbol,
|
||||
uint64_t Size, unsigned ByteAlignment) {}
|
||||
virtual void EmitBytes(StringRef Data, unsigned AddrSpace) {}
|
||||
|
@ -39,7 +39,7 @@ public:
|
||||
virtual void EmitLabel(MCSymbol *Symbol);
|
||||
virtual void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value);
|
||||
virtual void EmitZerofill(const MCSection *Section, MCSymbol *Symbol = 0,
|
||||
unsigned Size = 0, unsigned ByteAlignment = 0);
|
||||
uint64_t Size = 0, unsigned ByteAlignment = 0);
|
||||
virtual void EmitBytes(StringRef Data, unsigned AddrSpace);
|
||||
virtual void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value = 0,
|
||||
unsigned ValueSize = 1,
|
||||
@ -144,7 +144,7 @@ void MCPureStreamer::EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) {
|
||||
}
|
||||
|
||||
void MCPureStreamer::EmitZerofill(const MCSection *Section, MCSymbol *Symbol,
|
||||
unsigned Size, unsigned ByteAlignment) {
|
||||
uint64_t Size, unsigned ByteAlignment) {
|
||||
report_fatal_error("not yet implemented in pure streamer");
|
||||
}
|
||||
|
||||
|
@ -67,7 +67,7 @@ public:
|
||||
virtual void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
|
||||
unsigned ByteAlignment);
|
||||
virtual void EmitZerofill(const MCSection *Section, MCSymbol *Symbol,
|
||||
unsigned Size,unsigned ByteAlignment);
|
||||
uint64_t Size,unsigned ByteAlignment);
|
||||
virtual void EmitTBSSSymbol(const MCSection *Section, MCSymbol *Symbol,
|
||||
uint64_t Size, unsigned ByteAlignment);
|
||||
virtual void EmitBytes(StringRef Data, unsigned AddrSpace);
|
||||
@ -324,7 +324,7 @@ void WinCOFFStreamer::EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
|
||||
}
|
||||
|
||||
void WinCOFFStreamer::EmitZerofill(const MCSection *Section, MCSymbol *Symbol,
|
||||
unsigned Size,unsigned ByteAlignment) {
|
||||
uint64_t Size,unsigned ByteAlignment) {
|
||||
llvm_unreachable("not implemented");
|
||||
}
|
||||
|
||||
|
11
test/CodeGen/X86/large-global.ll
Normal file
11
test/CodeGen/X86/large-global.ll
Normal file
@ -0,0 +1,11 @@
|
||||
; RUN: llc < %s -mtriple=x86_64-apple-macosx | FileCheck %s
|
||||
; rdar://11729134
|
||||
|
||||
; EmitZerofill was incorrectly expecting a 32-bit "size" so 26214400000
|
||||
; was printed as 444596224
|
||||
|
||||
%struct.X = type { [25000 x i8] }
|
||||
|
||||
@gArray = global [1048576 x %struct.X] zeroinitializer, align 16
|
||||
|
||||
; CHECK: .zerofill __DATA,__common,_gArray,26214400000,4
|
Loading…
Reference in New Issue
Block a user