diff options
author | Robert Lytton <robert@xmos.com> | 2013-08-01 07:52:05 +0000 |
---|---|---|
committer | Robert Lytton <robert@xmos.com> | 2013-08-01 07:52:05 +0000 |
commit | 98369fb0e72846179814e221d284bcb8b386e599 (patch) | |
tree | e4144df4075235d175033598359bbfaf3150f930 /lib/Target/XCore | |
parent | f71698747e07145657bd8595162439da40ebd749 (diff) | |
download | external_llvm-98369fb0e72846179814e221d284bcb8b386e599.zip external_llvm-98369fb0e72846179814e221d284bcb8b386e599.tar.gz external_llvm-98369fb0e72846179814e221d284bcb8b386e599.tar.bz2 |
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
Diffstat (limited to 'lib/Target/XCore')
-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())+ |