forked from OSchip/llvm-project
Xcore target
Fix emitArrayBound() calling OutStreamer.Emit*() multiple times when trying to print a single line llvm-svn: 187562
This commit is contained in:
parent
ad5ccc2d75
commit
b4787a159d
|
@ -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