[llvm] r187562 - Xcore target
Robert Lytton
robert at xmos.com
Thu Aug 1 00:52:05 PDT 2013
Author: rlytton
Date: Thu Aug 1 02:52:05 2013
New Revision: 187562
URL: http://llvm.org/viewvc/llvm-project?rev=187562&view=rev
Log:
Xcore target
Fix emitArrayBound() calling OutStreamer.Emit*() multiple times when trying to print a single line
Modified:
llvm/trunk/lib/Target/XCore/XCoreAsmPrinter.cpp
llvm/trunk/test/CodeGen/XCore/globals.ll
Modified: llvm/trunk/lib/Target/XCore/XCoreAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreAsmPrinter.cpp?rev=187562&r1=187561&r2=187562&view=diff
==============================================================================
--- llvm/trunk/lib/Target/XCore/XCoreAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/XCore/XCoreAsmPrinter.cpp Thu Aug 1 02:52:05 2013
@@ -83,12 +83,15 @@ void XCoreAsmPrinter::emitArrayBound(MCS
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())+
Modified: llvm/trunk/test/CodeGen/XCore/globals.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/XCore/globals.ll?rev=187562&r1=187561&r2=187562&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/XCore/globals.ll (original)
+++ llvm/trunk/test/CodeGen/XCore/globals.ll Thu Aug 1 02:52:05 2013
@@ -90,3 +90,7 @@ entry:
@G8 = internal global i32 9312
; CHECK: .section .dp.data,"awd", at progbits
; CHECK: G8:
+
+ at array = global [10 x i16] zeroinitializer, align 2
+; CHECK: .globl array.globound
+; CHECK: .set array.globound,10
More information about the llvm-commits
mailing list