mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
Xcore target
Fix emitArrayBound() calling OutStreamer.Emit*() multiple times when trying to print a single line git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187562 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f71698747e
commit
98369fb0e7
@ -83,12 +83,15 @@ void XCoreAsmPrinter::emitArrayBound(MCSymbol *Sym, const GlobalVariable *GV) {
|
||||
GV->hasWeakLinkage()) ||
|
||||
GV->hasLinkOnceLinkage()) && "Unexpected linkage");
|
||||
if (ArrayType *ATy = dyn_cast<ArrayType>(
|
||||
cast<PointerType>(GV->getType())->getElementType())) {
|
||||
OutStreamer.EmitSymbolAttribute(Sym, MCSA_Global);
|
||||
// FIXME: MCStreamerize.
|
||||
OutStreamer.EmitRawText(StringRef(".globound"));
|
||||
OutStreamer.EmitRawText("\t.set\t" + Twine(Sym->getName()));
|
||||
OutStreamer.EmitRawText(".globound," + Twine(ATy->getNumElements()));
|
||||
cast<PointerType>(GV->getType())->getElementType())) {
|
||||
|
||||
MCSymbol *SymGlob = OutContext.GetOrCreateSymbol(
|
||||
Twine(Sym->getName() + StringRef(".globound")));
|
||||
OutStreamer.EmitSymbolAttribute(SymGlob, MCSA_Global);
|
||||
|
||||
OutStreamer.EmitRawText("\t.set\t" + Twine(Sym->getName()) +
|
||||
".globound," + Twine(ATy->getNumElements()));
|
||||
|
||||
if (GV->hasWeakLinkage() || GV->hasLinkOnceLinkage()) {
|
||||
// TODO Use COMDAT groups for LinkOnceLinkage
|
||||
OutStreamer.EmitRawText(MAI->getWeakDefDirective() +Twine(Sym->getName())+
|
||||
|
@ -90,3 +90,7 @@ entry:
|
||||
@G8 = internal global i32 9312
|
||||
; CHECK: .section .dp.data,"awd",@progbits
|
||||
; CHECK: G8:
|
||||
|
||||
@array = global [10 x i16] zeroinitializer, align 2
|
||||
; CHECK: .globl array.globound
|
||||
; CHECK: .set array.globound,10
|
||||
|
Loading…
Reference in New Issue
Block a user