aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-04-05 16:32:14 +0000
committerChris Lattner <sabre@nondot.org>2010-04-05 16:32:14 +0000
commit0752cda4de245978e14d806831abba4506272cd0 (patch)
tree286961023f4089ba8c4b10c3c4fb023250903eb4
parent75e818ad2f6b809ff6644de2a7c2ec35d68c92ea (diff)
fix a couple problems I introduced handling symbols
with spaces in them. Sym->getName() != OS << *Sym git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100434 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
index 419af5d906..8e855f5be7 100644
--- a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
+++ b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
@@ -237,7 +237,7 @@ namespace {
if (ACPV->isLSDA()) {
O << MAI->getPrivateGlobalPrefix() << "_LSDA_" << getFunctionNumber();
} else if (ACPV->isBlockAddress()) {
- O << GetBlockAddressSymbol(ACPV->getBlockAddress())->getName();
+ O << *GetBlockAddressSymbol(ACPV->getBlockAddress());
} else if (ACPV->isGlobalValue()) {
GlobalValue *GV = ACPV->getGV();
bool isIndirect = Subtarget->isTargetDarwin() &&
@@ -281,10 +281,16 @@ namespace {
void ARMAsmPrinter::EmitFunctionEntryLabel() {
if (AFI->isThumbFunction()) {
OutStreamer.EmitRawText(StringRef("\t.code\t16"));
- if (Subtarget->isTargetDarwin())
- OutStreamer.EmitRawText("\t.thumb_func\t"+Twine(CurrentFnSym->getName()));
- else
+ if (!Subtarget->isTargetDarwin())
OutStreamer.EmitRawText(StringRef("\t.thumb_func"));
+ else {
+ // This needs to emit to a temporary string to get properly quoted
+ // MCSymbols when they have spaces in them.
+ SmallString<128> Tmp;
+ raw_svector_ostream OS(Tmp);
+ OS << "\t.thumb_func\t" << *CurrentFnSym;
+ OutStreamer.EmitRawText(OS.str());
+ }
}
OutStreamer.EmitLabel(CurrentFnSym);