summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-01-18 01:12:56 +0000
committerChris Lattner <sabre@nondot.org>2007-01-18 01:12:56 +0000
commit0ee2d46cfed2ecc104118449602239eaf2a89d05 (patch)
tree23ffd98e8b3db9321ca2da1df418031d30eec77f /llvm/lib/CodeGen
parent7300651384fea213f4fe023f089f0e652d7f045d (diff)
downloadbcm5719-llvm-0ee2d46cfed2ecc104118449602239eaf2a89d05.tar.gz
bcm5719-llvm-0ee2d46cfed2ecc104118449602239eaf2a89d05.zip
add new JumpTableSpecialLabelPrefix hook to asmprinter for jumptable emission.
llvm-svn: 33314
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter.cpp
index caa9da0d2ff..a9e720149ec 100644
--- a/llvm/lib/CodeGen/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter.cpp
@@ -244,6 +244,13 @@ void AsmPrinter::EmitJumpTableInfo(MachineJumpTableInfo *MJTI,
if (EmittedSets.insert(JTBBs[ii]).second)
printSetLabel(i, JTBBs[ii]);
+ // On some targets (e.g. darwin) we want to emit two consequtive labels
+ // before each jump table. The first label is never referenced, but tells
+ // the assembler and linker the extents of the jump table object. The
+ // second label is actually referenced by the code.
+ if (const char *JTLabelPrefix = TAI->getJumpTableSpecialLabelPrefix())
+ O << JTLabelPrefix << "JTI" << getFunctionNumber() << '_' << i << ":\n";
+
O << TAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber()
<< '_' << i << ":\n";
@@ -259,7 +266,8 @@ void AsmPrinter::EmitJumpTableInfo(MachineJumpTableInfo *MJTI,
<< '_' << i << "_set_" << JTBBs[ii]->getNumber();
} else if (IsPic) {
printBasicBlockLabel(JTBBs[ii], false, false);
- //If the arch uses custom Jump Table directives, don't calc relative to JT
+ // If the arch uses custom Jump Table directives, don't calc relative to
+ // JT
if (!HadJTEntryDirective)
O << '-' << TAI->getPrivateGlobalPrefix() << "JTI"
<< getFunctionNumber() << '_' << i;
OpenPOWER on IntegriCloud