diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/XCore/XCoreAsmPrinter.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/Target/XCore/XCoreAsmPrinter.cpp b/lib/Target/XCore/XCoreAsmPrinter.cpp index 435062b..35ba299 100644 --- a/lib/Target/XCore/XCoreAsmPrinter.cpp +++ b/lib/Target/XCore/XCoreAsmPrinter.cpp @@ -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())+ |